GridGain™ 4.3.1e
Enterprise "Big Data" Edition

org.gridgain.grid
Interface GridNodeMetrics

All Superinterfaces:
Serializable
All Known Implementing Classes:
GridDiscoveryMetricsAdapter

public interface GridNodeMetrics
extends Serializable

This class represents runtime information on a node. Apart from obvious statistical value, this information is used for implementation of load balancing, failover, and collision SPIs. For example, collision SPI in combination with fail-over SPI could check if other nodes don't have any active or waiting jobs and fail-over some jobs to those nodes.

Node metrics for any node can be accessed via GridNode.metrics() method. Keep in mind that there will be a certain network delay (usually equal to heartbeat delay) for the accuracy of node metrics. However, when accessing metrics on local node Grid.localNode().getMetrics() the metrics are always accurate and up to date.

Local node metrics are registered as MBean and can be accessed from any JMX management console. The simplest way is to use standard jconsole that comes with JDK as it also provides ability to view any node parameter as a graph.

See Also:
GridProjectionMetrics
 

Method Summary
 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.
 double getCurrentGcCpuLoad()
          Returns average time spent in CG since the last update.
 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 getFileSystemFreeSpace()
          Returns the number of unallocated bytes in the partition.
 long getFileSystemTotalSpace()
          Returns the size of the partition.
 long getFileSystemUsableSpace()
          Returns the number of bytes available to this virtual machine on the partition.
 long getHeapMemoryCommitted()
          Returns the amount of heap memory in bytes that is committed for the JVM to use.
 long getHeapMemoryInitialized()
          Returns the amount of heap memory in bytes that the JVM 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 getLastDataVersion()
          Data grid assigns incremental versions to all cache operations.
 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 JVM started or peak was reset.
 int getMaximumWaitingJobs()
          Gets maximum number of waiting jobs this node had.
 long getNodeStartTime()
          Returns the start time of grid node in milliseconds.
 long getNonHeapMemoryCommitted()
          Returns the amount of non-heap memory in bytes that is committed for the JVM to use.
 long getNonHeapMemoryInitialized()
          Returns the amount of non-heap memory in bytes that the JVM 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 getReceivedBytesCount()
          Gets received bytes count.
 int getReceivedMessagesCount()
          Gets received messages count.
 long getSentBytesCount()
          Gets sent bytes count.
 int getSentMessagesCount()
          Gets sent messages count.
 long getStartTime()
          Returns the start time of the JVM in milliseconds.
 long getTotalBusyTime()
          Gets total time this node spent executing jobs.
 int getTotalCancelledJobs()
          Gets total number of cancelled jobs.
 int getTotalCpus()
          Returns the number of CPUs available to the Java Virtual Machine.
 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 JVM started.
 long getUpTime()
          Returns the uptime of the JVM in milliseconds.
 

Method Detail

getLastUpdateTime

@GridMBeanDescription(value="Last update time of this node metrics.")
long getLastUpdateTime()
Gets last update time of this node metrics.

Returns:
Last update time.

getMaximumActiveJobs

@GridMBeanDescription(value="Maximum number of jobs that ever ran concurrently on this node.")
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:

Returns:
Maximum number of jobs that ever ran concurrently on this node.

getCurrentActiveJobs

@GridMBeanDescription(value="Number of currently active jobs concurrently executing on the node.")
int getCurrentActiveJobs()
Gets number of currently active jobs concurrently executing on the node.

Returns:
Number of currently active jobs concurrently executing on the node.

getAverageActiveJobs

@GridMBeanDescription(value="Average number of active jobs concurrently executing on the node.")
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:

Returns:
Average number of active jobs.

getMaximumWaitingJobs

@GridMBeanDescription(value="Maximum number of waiting jobs this node had.")
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:

Returns:
Maximum number of waiting jobs.

getCurrentWaitingJobs

