Package io.prometheus.client.hotspot
Class ThreadExports
- java.lang.Object
-
- io.prometheus.client.Collector
-
- io.prometheus.client.hotspot.ThreadExports
-
public class ThreadExports extends Collector
Exports metrics about JVM thread areas.Example usage:
new ThreadExports().register();
jvm_threads_current{} 300 jvm_threads_daemon{} 200 jvm_threads_peak{} 410 jvm_threads_started_total{} 1200
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class io.prometheus.client.Collector
Collector.Describable, Collector.MetricFamilySamples, Collector.Type
-
-
Field Summary
Fields Modifier and Type Field Description private java.lang.management.ThreadMXBean
threadBean
-
Fields inherited from class io.prometheus.client.Collector
MILLISECONDS_PER_SECOND, NANOSECONDS_PER_SECOND
-
-
Constructor Summary
Constructors Constructor Description ThreadExports()
ThreadExports(java.lang.management.ThreadMXBean threadBean)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description (package private) void
addThreadMetrics(java.util.List<Collector.MetricFamilySamples> sampleFamilies)
java.util.List<Collector.MetricFamilySamples>
collect()
Return all of the metrics of this Collector.private java.util.Map<java.lang.Thread.State,java.lang.Integer>
getThreadStateCountMap()
private static double
nullSafeArrayLength(long[] array)
-
Methods inherited from class io.prometheus.client.Collector
checkMetricLabelName, checkMetricName, doubleToGoString, register, register, sanitizeMetricName
-
-
-
-
Method Detail
-
addThreadMetrics
void addThreadMetrics(java.util.List<Collector.MetricFamilySamples> sampleFamilies)
-
getThreadStateCountMap
private java.util.Map<java.lang.Thread.State,java.lang.Integer> getThreadStateCountMap()
-
nullSafeArrayLength
private static double nullSafeArrayLength(long[] array)
-
collect
public java.util.List<Collector.MetricFamilySamples> collect()
Description copied from class:Collector
Return all of the metrics of this Collector.
-
-