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 int
cpuUsage
private boolean
isRunning
(package private) Handler
mHandler
(package private) java.io.RandomAccessFile
reader
-
Constructor Summary
Constructors Constructor and Description SystemWatchThread(Handler h)
-
Method Summary
Methods Modifier and Type Method and Description private void
closeStatFile()
int
getCpuUsage()
private void
openStatFile()
private float
readUsage()
Gets CPU usage from /proc/stat.void
run()
boolean
stopRunning()
-
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:
run
in interfacejava.lang.Runnable
- Overrides:
run
in 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()
-
-