Package org.apache.pekko.cluster.metrics
Class JmxMetricsCollector
java.lang.Object
org.apache.pekko.cluster.metrics.JmxMetricsCollector
- All Implemented Interfaces:
Closeable
,AutoCloseable
,MetricsCollector
- Direct Known Subclasses:
SigarMetricsCollector
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 Summary
ConstructorsConstructorDescriptionJmxMetricsCollector
(ActorSystem system) This constructor is used when creating an instance from configured FQCNJmxMetricsCollector
(Address address, double decayFactor) -
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
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).scala.Option<Metric>
heapMax
(MemoryUsage heap) (JMX) Returns the maximum amount of memory (in bytes) that can be used for JVM memory management.Current heap to be passed in to heapUsed, heapCommitted and heapMaxscala.Option<Metric>
heapUsed
(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>
(JMX) Returns the number of available processors Creates a new instance each time.sample()
Samples and collects new data points.scala.Option<Metric>
(JMX) Returns the OS-specific average load on the CPUs in the system, for the past 1 minute.
-
Constructor Details
-
JmxMetricsCollector
-
JmxMetricsCollector
This constructor is used when creating an instance from configured FQCN
-
-
Method Details
-
close
public void close()- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
-
heapCommitted
(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
(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
Current heap to be passed in to heapUsed, heapCommitted and heapMax -
heapUsed
(JMX) Returns the current sum of heap memory used from all heap memory pools (in bytes). Creates a new instance each time. -
metrics
Generate metrics set. Creates a new instance each time. -
processors
(JMX) Returns the number of available processors Creates a new instance each time. -
sample
Samples and collects new data points. Creates a new instance each time.- Specified by:
sample
in interfaceMetricsCollector
-
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.
-