Dashboard > GridGain User Guide > Table Of Contents > Developers Guide > Local Metrics SPI
Local Metrics SPI
Added by morpheus, last edited by morpheus on Dec 23, 2008  (view change)
Labels: 
(None)


Click on Javadoc link to open Javadoc documentation.

Package

org.gridgain.grid.spi.metrics Javadoc

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() Javadoc method. This way every grid node can become aware of certain changes on other nodes, such as CPU load for example.

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 Javadoc at startup. By default, only one available implementation GridJdkLocalMetricsSpi is used.

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.


GridJdkLocalMetricsSpi (GridGain User Guide)

Powered by Atlassian Confluence, the Enterprise Wiki. (Version: 2.2.10 Build:#528 Nov 29, 2006) - Bug/feature request - Contact Administrators