Module io.prometheus.metrics.core
Class CounterWithCallback
Object
Metric
MetricWithFixedMetadata
CounterWithCallback
- All Implemented Interfaces:
Collector
Example:
ClassLoadingMXBean classLoadingMXBean = ManagementFactory.getClassLoadingMXBean();
CounterWithCallback.builder()
.name("classes_loaded_total")
.help("The total number of classes that have been loaded since the JVM has started execution")
.callback(callback -> callback.call(classLoadingMXBean.getLoadedClassCount()))
.register();
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classstatic interface -
Method Summary
Modifier and TypeMethodDescriptionstatic CounterWithCallback.Builderbuilder()static CounterWithCallback.Builderbuilder(PrometheusProperties properties) CounterSnapshotcollect()Methods inherited from class MetricWithFixedMetadata
getPrometheusNameMethods inherited from class Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface Collector
collect, collect, collect