Class BufferPoolsExports
- java.lang.Object
-
- io.prometheus.client.Collector
-
- io.prometheus.client.hotspot.BufferPoolsExports
-
public class BufferPoolsExports extends Collector
Exports metrics about JVM buffers. Can be replaced with a simple access once JDK 1.7 compatibility is baseline.
-
-
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.util.List<java.lang.Object>bufferPoolMXBeansprivate java.lang.reflect.MethodgetCountprivate java.lang.reflect.MethodgetMemoryUsedprivate java.lang.reflect.MethodgetNameprivate java.lang.reflect.MethodgetTotalCapacityprivate static java.lang.StringJVM_BUFFER_POOL_CAPACITY_BYTESprivate static java.lang.StringJVM_BUFFER_POOL_USED_BUFFERSprivate static java.lang.StringJVM_BUFFER_POOL_USED_BYTESprivate static java.util.logging.LoggerLOGGER-
Fields inherited from class io.prometheus.client.Collector
MILLISECONDS_PER_SECOND, NANOSECONDS_PER_SECOND
-
-
Constructor Summary
Constructors Constructor Description BufferPoolsExports()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description private static java.util.List<java.lang.Object>accessBufferPoolMXBeans(java.lang.Class<?> bufferPoolMXBeanClass)private longcallLongMethod(java.lang.reflect.Method method, java.lang.Object pool)java.util.List<Collector.MetricFamilySamples>collect()Return all metrics of this Collector.java.util.List<Collector.MetricFamilySamples>collect(Predicate<java.lang.String> nameFilter)LikeCollector.collect(), but the result should only containMetricFamilySampleswheresampleNameFilter.test(name)istruefor at least one Sample name.private java.lang.StringgetName(java.lang.Object pool)-
Methods inherited from class io.prometheus.client.Collector
checkMetricLabelName, checkMetricName, doubleToGoString, register, register, sanitizeMetricName
-
-
-
-
Field Detail
-
JVM_BUFFER_POOL_USED_BYTES
private static final java.lang.String JVM_BUFFER_POOL_USED_BYTES
- See Also:
- Constant Field Values
-
JVM_BUFFER_POOL_CAPACITY_BYTES
private static final java.lang.String JVM_BUFFER_POOL_CAPACITY_BYTES
- See Also:
- Constant Field Values
-
JVM_BUFFER_POOL_USED_BUFFERS
private static final java.lang.String JVM_BUFFER_POOL_USED_BUFFERS
- See Also:
- Constant Field Values
-
LOGGER
private static final java.util.logging.Logger LOGGER
-
bufferPoolMXBeans
private final java.util.List<java.lang.Object> bufferPoolMXBeans
-
getName
private java.lang.reflect.Method getName
-
getMemoryUsed
private java.lang.reflect.Method getMemoryUsed
-
getTotalCapacity
private java.lang.reflect.Method getTotalCapacity
-
getCount
private java.lang.reflect.Method getCount
-
-
Method Detail
-
accessBufferPoolMXBeans
private static java.util.List<java.lang.Object> accessBufferPoolMXBeans(java.lang.Class<?> bufferPoolMXBeanClass)
-
collect
public java.util.List<Collector.MetricFamilySamples> collect()
Description copied from class:CollectorReturn all metrics of this Collector.
-
collect
public java.util.List<Collector.MetricFamilySamples> collect(Predicate<java.lang.String> nameFilter)
Description copied from class:CollectorLikeCollector.collect(), but the result should only containMetricFamilySampleswheresampleNameFilter.test(name)istruefor at least one Sample name.The default implementation first collects all
MetricFamilySamplesand then discards the ones wheresampleNameFilter.test(name)returnsfalsefor all names inCollector.MetricFamilySamples.getNames(). To improve performance, collector implementations should override this method to preventMetricFamilySamplesfrom being collected if they will be discarded anyways. SeeThreadExportsfor an example.Note that the resulting List may contain
MetricFamilySampleswhere some Sample names returntrueforsampleNameFilter.test(name)but some Sample names returnfalse. This is ok, because before we produce the output format we will callCollector.MetricFamilySamples.filter(Predicate)to strip all Samples wheresampleNameFilter.test(name)returnsfalse.
-
callLongMethod
private long callLongMethod(java.lang.reflect.Method method, java.lang.Object pool)
-
getName
private java.lang.String getName(java.lang.Object pool)
-
-