GridGain™ 2.0.3
Java API Specification

org.gridgain.grid.spi.discovery
Class GridDiscoveryMetricsAdapter

java.lang.Object
  extended by org.gridgain.grid.spi.discovery.GridDiscoveryMetricsAdapter
All Implemented Interfaces:
Externalizable, Serializable, GridNodeMetrics

public class GridDiscoveryMetricsAdapter
extends Object
implements GridNodeMetrics, Externalizable

Adapter for GridLocalMetrics interface.



See Also:

  Documentation
  Email Support
  Online Forums
  Issue Tracking

Author:   2005-2008 Copyright © GridGain Systems. All Rights Reserved. ver. 2.0.3

See Also:
Serialized Form
 

Constructor Summary
GridDiscoveryMetricsAdapter()
           
 
Method Summary
 boolean equals(Object obj)
          
 int getAvailableProcessors()
          Returns the number of processors available to the Java virtual machine.
 float getAverageActiveJobs()
          Gets average number of active jobs concurrently executing on the node.
 float getAverageCancelledJobs()
          Gets average number of cancelled jobs this node ever had running concurrently.
 double getAverageCpuLoad()
          Gets average of CPU load values over all metrics kept in the history.
 double getAverageJobExecuteTime()
          Gets average time a job takes to execute on the node.
 double getAverageJobWaitTime()
          Gets average time jobs spend waiting in the queue to be executed.
 float getAverageRejectedJobs()
          Gets average number of jobs this node rejects during collision resolution operations.
 float getAverageWaitingJobs()
          Gets average number of waiting jobs this node had queued.
 float getBusyTimePercentage()
          Gets percentage of time this node is busy executing jobs vs. idling.
 int getCurrentActiveJobs()
          Gets number of currently active jobs concurrently executing on the node.
 int getCurrentCancelledJobs()
          Gets number of cancelled jobs that are still running.
 double getCurrentCpuLoad()
          Returns the system load average for the last minute.
 int getCurrentDaemonThreadCount()
          Returns the current number of live daemon threads.
 long getCurrentIdleTime()
          Gets time this node spend idling since executing last job.
 long getCurrentJobExecuteTime()
          Gets longest time a current job has been executing for.
 long getCurrentJobWaitTime()
          Gets current time an oldest jobs has spent waiting to be executed.
 int getCurrentRejectedJobs()
          Gets number of jobs rejected after more recent collision resolution operation.
 int getCurrentThreadCount()
          Returns the current number of live threads including both daemon and non-daemon threads.
 int getCurrentWaitingJobs()
          Gets number of queued jobs currently waiting to be executed.
 long getHeapMemoryCommitted()
          Returns the amount of heap memory in bytes that is committed for the Java virtual machine to use.
 long getHeapMemoryInitialized()
          Returns the amount of heap memory in bytes that the Java virtual machine initially requests from the operating system for memory management.
 long getHeapMemoryMaximum()
          Returns the maximum amount of heap memory in bytes that can be used for memory management.
 long getHeapMemoryUsed()
          Returns the current heap size that is used for object allocation.
 float getIdleTimePercentage()
          Gets percentage of time this node is idling vs. executing jobs.
 long getLastUpdateTime()
          Gets last update time of this node metrics.
 int getMaximumActiveJobs()
          Gets maximum number of jobs that ever ran concurrently on this node.
 int getMaximumCancelledJobs()
          Gets maximum number of cancelled jobs this node ever had running concurrently.
 long getMaximumJobExecuteTime()
          Gets time it took to execute the longest job on the node.
 long getMaximumJobWaitTime()
          Gets maximum time a job ever spent waiting in a queue to be executed.
 int getMaximumRejectedJobs()
          Gets maximum number of jobs rejected at once during a single collision resolution operation.
 int getMaximumThreadCount()
          Returns the maximum live thread count since the Java virtual machine started or peak was reset.
 int getMaximumWaitingJobs()
          Gets maximum number of waiting jobs this node had.
 long getNonHeapMemoryCommitted()
          Returns the amount of non-heap memory in bytes that is committed for the Java virtual machine to use.
 long getNonHeapMemoryInitialized()
          Returns the amount of non-heap memory in bytes that the Java virtual machine initially requests from the operating system for memory management.
 long getNonHeapMemoryMaximum()
          Returns the maximum amount of non-heap memory in bytes that can be used for memory management.
 long getNonHeapMemoryUsed()
          Returns the current non-heap memory size that is used by Java VM.
 long getStartTime()
          Returns the start time of the Java virtual machine in milliseconds.
 long getTotalBusyTime()
          Gets total time this node spent executing jobs.
 int getTotalCancelledJobs()
          Gets total number of cancelled jobs.
 int getTotalExecutedJobs()
          Gets total number of jobs handled by the node.
 long getTotalIdleTime()
          Gets total time this node spent idling (not executing any jobs).
 int getTotalRejectedJobs()
          Gets total number of jobs this node rejects during collision resolution operations.
 long getTotalStartedThreadCount()
          Returns the total number of threads created and also started since the Java virtual machine started.
 long getUptime()
          Returns the uptime of the Java virtual machine in milliseconds.
 int hashCode()
          
 void readExternal(ObjectInput in)
          
 void setAvailableProcessors(int availProcs)
          Sets available processors.
 void setAverageActiveJobs(float avgActiveJobs)
          Sets average active jobs.
 void setAverageCancelledJobs(float avgCancelledJobs)
          Sets average cancelled jobs.
 void setAverageCpuLoad(double avgLoad)
          Sets CPU load average over the metrics history.
 void setAverageJobExecuteTime(double avgJobExecTime)
          Sets average job execution time.
 void setAverageJobWaitTime(double avgJobWaitTime)
          Sets average job wait time.
 void setAverageRejectedJobs(float avgRejectedJobs)
           
 void setAverageWaitingJobs(float avgWaitingJobs)
          Sets average waiting jobs.
 void setCurrentActiveJobs(int curActiveJobs)
          Sets current active jobs.
 void setCurrentCancelledJobs(int curCancelledJobs)
          Sets current cancelled jobs.
 void setCurrentCpuLoad(double load)
          Sets current CPU load.
 void setCurrentIdleTime(long curIdleTime)
          Sets time elapsed since execution of last job.
 void setCurrentJobExecuteTime(long curJobExecTime)
          Sets current job execute tiem.
 void setCurrentJobWaitTime(long curJobWaitTime)
          Sets current job wait time.
 void setCurrentRejectedJobs(int curRejectedJobs)
           
 void setCurrentWaitingJobs(int curWaitingJobs)
          Sets current waiting jobs.
 void setDaemonThreadCount(int daemonThreadCnt)
          Sets daemon thread count.
 void setHeapMemoryCommitted(long heapCommitted)
          Sets committed heap memory.
 void setHeapMemoryInitialized(long heapInit)
          Sets heap initial memory.
 void setHeapMemoryMaximum(long heapMax)
          Sets maximum possible heap memory.
 void setHeapMemoryUsed(long heapUsed)
          Sets used heap memory.
 void setLastUpdateTime(long lastUpdateTime)
          Sets last update time.
 void setMaximumActiveJobs(int maxActiveJobs)
          Sets max active jobs.
 void setMaximumCancelledJobs(int maxCancelledJobs)
          Sets maximum cancelled jobs.
 void setMaximumJobExecuteTime(long maxJobExecTime)
          Sets maximum job execution time.
 void setMaximumJobWaitTime(long maxJobWaitTime)
          Sets max job wait time.
 void setMaximumRejectedJobs(int maxRejectedJobs)
           
 void setMaximumWaitingJobs(int maxWaitingJobs)
          Sets maximum waiting jobs.
 void setNonHeapMemoryCommitted(long nonHeapCommitted)
          Sets committed non-heap memory.
 void setNonHeapMemoryInitialized(long nonHeapInit)
          Sets initial non-heap memory.
 void setNonHeapMemoryMaximum(long nonHeapMax)
          Sets maximum possible non-heap memory.
 void setNonHeapMemoryUsed(long nonHeapUsed)
          Sets used non-heap memory.
 void setPeakThreadCount(int peakThreadCnt)
          Sets peak thread count.
 void setStartTime(long startTime)
          Sets VM start time.
 void setThreadCount(int threadCnt)
          Sets thread count.
 void setTotalCancelledJobs(int totalCancelledJobs)
          Sets total cancelled jobs.
 void setTotalExecutedJobs(int totalExecutedJobs)
          Sets total active jobs.
 void setTotalIdleTime(long totalIdleTime)
          Set total node idle time.
 void setTotalRejectedJobs(int totalRejectedJobs)
           
 void setTotalStartedThreadCount(long startedThreadCnt)
          Sets started thread count.
 void setUpTime(long upTime)
          Sets VM up time.
 String toString()
          
 void writeExternal(ObjectOutput out)
          
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

