Interface ClusterMetrics

This class represents runtime information on a cluster. 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 ClusterNode.metrics()
method. Keep in mind that there will be a certain network delay (usually
equal to metrics update delay) for the accuracy of node metrics. However, when accessing
metrics on local node IgniteCluster.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.

getCurrentRejectedJobs

Gets number of jobs rejected after more recent collision resolution operation.

Returns:

Number of jobs rejected after more recent collision resolution operation.

getAverageRejectedJobs

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:

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

getCurrentGcCpuLoad

double getCurrentGcCpuLoad()

Returns average time spent in CG since the last update.

Returns:

Average time spent in CG since the last update.

getHeapMemoryInitialized

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

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

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

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.

getHeapMemoryTotal

long getHeapMemoryTotal()

Returns the total amount of heap memory in bytes. This method returns -1
if the total 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 total amount of memory in bytes; -1 if undefined.

getNonHeapMemoryInitialized

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

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

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

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.

getNonHeapMemoryTotal

long getNonHeapMemoryTotal()

Returns the total amount of non-heap memory in bytes that can be
used for memory management. This method returns -1
if the total 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 total amount of memory in bytes; -1 if undefined.

getUpTime

long getUpTime()

Returns the uptime of the JVM in milliseconds.

Returns:

Uptime of the JVM in milliseconds.

getStartTime

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

int getCurrentThreadCount()

Returns the current number of live threads including both
daemon and non-daemon threads.

Returns:

Current number of live threads.

getMaximumThreadCount

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

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

int getCurrentDaemonThreadCount()

Returns the current number of live daemon threads.

Returns:

Current number of live daemon threads.

getLastDataVersion

long getLastDataVersion()

In-Memory Data Grid assigns incremental versions to all cache operations. This method provides
the latest data version on the node.