Package akka.cluster.metrics
Class SigarMetricsCollector
- java.lang.Object
-
- akka.cluster.metrics.JmxMetricsCollector
-
- akka.cluster.metrics.SigarMetricsCollector
-
- All Implemented Interfaces:
MetricsCollector
,java.io.Closeable
,java.lang.AutoCloseable
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.
param: address The
Address
of the node being sampled param: decayFactor how quickly the exponential weighting of past data is decayed param: sigar the org.hyperic.Sigar instance
-
-
Constructor Summary
Constructors Constructor Description SigarMetricsCollector(ActorSystem system)
This constructor is used when creating an instance from configured FQCNSigarMetricsCollector(Address address, double decayFactor, org.hyperic.sigar.SigarProxy sigar)
SigarMetricsCollector(Address address, ClusterMetricsSettings settings)
SigarMetricsCollector(Address address, ClusterMetricsSettings settings, org.hyperic.sigar.SigarProxy sigar)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
Releases any native resources associated with this instance.scala.Option<Metric>
cpuCombined(org.hyperic.sigar.CpuPerc cpuPerc)
(SIGAR) Returns the combined CPU sum of User + Sys + Nice + Wait, in percentage.scala.Option<Metric>
cpuIdle(org.hyperic.sigar.CpuPerc cpuPerc)
(SIGAR) Returns the idle CPU time.scala.Option<Metric>
cpuStolen(org.hyperic.sigar.CpuPerc cpuPerc)
(SIGAR) Returns the stolen CPU time.scala.collection.immutable.Set<Metric>
metrics()
Generate metrics set.scala.Option<Metric>
systemLoadAverage()
(SIGAR) Returns the OS-specific average load on the CPUs in the system, for the past 1 minute.-
Methods inherited from class akka.cluster.metrics.JmxMetricsCollector
heapCommitted, heapMax, heapMemoryUsage, heapUsed, processors, sample
-
-
-
-
Constructor Detail
-
SigarMetricsCollector
public SigarMetricsCollector(Address address, double decayFactor, org.hyperic.sigar.SigarProxy sigar)
-
SigarMetricsCollector
public SigarMetricsCollector(Address address, ClusterMetricsSettings settings, org.hyperic.sigar.SigarProxy sigar)
-
SigarMetricsCollector
public SigarMetricsCollector(Address address, ClusterMetricsSettings settings)
-
SigarMetricsCollector
public SigarMetricsCollector(ActorSystem system)
This constructor is used when creating an instance from configured FQCN
-
-
Method Detail
-
close
public void close()
Releases any native resources associated with this instance.- Specified by:
close
in interfacejava.lang.AutoCloseable
- Specified by:
close
in interfacejava.io.Closeable
- Overrides:
close
in classJmxMetricsCollector
-
cpuCombined
public scala.Option<Metric> cpuCombined(org.hyperic.sigar.CpuPerc cpuPerc)
(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 749121 and several others.
Creates a new instance each time.
-
cpuIdle
public scala.Option<Metric> cpuIdle(org.hyperic.sigar.CpuPerc cpuPerc)
(SIGAR) Returns the idle CPU time. Amount of CPU time left after combined and stolen are removed.Creates a new instance each time.
-
cpuStolen
public scala.Option<Metric> cpuStolen(org.hyperic.sigar.CpuPerc cpuPerc)
(SIGAR) Returns the stolen CPU time. Relevant to virtual hosting environments. For details please see: Wikipedia - CPU time subdivision and Understanding AWS stolen CPU and how it affects your appsCreates a new instance each time.
-
metrics
public scala.collection.immutable.Set<Metric> metrics()
Description copied from class:JmxMetricsCollector
Generate metrics set. Creates a new instance each time.- Overrides:
metrics
in classJmxMetricsCollector
-
systemLoadAverage
public scala.Option<Metric> systemLoadAverage()
(SIGAR) Returns the OS-specific average load on the CPUs in the system, for the past 1 minute.Creates a new instance each time.
- Overrides:
systemLoadAverage
in classJmxMetricsCollector
-
-