Package pulse.util
Class ResourceMonitor
- java.lang.Object
- 
- pulse.util.ResourceMonitor
 
- 
 public class ResourceMonitor extends Object Provides unified means of storage and methods of access to runtime system information, such as CPU usage, memory usage, an number of available threads.
- 
- 
Method SummaryAll Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcpuUsage()This will calculate the CPU load for the machine runningPULsE.doublegetCpuUsage()static ResourceMonitorgetInstance()doublegetMemoryUsage()intgetThreadsAvailable()voidmemoryUsage()This will calculate the ratiototalMemory/maxMemoryusing the standardRuntime.voidthreadsAvailable()Finds the number of threads available for calculation.voidupdate()
 
- 
- 
- 
Method Detail- 
updatepublic void update() 
 - 
memoryUsagepublic void memoryUsage() This will calculate the ratio totalMemory/maxMemoryusing the standardRuntime. Note this memory usage depends on heap allocation for the JVM.
 - 
cpuUsagepublic void cpuUsage() This will calculate the CPU load for the machine running PULsE. Note this is rather code-intensive, so it is recommended for use only at certain time intervals.
 - 
threadsAvailablepublic void threadsAvailable() Finds the number of threads available for calculation. This will be used by theTaskManagerwhen allocating theForkJoinPoolfor running several tasks in parallel. The number of threads is greater or equal to the number of cores- See Also:
- TaskManager
 
 - 
getCpuUsagepublic double getCpuUsage() 
 - 
getThreadsAvailablepublic int getThreadsAvailable() 
 - 
getMemoryUsagepublic double getMemoryUsage() 
 - 
getInstancepublic static ResourceMonitor getInstance() 
 
- 
 
-