GridDiscoveryMetricsAdapter

public GridDiscoveryMetricsAdapter()
Method Detail

getLastUpdateTime

public long getLastUpdateTime()
Gets last update time of this node metrics.

Specified by:
getLastUpdateTime in interface GridNodeMetrics
Returns:
Last update time.

setLastUpdateTime

public void setLastUpdateTime(long lastUpdateTime)
Sets last update time.

Parameters:
lastUpdateTime - Last update time.

getMaximumActiveJobs

public int getMaximumActiveJobs()
Gets maximum number of jobs that ever ran concurrently on this node. Note that this different from GridNodeMetrics.getTotalExecutedJobs() metric and only reflects maximum number of jobs that ran at the same time.

Note: all aggregated metrics like average, minimum, maximum, total, count are calculated over all the metrics kept in history. The history size is set via either one or both of configuration settings:

Specified by:
getMaximumActiveJobs in interface GridNodeMetrics
Returns:
Maximum number of jobs that ever ran concurrently on this node.

setMaximumActiveJobs

public void setMaximumActiveJobs(int maxActiveJobs)
Sets max active jobs.

Parameters:
maxActiveJobs - Max active jobs.

getCurrentActiveJobs

public int getCurrentActiveJobs()
Gets number of currently active jobs concurrently executing on the node.

