Class JmxMetricsCollector

  • All Implemented Interfaces:
    MetricsCollector, java.io.Closeable, java.lang.AutoCloseable
    Direct Known Subclasses:
    SigarMetricsCollector

    public class JmxMetricsCollector
    extends java.lang.Object
    implements MetricsCollector
    Loads JVM and system metrics through JMX monitoring beans.

    param: address The Address of the node being sampled param: decayFactor how quickly the exponential weighting of past data is decayed

    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void close()  
      scala.Option<Metric> heapCommitted​(java.lang.management.MemoryUsage heap)
      (JMX) Returns the current sum of heap memory guaranteed to be available to the JVM from all heap memory pools (in bytes).
      scala.Option<Metric> heapMax​(java.lang.management.MemoryUsage heap)
      (JMX) Returns the maximum amount of memory (in bytes) that can be used for JVM memory management.
      java.lang.management.MemoryUsage heapMemoryUsage()
      Current heap to be passed in to heapUsed, heapCommitted and heapMax
      scala.Option<Metric> heapUsed​(java.lang.management.MemoryUsage heap)
      (JMX) Returns the current sum of heap memory used from all heap memory pools (in bytes).
      scala.collection.immutable.Set<Metric> metrics()
      Generate metrics set.
      scala.Option<Metric> processors()
      (JMX) Returns the number of available processors Creates a new instance each time.
      NodeMetrics sample()
      Samples and collects new data points.
      scala.Option<Metric> systemLoadAverage()
      (JMX) Returns the OS-specific average load on the CPUs in the system, for the past 1 minute.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • JmxMetricsCollector

        public JmxMetricsCollector​(Address address,
                                   double decayFactor)
      • JmxMetricsCollector

        public JmxMetricsCollector​(ActorSystem system)
        This constructor is used when creating an instance from configured FQCN
    • Method Detail

      • close

        public void close()
        Specified by:
        close in interface java.lang.AutoCloseable
        Specified by:
        close in interface java.io.Closeable
      • heapCommitted

        public scala.Option<Metric> heapCommitted​(java.lang.management.MemoryUsage heap)
        (JMX) Returns the current sum of heap memory guaranteed to be available to the JVM from all heap memory pools (in bytes). Creates a new instance each time.
      • heapMax

        public scala.Option<Metric> heapMax​(java.lang.management.MemoryUsage heap)
        (JMX) Returns the maximum amount of memory (in bytes) that can be used for JVM memory management. If not defined the metrics value is None, i.e. never negative. Creates a new instance each time.
      • heapMemoryUsage

        public java.lang.management.MemoryUsage heapMemoryUsage()
        Current heap to be passed in to heapUsed, heapCommitted and heapMax
      • heapUsed

        public scala.Option<Metric> heapUsed​(java.lang.management.MemoryUsage heap)
        (JMX) Returns the current sum of heap memory used from all heap memory pools (in bytes). Creates a new instance each time.
      • metrics

        public scala.collection.immutable.Set<Metric> metrics()
        Generate metrics set. Creates a new instance each time.
      • processors

        public scala.Option<Metric> processors()
        (JMX) Returns the number of available processors Creates a new instance each time.
      • systemLoadAverage

        public scala.Option<Metric> systemLoadAverage()
        (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, and None is returned from this method. Creates a new instance each time.