@GridMBeanDescription(value="Number of queued jobs currently waiting to be executed.")
int getCurrentWaitingJobs()
Gets number of queued jobs currently waiting to be executed.

Returns:
Number of queued jobs currently waiting to be executed.

getAverageWaitingJobs

@GridMBeanDescription(value="Average number of waiting jobs this node had queued.")
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:

Returns:
Average number of waiting jobs.

getMaximumRejectedJobs

@GridMBeanDescription(value="Maximum number of jobs rejected at once during a single collision resolution operation.")
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:

Returns:
Maximum number of jobs rejected at once.

getCurrentRejectedJobs

@GridMBeanDescription(value="Number of jobs rejected after more recent collision resolution operation.")
int getCurrentRejectedJobs()
Gets number of jobs rejected after more recent collision resolution operation.

Returns:
Number of jobs rejected after more recent collision resolution operation.

getAverageRejectedJobs

@GridMBeanDescription(value="Average number of jobs this node rejects during collision resolution operations.")
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:

Returns:
Average number of jobs this node rejects during collision resolution operations.

getTotalRejectedJobs

@GridMBeanDescription(value="Total number of jobs this node rejects during collision resolution operations.")
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:

Returns:
Total number of jobs this node rejects during collision resolution operations.

getMaximumCancelledJobs

@GridMBeanDescription(value="Maximum number of cancelled jobs this node ever had running concurrently.")
int getMaximumCancelledJobs()
Gets maximum number of cancelled jobs this node ever had running concurrently.

Returns:
Maximum number of cancelled jobs.

getCurrentCancelledJobs

@GridMBeanDescription(value="Number of cancelled jobs that are still running.")
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 up to the job itself to gracefully exit.

Returns:
Number of cancelled jobs that are still running.

getAverageCancelledJobs

@GridMBeanDescription(value="Average number of cancelled jobs this node ever had running concurrently.")
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:

Returns:
Average number of cancelled jobs.

getTotalCancelledJobs

@GridMBeanDescription(value="Total number of cancelled jobs since node startup.")
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:

Returns:
Total number of cancelled jobs since node startup.

getTotalExecutedJobs

@GridMBeanDescription(value="Total number of jobs handled by the node.")
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:

Returns:
Total number of jobs handled by the node.

getMaximumJobWaitTime

@GridMBeanDescription(value="Maximum time a job ever spent waiting in a queue to be executed.")
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:

Returns:
Maximum waiting time.

getCurrentJobWaitTime

@GridMBeanDescription(value="Current wait time of oldest job.")
long getCurrentJobWaitTime()
Gets current time an oldest jobs has spent waiting to be executed.

Returns:
Current wait time of oldest job.

getAverageJobWaitTime

@GridMBeanDescription(value="Average time jobs spend waiting in the queue to be executed.")
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:

Returns:
Average job wait time.

getMaximumJobExecuteTime

@GridMBeanDescription(value="Time it took to execute the longest job on the node.")
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:

Returns:
Time it took to execute the longest job on the node.

getCurrentJobExecuteTime

@GridMBeanDescription(value="Longest time a current job has been executing for.")
long getCurrentJobExecuteTime()
Gets longest time a current job has been executing for.

Returns:
Longest time a current job has been executing for.

getAverageJobExecuteTime

@GridMBeanDescription(value="Average time a job takes to execute on the node.")
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:

Returns:
Average job execution time.

getTotalBusyTime

@GridMBeanDescription(value="Total time this node spent executing jobs.")
long getTotalBusyTime()
Gets total time this node spent executing jobs.

Returns:
Total time this node spent executing jobs.

getTotalIdleTime

@GridMBeanDescription(value="Total time this node spent idling (not executing any jobs).")
long getTotalIdleTime()
Gets total time this node spent idling (not executing any jobs).

Returns:
Gets total time this node spent idling.

getCurrentIdleTime

@GridMBeanDescription(value="Time this node spend idling since executing last job.")
long getCurrentIdleTime()
Gets time this node spend idling since executing last job.

