Class 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();