Class JmxMetricsCollector

java.lang.Object
org.apache.pekko.cluster.metrics.JmxMetricsCollector
All Implemented Interfaces:
Closeable, AutoCloseable, MetricsCollector
Direct Known Subclasses:
SigarMetricsCollector

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

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

  • Constructor Details

    • JmxMetricsCollector

      public JmxMetricsCollector(Address address, double decayFactor)
    • JmxMetricsCollector

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

    • close

      public void close()
      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface Closeable
    • heapCommitted

      public scala.Option<Metric> heapCommitted(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(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 MemoryUsage heapMemoryUsage()
      Current heap to be passed in to heapUsed, heapCommitted and heapMax
    • heapUsed

      public scala.Option<Metric> heapUsed(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.
    • sample

      public NodeMetrics sample()
      Samples and collects new data points. Creates a new instance each time.
      Specified by:
      sample in interface MetricsCollector
    • 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.