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.
    • Nested Class Summary

      • Nested classes/interfaces inherited from class java.lang.Thread

        java.lang.Thread.State, java.lang.Thread.UncaughtExceptionHandler
    • 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 
      • Fields inherited from class java.lang.Thread

        MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
    • 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
      • Methods inherited from class java.lang.Object

        equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Field Detail

      • isRunning

        private boolean isRunning
      • mHandler

        Handler mHandler
      • cpuUsage

        private int cpuUsage
      • reader

        java.io.RandomAccessFile reader
    • Constructor Detail

      • SystemWatchThread

        public SystemWatchThread(Handler h)
    • Method Detail

      • run

        public void run()
        Specified by:
        run in interface java.lang.Runnable
        Overrides:
        run in class java.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()