protected void addClassLoadingMetrics ( Collection < Metric < ? > > result ) { ClassLoadingMXBean classLoadingMxBean = ManagementFactory . getClassLoadingMXBean ( ) ; result . add ( new Metric <> ( "classes" , ( long ) classLoadingMxBean . getLoadedClassCount ( ) ) ) ; result . add ( new Metric <> ( "classes.loaded" , classLoadingMxBean . getTotalLoadedClassCount ( ) ) ) ; result . add ( new Metric <> ( "classes.unloaded" , classLoadingMxBean . getUnloadedClassCount ( ) ) ) ; }
Add class loading metrics .