Specified by:
getCurrentActiveJobs in interface GridNodeMetrics
Returns:
Number of currently active jobs concurrently executing on the node.

setCurrentActiveJobs

public void setCurrentActiveJobs(int curActiveJobs)
Sets current active jobs.

Parameters:
curActiveJobs - Current active jobs.

getAverageActiveJobs

public float getAverageActiveJobs()
Gets average number of active jobs concurrently executing on the node.

Note: all aggregated metrics like average, minimum, maximum, total, count are calculated over all the metrics kept in history. The history size is set via either one or both of configuration settings:

Specified by:
getAverageActiveJobs in interface GridNodeMetrics
Returns:
Average number of active jobs.

setAverageActiveJobs

public void setAverageActiveJobs(float avgActiveJobs)
Sets average active jobs.

Parameters:
avgActiveJobs - Average active jobs.

getMaximumWaitingJobs

public int getMaximumWaitingJobs()
Gets maximum number of waiting jobs this node had.

Note: all aggregated metrics like average, minimum, maximum, total, count are calculated over all the metrics kept in history. The history size is set via either one or both of configuration settings:

Specified by:
getMaximumWaitingJobs in interface GridNodeMetrics
Returns:
Maximum number of waiting jobs.

setMaximumWaitingJobs

public void setMaximumWaitingJobs(int maxWaitingJobs)
Sets maximum waiting jobs.

Parameters:
maxWaitingJobs - Maximum waiting jobs.

getCurrentWaitingJobs

public int getCurrentWaitingJobs()
Gets number of queued jobs currently waiting to be executed.

Specified by:
getCurrentWaitingJobs in interface GridNodeMetrics
Returns:
Number of queued jobs currently waiting to be executed.

setCurrentWaitingJobs

public void setCurrentWaitingJobs(int curWaitingJobs)
Sets current waiting jobs.

Parameters:
curWaitingJobs - Current waiting jobs.

getAverageWaitingJobs

public float getAverageWaitingJobs()
Gets average number of waiting jobs this node had queued.

Note: all aggregated metrics like average, minimum, maximum, total, count are calculated over all the metrics kept in history. The history size is set via either one or both of configuration settings:

Specified by:
getAverageWaitingJobs in interface GridNodeMetrics
Returns:
Average number of waiting jobs.

setAverageWaitingJobs

public void setAverageWaitingJobs(float avgWaitingJobs)
Sets average waiting jobs.

Parameters:
avgWaitingJobs - Average waiting jobs.

getMaximumRejectedJobs

public int getMaximumRejectedJobs()
Gets maximum number of jobs rejected at once during a single collision resolution operation.

Note: all aggregated metrics like average, minimum, maximum, total, count are calculated over all the metrics kept in history. The history size is set via either one or both of configuration settings:

Specified by:
getMaximumRejectedJobs in interface GridNodeMetrics
Returns:
Maximum number of jobs rejected at once.

setMaximumRejectedJobs

public void setMaximumRejectedJobs(int maxRejectedJobs)
Parameters:
maxRejectedJobs - Maximum number of jobs rejected during a single collision resolution event.

