Class SystemResourcesUtil
- java.lang.Object
-
- org.palladiosimulator.protocom.resourcestrategies.system.SystemResourcesUtil
-
public final class SystemResourcesUtil extends Object
Helper class for monitoring system resources.
-
-
Constructor Summary
Constructors Constructor Description SystemResourcesUtil()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static int
getCPUCores()
Returns the number of CPU cores.static org.jscience.physics.amount.Amount<javax.measure.quantity.Duration>
getCPUProcessTime()
Returns the CPU time used by this JVMstatic double
getCPUProcessTimeNS()
Returns the CPU time used by this JVMstatic long
getFreePhysicalMemorySize()
Returns the free physical memory in bytes.static long
getFreeTempDirectorySize()
Returns the free space of the temp directorystatic long
getTotalPhysicalMemorySize()
Returns the total size of the physical memory in bytes.
-
-
-
Field Detail
-
TEMP_DIR
public static final File TEMP_DIR
This systems' temp directory. Due to inconsistencies between different systems a file separator is added.
-
-
Method Detail
-
getTotalPhysicalMemorySize
public static long getTotalPhysicalMemorySize()
Returns the total size of the physical memory in bytes.- Returns:
- total memory in bytes
-
getFreePhysicalMemorySize
public static long getFreePhysicalMemorySize()
Returns the free physical memory in bytes.- Returns:
- free memory in bytes
-
getFreeTempDirectorySize
public static long getFreeTempDirectorySize()
Returns the free space of the temp directory- Returns:
- free space in bytes
-
getCPUCores
public static int getCPUCores()
Returns the number of CPU cores.- Returns:
- CPU cores
-
getCPUProcessTimeNS
public static double getCPUProcessTimeNS()
Returns the CPU time used by this JVM- Returns:
- CPU usage in nanoseconds
-
getCPUProcessTime
public static org.jscience.physics.amount.Amount<javax.measure.quantity.Duration> getCPUProcessTime()
Returns the CPU time used by this JVM- Returns:
- CPU usage as a JScience object
-
-