akka.cluster
Class SigarMetricsCollector

java.lang.Object
  extended by akka.cluster.JmxMetricsCollector
      extended by akka.cluster.SigarMetricsCollector

public class SigarMetricsCollector
extends JmxMetricsCollector

Loads metrics through Hyperic SIGAR and JMX monitoring beans. This loads wider and more accurate range of metrics compared to JmxMetricsCollector by using SIGAR's native OS library.

The constructor will by design throw exception if org.hyperic.sigar.Sigar can't be loaded, due to missing classes or native libraries.

TODO switch to Scala reflection


Constructor Summary
SigarMetricsCollector(ActorSystem system)
          This constructor is used when creating an instance from configured FQCN
SigarMetricsCollector(Address address, double decayFactor, java.lang.Object sigar)
           
 
Method Summary
 akka.cluster.MetricsCollector apply(ExtendedActorSystem system, ClusterSettings settings)
           
 void close()
          Releases any native resources associated with this instance.
 scala.Option<Metric> cpuCombined()
          (SIGAR) Returns the combined CPU sum of User + Sys + Nice + Wait, in percentage.
 scala.collection.immutable.Set<Metric> metrics()
           
 long pid()
           
 scala.Option<Metric> systemLoadAverage()
          (SIGAR / JMX) Returns the OS-specific average load on the CPUs in the system, for the past 1 minute.
 
Methods inherited from class akka.cluster.JmxMetricsCollector
heapCommitted, heapMax, heapMemoryUsage, heapUsed, processors, sample
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SigarMetricsCollector

public SigarMetricsCollector(Address address,
                             double decayFactor,
                             java.lang.Object sigar)

SigarMetricsCollector

public SigarMetricsCollector(ActorSystem system)
This constructor is used when creating an instance from configured FQCN

Method Detail

pid

public long pid()

metrics

public scala.collection.immutable.Set<Metric> metrics()
Overrides:
metrics in class JmxMetricsCollector

systemLoadAverage

public scala.Option<Metric> systemLoadAverage()
(SIGAR / JMX) Returns the OS-specific average load on the CPUs in the system, for the past 1 minute. On some systems the JMX OS system load average may not be available, in which case a -1 is returned from JMX, which means that None is returned from this method. Hyperic SIGAR provides more precise values, thus, if the library is on the classpath, it is the default. Creates a new instance each time.

Overrides:
systemLoadAverage in class JmxMetricsCollector

cpuCombined

public scala.Option<Metric> cpuCombined()
(SIGAR) Returns the combined CPU sum of User + Sys + Nice + Wait, in percentage. This metric can describe the amount of time the CPU spent executing code during n-interval and how much more it could theoretically. Note that 99% CPU utilization can be optimal or indicative of failure.

In the data stream, this will sometimes return with a valid metric value, and sometimes as a NaN or Infinite. Documented bug https://bugzilla.redhat.com/show_bug.cgi?id=749121 and several others.

Creates a new instance each time.


close

public void close()
Releases any native resources associated with this instance.

Overrides:
close in class JmxMetricsCollector

apply

public akka.cluster.MetricsCollector apply(ExtendedActorSystem system,
                                           ClusterSettings settings)