Returns:
Time this node spend idling since executing last job.

getBusyTimePercentage

@GridMBeanDescription(value="Percentage of time this node is busy executing jobs vs. idling.")
float getBusyTimePercentage()
Gets percentage of time this node is busy executing jobs vs. idling.

Returns:
Percentage of time this node is busy (value is less than or equal to 1 and greater than or equal to 0)

getIdleTimePercentage

@GridMBeanDescription(value="Percentage of time this node is idling vs. executing jobs.")
float getIdleTimePercentage()
Gets percentage of time this node is idling vs. executing jobs.

Returns:
Percentage of time this node is idle (value is less than or equal to 1 and greater than or equal to 0)

getTotalCpus

@GridMBeanDescription(value="The number of CPUs available to the Java Virtual Machine.")
int getTotalCpus()
Returns the number of CPUs available to the Java Virtual Machine. This method is equivalent to the Runtime.availableProcessors() method.

Note that this value may change during successive invocations of the virtual machine.

Returns:
The number of processors available to the virtual machine, never smaller than one.

getCurrentCpuLoad

@GridMBeanDescription(value="The system load average; or a negative value if not available.")
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.

Returns:
The system load average in [0, 1] range. Negative value if not available.

getAverageCpuLoad

@GridMBeanDescription(value="Average of CPU load values over all metrics kept in the history.")
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:

Returns:
Average of CPU load value in [0, 1] range over all metrics kept in the history.

getCurrentGcCpuLoad

@GridMBeanDescription(value="Average time spent in CG since the last update.")
double getCurrentGcCpuLoad()
Returns average time spent in CG since the last update.

Returns:
Average time spent in CG since the last update.

getHeapMemoryInitialized

@GridMBeanDescription(value="The initial size of memory in bytes; -1 if undefined.")
long getHeapMemoryInitialized()
Returns the amount of heap memory in bytes that the JVM 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.

Returns:
The initial size of memory in bytes; -1 if undefined.

getHeapMemoryUsed

@GridMBeanDescription(value="Current heap size that is used for object allocation.")
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.

Returns:
Amount of heap memory used.

getHeapMemoryCommitted

@GridMBeanDescription(value="The amount of committed memory in bytes.")
long getHeapMemoryCommitted()
Returns the amount of heap memory in bytes that is committed for the JVM to use. This amount of memory is guaranteed for the JVM 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.

Returns:
The amount of committed memory in bytes.

getHeapMemoryMaximum

@GridMBeanDescription(value="The maximum amount of memory in bytes; -1 if undefined.")
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 JVM 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.

Returns:
The maximum amount of memory in bytes; -1 if undefined.

getNonHeapMemoryInitialized

@GridMBeanDescription(value="The initial size of memory in bytes; -1 if undefined.")
long getNonHeapMemoryInitialized()
Returns the amount of non-heap memory in bytes that the JVM 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 non-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.

Returns:
The initial size of memory in bytes; -1 if undefined.

getNonHeapMemoryUsed

@GridMBeanDescription(value="Current non-heap memory size that is used by Java VM.")
long getNonHeapMemoryUsed()
Returns the current non-heap memory size that is used by Java VM. The non-heap memory consists of one or more memory pools. This value is the sum of used non-heap memory values of all non-heap memory pools.

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

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

Returns:
Amount of none-heap memory used.

getNonHeapMemoryCommitted

@GridMBeanDescription(value="Amount of non-heap memory in bytes that is committed for the JVM to use.")
long getNonHeapMemoryCommitted()
Returns the amount of non-heap memory in bytes that is committed for the JVM to use. This amount of memory is guaranteed for the JVM to use. The non-heap memory consists of one or more memory pools. This value is the sum of committed non-heap memory values of all non-heap memory pools.

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

Returns:
The amount of committed memory in bytes.

getNonHeapMemoryMaximum

