SystemWatchThread
JavaScript is disabled on your browser.
br.usp.ime.dspbenchmarking.threads
Class SystemWatchThread
- java.lang.Object
-
- java.lang.Thread
-
- br.usp.ime.dspbenchmarking.threads.SystemWatchThread
-
- All Implemented Interfaces:
- java.lang.Runnable
public class SystemWatchThread extends java.lang.Thread
Monitor system parameters and send messages to the main thread.
-
-
Field Summary
Fields Modifier and Type Field and Description private intcpuUsageprivate booleanisRunning(package private) HandlermHandler(package private) java.io.RandomAccessFilereader
-
Constructor Summary
Constructors Constructor and Description SystemWatchThread(Handler h)
-
Method Summary
Methods Modifier and Type Method and Description private voidcloseStatFile()intgetCpuUsage()private voidopenStatFile()private floatreadUsage()Gets CPU usage from /proc/stat.voidrun()booleanstopRunning()-
Methods inherited from class java.lang.Thread
activeCount, checkAccess, clone, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield
-
-
-
-
Field Detail
-
isRunning
private boolean isRunning
-
mHandler
Handler mHandler
-
cpuUsage
private int cpuUsage
-
reader
java.io.RandomAccessFile reader
-
-
Method Detail
-
run
public void run()
- Specified by:
runin interfacejava.lang.Runnable- Overrides:
runin classjava.lang.Thread
-
getCpuUsage
public int getCpuUsage()
-
stopRunning
public boolean stopRunning()
-
openStatFile
private void openStatFile()
-
readUsage
private float readUsage()
Gets CPU usage from /proc/stat.
-
closeStatFile
private void closeStatFile()
-
-