systeminformationmonitor.system
Class CpuInformation

java.lang.Object
  extended by java.lang.Thread
      extended by systeminformationmonitor.system.AbstractSystemUpdater
          extended by systeminformationmonitor.system.CpuInformation
All Implemented Interfaces:
java.lang.Runnable

public class CpuInformation
extends AbstractSystemUpdater

Singleton class which is able to retrieve Cpu information specs.


Nested Class Summary
 
Nested classes/interfaces inherited from class java.lang.Thread
java.lang.Thread.State, java.lang.Thread.UncaughtExceptionHandler
 
Field Summary
 
Fields inherited from class systeminformationmonitor.system.AbstractSystemUpdater
sigar, threadLock
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Method Summary
 void addCpuMonitor(Monitor monitor)
          Adds a monitor to be updated with the cpuInformation is updated.
 int getCpuAverageUsage()
          Returns he average Cpu usage of all cpus.
static java.lang.String getCpuCache()
          Returns the cpu cache.
static int getCpuCores()
          Returns the number of Cpu Cores.
static int getCpuCoresPerSocket()
          Returns the number of cpu cores per socket.
static java.lang.String getCpuMhz()
          Returns the cpu mhz.
static java.lang.String getCpuModel()
          Returns the cpu model.
 int getCpuPercentage()
          Returns the current overall Cpu usage.
static java.lang.String getCpuVendor()
          Returns the cpu vendor.
 int getHighestUsage()
          Returns the highest Cpu usage of all cpus.
 java.lang.String getIdleTime()
          Returns the overall Idle time of the cpus.
static CpuInformation getInstance()
          Returns the singleton instance of CpuInformation.
 java.lang.String getIrqTime()
          Returns the overall IRQ time of the cpus.
 java.lang.String getSoftIrqTime()
          Returns the overall Soft IRQ time of the cpus.
 java.lang.String getSysTime()
          Returns the overall Sys time of the cpus.
 java.lang.String getUserTime()
          Returns the overall User time of the cpus.
 java.lang.String getWaitTime()
          Returns the current overall Wait Time of the cpus.
 void update()
          Update the UI
 
Methods inherited from class systeminformationmonitor.system.AbstractSystemUpdater
done, prepare, run
 
Methods inherited from class java.lang.Thread
activeCount, checkAccess, 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
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

addCpuMonitor

public void addCpuMonitor(Monitor monitor)
Adds a monitor to be updated with the cpuInformation is updated.

Parameters:
monitor - Monitor to be updated. The monitor's initialize is called when it is added to the CpuInformation.

getInstance

public static CpuInformation getInstance()
Returns the singleton instance of CpuInformation.

Returns:
Returns CpuInformation.

getCpuAverageUsage

public int getCpuAverageUsage()
Returns he average Cpu usage of all cpus.

Returns:
Average Cpu Usage.

getHighestUsage

public int getHighestUsage()
Returns the highest Cpu usage of all cpus.

Returns:
Highest Cpu Usage.

getCpuPercentage

public int getCpuPercentage()
Returns the current overall Cpu usage.

Returns:
Current Cpu usage.

getWaitTime

public java.lang.String getWaitTime()
Returns the current overall Wait Time of the cpus.

Returns:
Overall Wait Time.

getUserTime

public java.lang.String getUserTime()
Returns the overall User time of the cpus.

Returns:
Overall User Time.

getSysTime

public java.lang.String getSysTime()
Returns the overall Sys time of the cpus.

Returns:
Overall System Time.

getSoftIrqTime

public java.lang.String getSoftIrqTime()
Returns the overall Soft IRQ time of the cpus.

Returns:
Overall Soft IRQ time of the cpus.

getIrqTime

public java.lang.String getIrqTime()
Returns the overall IRQ time of the cpus.

Returns:
Overall IRQ Time.

getIdleTime

public java.lang.String getIdleTime()
Returns the overall Idle time of the cpus.

Returns:
Overall Idle Time.

getCpuModel

public static java.lang.String getCpuModel()
Returns the cpu model.

Returns:
Cpu Model.

getCpuCores

public static int getCpuCores()
Returns the number of Cpu Cores.

Returns:
Cpu Cores.

getCpuCoresPerSocket

public static int getCpuCoresPerSocket()
Returns the number of cpu cores per socket.

Returns:
Cores per socket.

getCpuVendor

public static java.lang.String getCpuVendor()
Returns the cpu vendor.

Returns:
Cpu Vendor.

getCpuCache

public static java.lang.String getCpuCache()
Returns the cpu cache.

Returns:
Cpu Cache.

getCpuMhz

public static java.lang.String getCpuMhz()
Returns the cpu mhz.

Returns:
Cpu Mhz.

update

public void update()
Description copied from class: AbstractSystemUpdater
Update the UI

Specified by:
update in class AbstractSystemUpdater