@GridMBeanDescription(value="Maximum amount of non-heap memory in bytes that can be used for memory management. -1 if undefined.")
long getNonHeapMemoryMaximum()
Returns the maximum amount of non-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 JVM 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 non-heap memory for Java VM and is not a sum of all initial non-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.

Returns:
The maximum amount of memory in bytes; -1 if undefined.

getUpTime

@GridMBeanDescription(value="Uptime of the JVM in milliseconds.")
long getUpTime()
Returns the uptime of the JVM in milliseconds.

Returns:
Uptime of the JVM in milliseconds.

getStartTime

@GridMBeanDescription(value="Start time of the JVM in milliseconds.")
long getStartTime()
Returns the start time of the JVM in milliseconds. This method returns the approximate time when the Java virtual machine started.

Returns:
Start time of the JVM in milliseconds.

getNodeStartTime

long getNodeStartTime()
Returns the start time of grid node in milliseconds. There can be several grid nodes started in one JVM, so JVM start time will be the same for all of them, but node start time will be different.

Returns:
Start time of the grid node in milliseconds.

getCurrentThreadCount

@GridMBeanDescription(value="Current number of live threads.")
int getCurrentThreadCount()
Returns the current number of live threads including both daemon and non-daemon threads.

Returns:
Current number of live threads.

getMaximumThreadCount

@GridMBeanDescription(value="The peak live thread count.")
int getMaximumThreadCount()
Returns the maximum live thread count since the JVM started or peak was reset.

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

Returns:
The peak live thread count.

getTotalStartedThreadCount

@GridMBeanDescription(value="The total number of threads started.")
long getTotalStartedThreadCount()
Returns the total number of threads created and also started since the JVM started.

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

Returns:
The total number of threads started.

getCurrentDaemonThreadCount

@GridMBeanDescription(value="Current number of live daemon threads.")
int getCurrentDaemonThreadCount()
Returns the current number of live daemon threads.

Returns:
Current number of live daemon threads.

getFileSystemFreeSpace

@GridMBeanDescription(value="Number of unallocated bytes in the partition.")
long getFileSystemFreeSpace()
Returns the number of unallocated bytes in the partition.

Returns:
Number of unallocated bytes in the partition.

getFileSystemTotalSpace

@GridMBeanDescription(value="Size of the partition.")
long getFileSystemTotalSpace()
Returns the size of the partition.

Returns:
Size of the partition.

getFileSystemUsableSpace

@GridMBeanDescription(value="Number of bytes available to this virtual machine on the partition.")
long getFileSystemUsableSpace()
Returns the number of bytes available to this virtual machine on the partition.

Returns:
Number of bytes available to this virtual machine on the partition.

getLastDataVersion

@GridMBeanDescription(value="Last data version.")
long getLastDataVersion()
Data grid assigns incremental versions to all cache operations. This method provides the latest data version on the node.

Returns:
Last data version.

getSentMessagesCount

@GridMBeanDescription(value="Sent messages count.")
int getSentMessagesCount()
Gets sent messages count.

Returns:
Sent messages count.

getSentBytesCount

@GridMBeanDescription(value="Sent bytes count.")
long getSentBytesCount()
Gets sent bytes count.

Returns:
Sent bytes count.

getReceivedMessagesCount

@GridMBeanDescription(value="Received messages count.")
int getReceivedMessagesCount()
Gets received messages count.

Returns:
Received messages count.

getReceivedBytesCount

@GridMBeanDescription(value="Received bytes count.")
long getReceivedBytesCount()
Gets received bytes count.

Returns:
Received bytes count.

GridGain™ 4.3.1e
Enterprise "Big Data" Edition

GridGain - In-Memory Big Data
Enterprise "Big Data" Edition, ver. 4.3.1e.10112012
2012 Copyright © GridGain Systems
Follow us:   Follow GridGain on Github Join GridGain User Group Follow GridGain on Twitter Follow GridGain on Vimeo