Class HealthSnapshot

java.lang.Object
org.jppf.management.diagnostics.HealthSnapshot
All Implemented Interfaces:
Serializable

public class HealthSnapshot extends Object implements Serializable
This class represents a snapshot of the JVM health.
Author:
Laurent Cohen
See Also:
  • Constructor Summary

    Constructors
    Constructor
    Description
    Initialize this snapshot with default values.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    Get the value of a property as a boolean.
    double
    Deprecated.
    use getDouble(MonitoringConstants.PROCESS_CPU_LOAD) instead.
    double
    Get the value of a property as a double.
    Get the value of a property as a String.
    float
    Get the value of a property as a float.
    long
    Deprecated.
    use getLong(MonitoringConstants.HEAP_USAGE_MB) instead.
    double
    Deprecated.
    use getDouble(MonitoringConstants.HEAP_USAGE_RATIO) instead.
    int
    getInt(String name)
    Get the value of a property as an int.
    int
    Deprecated.
    use getInt(MonitoringConstants.LIVE_THREADS_COUNT) instead.
    long
    Get the value of a property as a long.
    long
    Deprecated.
    use getLong(MonitoringConstants.NON_HEAP_USAGE_MB) instead.
    double
    Deprecated.
    use getDouble(MonitoringConstants.NON_HEAP_USAGE_RATIO) instead.
    Get all the key / value pairs representing monitoring data in this snapshot.
    long
    Deprecated.
    use getLong(MonitoringConstants.RAM_USAGE_MB) instead.
    double
    Deprecated.
    use getDouble(MonitoringConstants.RAM_USAGE_RATIO) instead.
    Get the value of a property as a String.
    double
    Deprecated.
    use getDouble(MonitoringConstants.SYSTEM_CPU_LOAD) instead.
    boolean
    Deprecated.
    use getBoolean(MonitoringConstants.DEADLOCKED) instead.
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • HealthSnapshot

      public HealthSnapshot()
      Initialize this snapshot with default values.
  • Method Details

    • getProperties

      public TypedProperties getProperties()
      Get all the key / value pairs representing monitoring data in this snapshot.
      Returns:
      an association of propery names to their computed value.
    • getInt

      public int getInt(String name)
      Get the value of a property as an int.
      Parameters:
      name - the name of the property to lookup.
      Returns:
      the value of the property.
    • getLong

      public long getLong(String name)
      Get the value of a property as a long.
      Parameters:
      name - the name of the property to lookup.
      Returns:
      the value of the property.
    • getFloat

      public float getFloat(String name)
      Get the value of a property as a float.
      Parameters:
      name - the name of the property to lookup.
      Returns:
      the value of the property.
    • getDouble

      public double getDouble(String name)
      Get the value of a property as a double.
      Parameters:
      name - the name of the property to lookup.
      Returns:
      the value of the property.
    • getBoolean

      public boolean getBoolean(String name)
      Get the value of a property as a boolean.
      Parameters:
      name - the name of the property to lookup.
      Returns:
      the value of the property.
    • getString

      public String getString(String name)
      Get the value of a property as a String.
      Parameters:
      name - the name of the property to lookup.
      Returns:
      the value of the property.
    • getDurationString

      public String getDurationString(String name)
      Get the value of a property as a String.
      Parameters:
      name - the name of the property to lookup.
      Returns:
      the value of the property.
    • getHeapUsedRatio

      public double getHeapUsedRatio()
      Deprecated.
      use getDouble(MonitoringConstants.HEAP_USAGE_RATIO) instead.
      Get the ratio of used / max for heap memory.
      Returns:
      the ratio as a double value in the range [0, 1].
    • getNonheapUsedRatio

      public double getNonheapUsedRatio()
      Deprecated.
      use getDouble(MonitoringConstants.NON_HEAP_USAGE_RATIO) instead.
      Get the ratio of used / max for non-heap memory.
      Returns:
      the ratio as a double value in the range [0, 1].
    • isDeadlocked

      public boolean isDeadlocked()
      Deprecated.
      use getBoolean(MonitoringConstants.DEADLOCKED) instead.
      Determine whether a deadlock was detected.
      Returns:
      true if a deadlock was dertected, false otherwise.
    • getHeapUsed

      public long getHeapUsed()
      Deprecated.
      use getLong(MonitoringConstants.HEAP_USAGE_MB) instead.
      Get the used heap memory in bytes.
      Returns:
      the heap used as a long.
    • getNonheapUsed

      public long getNonheapUsed()
      Deprecated.
      use getLong(MonitoringConstants.NON_HEAP_USAGE_MB) instead.
      Get the used non-heap memory in bytes.
      Returns:
      the non-heap used as a long.
    • getLiveThreads

      public int getLiveThreads()
      Deprecated.
      use getInt(MonitoringConstants.LIVE_THREADS_COUNT) instead.
      Get the number of live threads in the JVM.
      Returns:
      the number of threads as an int.
    • getCpuLoad

      public double getCpuLoad()
      Deprecated.
      use getDouble(MonitoringConstants.PROCESS_CPU_LOAD) instead.
      Get the cpu load of the current process.
      Returns:
      the cpu load as a double in the range [0 ... 1], or -1d if it is unknown.
    • getSystemCpuLoad

      public double getSystemCpuLoad()
      Deprecated.
      use getDouble(MonitoringConstants.SYSTEM_CPU_LOAD) instead.
      Get the cpu load of the system.
      Returns:
      the cpu load as a double in the range [0 ... 1], or -1d if it is unknown.
    • getRamUsedRatio

      public double getRamUsedRatio()
      Deprecated.
      use getDouble(MonitoringConstants.RAM_USAGE_RATIO) instead.
      Get the ratio of used / max for physical memory.
      Returns:
      the percentage of used RAM in the range [0 ... 1], or -1d if it is unknown.
    • getRamUsed

      public long getRamUsed()
      Deprecated.
      use getLong(MonitoringConstants.RAM_USAGE_MB) instead.
      Get the amount of used physical memory in bytes.
      Returns:
      the amount of used RAM in bytes, or -1L if it is unknown.
    • toString

      public String toString()
      Overrides:
      toString in class Object