Class CounterWithCallback

All Implemented Interfaces:
Collector

Example:
ClassLoadingMXBean classLoadingMXBean = ManagementFactory.getClassLoadingMXBean();

CounterWithCallback.builder()
        .name("classes_loaded_total")
        .help("The total number of classes since the JVM has started execution")
        .callback(callback -> callback.call(classLoadingMXBean.getLoadedClassCount()))
        .register();