File tree Expand file tree Collapse file tree 1 file changed +18
-18
lines changed
prometheus-metrics-instrumentation-jvm/src/main/java/io/prometheus/metrics/instrumentation/jvm Expand file tree Collapse file tree 1 file changed +18
-18
lines changed Original file line number Diff line number Diff line change @@ -94,24 +94,24 @@ private void registerGCDurationHistogram(PrometheusRegistry registry) {
9494 continue ;
9595 }
9696
97- NotificationEmitter notificationEmitter = ( NotificationEmitter ) gcBean ;
98-
99- notificationEmitter . addNotificationListener (
100- ( notification , handback ) -> {
101- if (! GarbageCollectionNotificationInfo . GARBAGE_COLLECTION_NOTIFICATION . equals (
102- notification . getType ())) {
103- return ;
104- }
105-
106- GarbageCollectionNotificationInfo info =
107- GarbageCollectionNotificationInfo . from ( (CompositeData ) notification .getUserData ());
108-
109- gcDurationHistogram
110- .labelValues (info .getGcName (), info .getGcAction (), info .getGcCause ())
111- .observe (Unit .millisToSeconds (info .getGcInfo ().getDuration ()));
112- },
113- null ,
114- null );
97+ (( NotificationEmitter ) gcBean )
98+ . addNotificationListener (
99+ ( notification , handback ) -> {
100+ if (! GarbageCollectionNotificationInfo . GARBAGE_COLLECTION_NOTIFICATION . equals (
101+ notification . getType ())) {
102+ return ;
103+ }
104+
105+ GarbageCollectionNotificationInfo info =
106+ GarbageCollectionNotificationInfo . from (
107+ (CompositeData ) notification .getUserData ());
108+
109+ gcDurationHistogram
110+ .labelValues (info .getGcName (), info .getGcAction (), info .getGcCause ())
111+ .observe (Unit .millisToSeconds (info .getGcInfo ().getDuration ()));
112+ },
113+ null ,
114+ null );
115115 }
116116 }
117117
You can’t perform that action at this time.
0 commit comments