java.lang.Object
org.palladiosimulator.protocom.resourcestrategies.system.SystemResourcesUtil

public final class SystemResourcesUtil extends Object
Helper class for monitoring system resources.
  • Field Details

    • TEMP_DIR

      public static final File 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