Class SystemResourcesUtil
java.lang.Object
org.palladiosimulator.protocom.resourcestrategies.system.SystemResourcesUtil
Helper class for monitoring system resources.
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic int
Returns the number of CPU cores.static org.jscience.physics.amount.Amount<javax.measure.quantity.Duration>
Returns the CPU time used by this JVMstatic double
Returns the CPU time used by this JVMstatic long
Returns the free physical memory in bytes.static long
Returns the free space of the temp directorystatic long
Returns the total size of the physical memory in bytes.
-
Field Details
-
TEMP_DIR
This systems' temp directory. Due to inconsistencies between different systems a file separator is added.
-
-
Constructor Details
-
SystemResourcesUtil
public SystemResourcesUtil()
-
-
Method Details
-
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
-