getCurrentRejectedJobs

public int getCurrentRejectedJobs()
Gets number of jobs rejected after more recent collision resolution operation.

Specified by:
getCurrentRejectedJobs in interface GridNodeMetrics
Returns:
Number of jobs rejected after more recent collision resolution operation.

setCurrentRejectedJobs

public void setCurrentRejectedJobs(int curRejectedJobs)
Parameters:
curRejectedJobs - Number of jobs rejected during most recent collision resolution.

getAverageRejectedJobs

public float getAverageRejectedJobs()
Gets average number of jobs this node rejects during collision resolution operations.

Note: all aggregated metrics like average, minimum, maximum, total, count are calculated over all the metrics kept in history. The history size is set via either one or both of grid configuration settings:

Specified by:
getAverageRejectedJobs in interface GridNodeMetrics
Returns:
Average number of jobs this node rejects during collision resolution operations.

setAverageRejectedJobs

public void setAverageRejectedJobs(float avgRejectedJobs)
Parameters:
avgRejectedJobs - Average number of jobs this node rejects.

getTotalRejectedJobs

public int getTotalRejectedJobs()
Gets total number of jobs this node rejects during collision resolution operations.

Note: all aggregated metrics like average, minimum, maximum, total, count are calculated over all the metrics kept in history. The history size is set via either one or both of configuration settings:

Specified by:
getTotalRejectedJobs in interface GridNodeMetrics
Returns:
Total number of jobs this node rejects during collision resolution operations.

setTotalRejectedJobs

public void setTotalRejectedJobs(int totalRejectedJobs)
Parameters:
totalRejectedJobs - Total number of jobs this node ever rejected.

getMaximumCancelledJobs

public int getMaximumCancelledJobs()
Gets maximum number of cancelled jobs this node ever had running concurrently.

Specified by:
getMaximumCancelledJobs in interface GridNodeMetrics
Returns:
Maximum number of cancelled jobs.

setMaximumCancelledJobs

public void setMaximumCancelledJobs(int maxCancelledJobs)
Sets maximum cancelled jobs.

Parameters:
maxCancelledJobs - Maximum cancelled jobs.

getCurrentCancelledJobs

public int getCurrentCancelledJobs()
Gets number of cancelled jobs that are still running. Just like regular java threads, jobs will receive cancel notification, but it's ultimately upto the job itself to gracefully exit.

Specified by:
getCurrentCancelledJobs in interface GridNodeMetrics
Returns:
Number of cancelled jobs that are still running.

setCurrentCancelledJobs

public void setCurrentCancelledJobs(int curCancelledJobs)
Sets current cancelled jobs.

Parameters:
curCancelledJobs - Current cancelled jobs.

getAverageCancelledJobs

public float getAverageCancelledJobs()
Gets average number of cancelled jobs this node ever had running concurrently.

Note: all aggregated metrics like average, minimum, maximum, total, count are calculated over all the metrics kept in history. The history size is set via either one or both of configuration settings:

Specified by:
getAverageCancelledJobs in interface GridNodeMetrics
Returns:
Average number of cancelled jobs.

setAverageCancelledJobs

public void setAverageCancelledJobs(float avgCancelledJobs)
Sets average cancelled jobs.

Parameters:
avgCancelledJobs - Average cancelled jobs.

getTotalExecutedJobs

public int getTotalExecutedJobs()
Gets total number of jobs handled by the node.

Note: all aggregated metrics like average, minimum, maximum, total, count are calculated over all the metrics kept in history. The history size is set via either one or both of configuration settings:

Specified by:
getTotalExecutedJobs in interface GridNodeMetrics
Returns:
Total number of jobs handled by the node.

setTotalExecutedJobs

public void setTotalExecutedJobs(int totalExecutedJobs)
Sets total active jobs.

Parameters:
totalExecutedJobs - Total active jobs.

getTotalCancelledJobs

public int getTotalCancelledJobs()
Gets total number of cancelled jobs.

Note: all aggregated metrics like average, minimum, maximum, total, count are calculated over all the metrics kept in history. The history size is set via either one or both of configuration settings:

Specified by:
getTotalCancelledJobs in interface GridNodeMetrics
Returns:
Total number of cancelled jobs since node startup.

setTotalCancelledJobs

public void setTotalCancelledJobs(int totalCancelledJobs)
Sets total cancelled jobs.

Parameters:
totalCancelledJobs - Total cancelled jobs.

getMaximumJobWaitTime

