Module aeonics.core
Package aeonics.util

Class Hardware.CPU

  • Enclosing class:
    Hardware

    public static class Hardware.CPU
    extends java.lang.Object
    CPU
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static int cores()
      Returns the number of processors available to the Java virtual machine.
      static Data export()
      Returns a data representation of this class at this point in time
      static int limit()
      Returns the desired soft limit on the number of usable cores.
      static double load()
      Returns the "recent cpu usage" for the Java Virtual Machine process.
      static long pid()
      Returns the native process ID of the Java virtual machine process.
      static double system()
      Returns the "recent cpu usage" for the whole system.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • load

        public static double load()
        Returns the "recent cpu usage" for the Java Virtual Machine process. This value is a double in the [0.0,1.0] interval.
        Returns:
        the "recent cpu usage" for the Java Virtual Machine process
      • system

        public static double system()
        Returns the "recent cpu usage" for the whole system. This value is adouble in the [0.0,1.0] interval.
        Returns:
        the "recent cpu usage" for the whole system
      • cores

        public static int cores()
        Returns the number of processors available to the Java virtual machine.
        Returns:
        the number of processors available to the Java virtual machine
      • limit

        public static int limit()
        Returns the desired soft limit on the number of usable cores. This value cannot be changed after it has been accessed for the first time.

        The core limit is defined to refrain the system from using all available cores using the AEONICS_HARDWARE_CPU_LIMIT startup parameter, environment variable or Config property depending on which is set. If the value is not set, the Runtime.availableProcessors() value is used.

        This limit is provided as a user-defined hint on the desired cpu limit which is usually proportional to the number of worker threads in the system. There is no guarantees that this value is honored -strictly or not- by the system.

        The limit may be set to a higher value than that of the available cores(), allowing for overprovisioning of resources in case the processing intensity per thread is low (probably due to i/o).

        Returns:
        the target limit of usable cores
      • pid

        public static long pid()
        Returns the native process ID of the Java virtual machine process.
        Returns:
        the native process ID of the Java virtual machine process
      • export

        public static Data export()
        Returns a data representation of this class at this point in time
        Returns:
        a data representation of this class at this point in time