Click on Javadoc link to open Javadoc documentation.
Package
org.gridgain.grid.spi.metrics ![]()
Available starting with GridGain 
Built-in Implementations
GridGain comes with JDK MBeans metrics by default:
Description
Grid local metrics SPI allows grid to get metrics on local VM. These metrics are a subset of metrics included into GridNode.getMetrics() ![]()
Metrics are usually exchanged between nodes via Discovery SPI and are updated with some frequency. The delay is really depends on heartbeat (or metrics update) frequency of the underlying Discovery SPI.
Node CPU Utilization
CPU utilization is determined either using Hyperic (default) or Java6 OperatingSystemMXBean.getSystemLoadAverage() method.
| Hyperic SIGAR License Note that Hyperic CIGAR is licensed under GPL. If GPL license is not acceptable for your project, remove sigar.jar and all libsigar-*.so binaries from GRIDGAIN_HOME/libs folder. In this case CPU metrics will be provided using Java 6 or will not be provided if running on Java 5. |
Configuration
GridMetricsSpi is provided in Grid Configuration passed into GridFactory ![]()
GridConfigurationAdapter cfg = new GridConfigurationAdapter(); GridJdkLocalMetricsSpi metricsSpi = new GridJdkLocalMetricsSpi(); // Disable preference of Hyperic SIGAR. // JDK 1.6 CPU metrics will be given preference. metricsSpi.setPreferSigar(false); // Configure your own metrics SPI. cfg.setMetricsSpi(metricsSpi); GridFactory.start(cfg);
Note that GridConfiguration interface is just a bean and can also be configured using spring XML configuration.

For more information about using Spring framework for configuration click here.
Default Implementation
By default, GridJdkLocalMetricsSpi is used.