public long getMaximumJobWaitTime()
Gets maximum time a job ever spent waiting in a queue to be executed.

Note: all aggregated metrics like average, minimum, maximum, total, count are calculated over all the metrics kept in history. The history size is set via either one or both of configuration settings:

Specified by:
getMaximumJobWaitTime in interface GridNodeMetrics
Returns:
Maximum waiting time.

setMaximumJobWaitTime

public void setMaximumJobWaitTime(long maxJobWaitTime)
Sets max job wait time.

Parameters:
maxJobWaitTime - Max job wait time.

getCurrentJobWaitTime

public long getCurrentJobWaitTime()
Gets current time an oldest jobs has spent waiting to be executed.

Specified by:
getCurrentJobWaitTime in interface GridNodeMetrics
Returns:
Current wait time of oldest job.

setCurrentJobWaitTime

public void setCurrentJobWaitTime(long curJobWaitTime)
Sets current job wait time.

Parameters:
curJobWaitTime - Current job wait time.

getAverageJobWaitTime

public double getAverageJobWaitTime()
Gets average time jobs spend waiting in the queue to be executed.

Note: all aggregated metrics like average, minimum, maximum, total, count are calculated over all the metrics kept in history. The history size is set via either one or both of configuration settings:

Specified by:
getAverageJobWaitTime in interface GridNodeMetrics
Returns:
Average job wait time.

setAverageJobWaitTime

public void setAverageJobWaitTime(double avgJobWaitTime)
Sets average job wait time.

Parameters:
avgJobWaitTime - Average job wait time.

getMaximumJobExecuteTime

public long getMaximumJobExecuteTime()
Gets time it took to execute the longest job on the node.

Note: all aggregated metrics like average, minimum, maximum, total, count are calculated over all the metrics kept in history. The history size is set via either one or both of configuration settings:

Specified by:
getMaximumJobExecuteTime in interface GridNodeMetrics
Returns:
Time it took to execute the longest job on the node.

setMaximumJobExecuteTime

public void setMaximumJobExecuteTime(long maxJobExecTime)
Sets maximum job execution time.

Parameters:
maxJobExecTime - Maximum job execution time.

getCurrentJobExecuteTime

public long getCurrentJobExecuteTime()
Gets longest time a current job has been executing for.

Specified by:
getCurrentJobExecuteTime in interface GridNodeMetrics
Returns:
Longest time a current job has been executing for.

setCurrentJobExecuteTime

public void setCurrentJobExecuteTime(long curJobExecTime)
Sets current job execute tiem.

Parameters:
curJobExecTime - Current job execute time.

getAverageJobExecuteTime

public double getAverageJobExecuteTime()
Gets average time a job takes to execute on the node.

Note: all aggregated metrics like average, minimum, maximum, total, count are calculated over all the metrics kept in history. The history size is set via either one or both of configuration settings:

Specified by:
getAverageJobExecuteTime in interface GridNodeMetrics
Returns:
Average job execution time.

setAverageJobExecuteTime

public void setAverageJobExecuteTime(double avgJobExecTime)
Sets average job execution time.

Parameters:
avgJobExecTime - Average job execution time.

getTotalBusyTime

public long getTotalBusyTime()
Gets total time this node spent executing jobs.

Specified by:
getTotalBusyTime in interface GridNodeMetrics
Returns:
Total time this node spent executing jobs.

getTotalIdleTime

public long getTotalIdleTime()
Gets total time this node spent idling (not executing any jobs).

Specified by:
getTotalIdleTime in interface GridNodeMetrics
Returns:
Gets total time this node spent idling.

setTotalIdleTime

public void setTotalIdleTime(long totalIdleTime)
Set total node idle time.

Parameters:
totalIdleTime - Total node idle time.

getCurrentIdleTime

public long getCurrentIdleTime()
Gets time this node spend idling since executing last job.

Specified by:
getCurrentIdleTime in interface GridNodeMetrics
Returns:
Time this node spend idling since executing last job.

setCurrentIdleTime

public void setCurrentIdleTime(long curIdleTime)
Sets time elapsed since execution of last job.

Parameters:
curIdleTime - Time elapsed since execution of last job.

getBusyTimePercentage

public float getBusyTimePercentage()
Gets percentage of time this node is busy executing jobs vs. idling.

Specified by:
getBusyTimePercentage in interface GridNodeMetrics
Returns:
Percentage of time this node is busy (value is less than or equal to 1 and greater than or equal to 0)

getIdleTimePercentage

