Package org.jppf.management.diagnostics
Class HealthSnapshot
java.lang.Object
org.jppf.management.diagnostics.HealthSnapshot
- All Implemented Interfaces:
Serializable
This class represents a snapshot of the JVM health.
- Author:
- Laurent Cohen
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleangetBoolean(String name) Get the value of a property as a boolean.doubleDeprecated.doubleGet the value of a property as a double.getDurationString(String name) Get the value of a property as a String.floatGet the value of a property as a float.longDeprecated.usegetLong(MonitoringConstants.HEAP_USAGE_MB)instead.doubleDeprecated.usegetDouble(MonitoringConstants.HEAP_USAGE_RATIO)instead.intGet the value of a property as an int.intDeprecated.usegetInt(MonitoringConstants.LIVE_THREADS_COUNT)instead.longGet the value of a property as a long.longDeprecated.usegetLong(MonitoringConstants.NON_HEAP_USAGE_MB)instead.doubleDeprecated.usegetDouble(MonitoringConstants.NON_HEAP_USAGE_RATIO)instead.Get all the key / value pairs representing monitoring data in this snapshot.longDeprecated.usegetLong(MonitoringConstants.RAM_USAGE_MB)instead.doubleDeprecated.usegetDouble(MonitoringConstants.RAM_USAGE_RATIO)instead.Get the value of a property as a String.doubleDeprecated.usegetDouble(MonitoringConstants.SYSTEM_CPU_LOAD)instead.booleanDeprecated.usegetBoolean(MonitoringConstants.DEADLOCKED)instead.toString()
-
Constructor Details
-
HealthSnapshot
public HealthSnapshot()Initialize this snapshot with default values.
-
-
Method Details
-
getProperties
Get all the key / value pairs representing monitoring data in this snapshot.- Returns:
- an association of propery names to their computed value.
-
getInt
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
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
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
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
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
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
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.usegetDouble(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.usegetDouble(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.usegetBoolean(MonitoringConstants.DEADLOCKED)instead.Determine whether a deadlock was detected.- Returns:
trueif a deadlock was dertected,falseotherwise.
-
getHeapUsed
public long getHeapUsed()Deprecated.usegetLong(MonitoringConstants.HEAP_USAGE_MB)instead.Get the used heap memory in bytes.- Returns:
- the heap used as a long.
-
getNonheapUsed
public long getNonheapUsed()Deprecated.usegetLong(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.usegetInt(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.usegetDouble(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-1dif it is unknown.
-
getSystemCpuLoad
public double getSystemCpuLoad()Deprecated.usegetDouble(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-1dif it is unknown.
-
getRamUsedRatio
public double getRamUsedRatio()Deprecated.usegetDouble(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-1dif it is unknown.
-
getRamUsed
public long getRamUsed()Deprecated.usegetLong(MonitoringConstants.RAM_USAGE_MB)instead.Get the amount of used physical memory in bytes.- Returns:
- the amount of used RAM in bytes, or
-1Lif it is unknown.
-
toString
-
getDouble(MonitoringConstants.PROCESS_CPU_LOAD)instead.