public float getIdleTimePercentage()
Gets percentage of time this node is idling vs. executing jobs.

Specified by:
getIdleTimePercentage in interface GridNodeMetrics
Returns:
Percentage of time this node is idle (value is less than or equal to 1 and greater than or equal to 0)

getAvailableProcessors

public int getAvailableProcessors()
Returns the number of processors available to the Java virtual machine. This method is equivalent to the Runtime.availableProcessors() method.

This value may change during a particular invocation of the virtual machine.

Specified by:
getAvailableProcessors in interface GridNodeMetrics
Returns:
The number of processors available to the virtual machine; never smaller than one.

getCurrentCpuLoad

public double getCurrentCpuLoad()
Returns the system load average for the last minute. The system load average is the sum of the number of runnable entities queued to the available processors and the number of runnable entities running on the available processors averaged over a period of time. The way in which the load average is calculated is operating system specific but is typically a damped time-dependent average.

If the load average is not available, a negative value is returned.

This method is designed to provide a hint about the system load and may be queried frequently. The load average may be unavailable on some platform where it is expensive to implement this method.

If you are running JDK 1.6 or above, then this method is equivalent to OperatingSystemMXBean.getSystemLoadAverage() method. Otherwise, for JDK 1.5 Hyperic CIGAR monitoring will be used. Note, however, that JDK 1.6 does not provide load average on some operating system (including Windows Vista) and in many cases provides wrong values. In such cases Hyperic Sigar should be used (which is default configuration) to provide proper system load average value.

Note that Hyperic CIGAR is licensed under GPL. If this license is not suitable for your business, remove hyperic libs from your classpath. In case if this method will not detect JDK 1.6 and will not find CIGAR libraries in the classpath, -1 will be returned.

Specified by:
getCurrentCpuLoad in interface GridNodeMetrics
Returns:
The system load average; or a negative value if not available.

getAverageCpuLoad

public double getAverageCpuLoad()
Gets average of CPU load values over all metrics kept in the history.

Note: all aggregated metrics like average, minimum, maximum, total, count are calculated over all the metrics kept in history. The history size is set via either one or both of configuration settings:

Specified by:
getAverageCpuLoad in interface GridNodeMetrics
Returns:
Average of CPU load values over all metrics kept in the history.

getHeapMemoryInitialized

public long getHeapMemoryInitialized()
Returns the amount of heap memory in bytes that the Java virtual machine initially requests from the operating system for memory management. This method returns -1 if the initial memory size is undefined.

This value represents a setting of the heap memory for Java VM and is not a sum of all initial heap values for all memory pools.

Note: this is not an aggregated metric and it's calculated from the time of the node's startup.

Specified by:
getHeapMemoryInitialized in interface GridNodeMetrics
Returns:
The initial size of memory in bytes; -1 if undefined.

getHeapMemoryUsed

public long getHeapMemoryUsed()
Returns the current heap size that is used for object allocation. The heap consists of one or more memory pools. This value is the sum of used heap memory values of all heap memory pools.

The amount of used memory in the returned is the amount of memory occupied by both live objects and garbage objects that have not been collected, if any.

Note: this is not an aggregated metric and it's calculated from the time of the node's startup.

Specified by:
getHeapMemoryUsed in interface GridNodeMetrics
Returns:
Amount of heap memory used.

getHeapMemoryCommitted

public long getHeapMemoryCommitted()
Returns the amount of heap memory in bytes that is committed for the Java virtual machine to use. This amount of memory is guaranteed for the Java virtual machine to use. The heap consists of one or more memory pools. This value is the sum of committed heap memory values of all heap memory pools.

Note: this is not an aggregated metric and it's calculated from the time of the node's startup.

Specified by:
getHeapMemoryCommitted in interface GridNodeMetrics
Returns:
The amount of committed memory in bytes.

getHeapMemoryMaximum

public long getHeapMemoryMaximum()
Returns the maximum amount of heap memory in bytes that can be used for memory management. This method returns -1 if the maximum memory size is undefined.

This amount of memory is not guaranteed to be available for memory management if it is greater than the amount of committed memory. The Java virtual machine may fail to allocate memory even if the amount of used memory does not exceed this maximum size.

This value represents a setting of the heap memory for Java VM and is not a sum of all initial heap values for all memory pools.

Note: this is not an aggregated metric and it's calculated from the time of the node's startup.

Specified by:
getHeapMemoryMaximum in interface GridNodeMetrics
Returns:
The maximum amo