@@ -50,21 +50,21 @@ public class VirtualThreadMetrics implements MeterBinder, Closeable {
50
50
private static final String VT_ACTIVE_METRIC_NAME = "jvm.threads.virtual.active" ;
51
51
52
52
private final RecordingConfig recordingCfg ;
53
-
53
+
54
54
private RecordingStream recordingStream ;
55
55
56
56
private final Iterable <Tag > tags ;
57
-
57
+
58
58
private boolean activeMetricEnabled ;
59
-
59
+
60
60
public VirtualThreadMetrics () {
61
61
this (new RecordingConfig (), emptyList ());
62
62
}
63
63
64
64
public VirtualThreadMetrics (RecordingConfig config ) {
65
65
this (config , emptyList ());
66
66
}
67
-
67
+
68
68
public VirtualThreadMetrics (Iterable <Tag > tags ) {
69
69
this (new RecordingConfig (), tags );
70
70
}
@@ -76,7 +76,7 @@ public VirtualThreadMetrics(RecordingConfig config, Iterable<Tag> tags) {
76
76
77
77
@ Override
78
78
public void bindTo (MeterRegistry registry ) {
79
- if (this .recordingStream == null ) {
79
+ if (this .recordingStream == null ) {
80
80
this .recordingStream = createRecordingStream (this .recordingCfg );
81
81
}
82
82
Timer pinnedTimer = Timer .builder (VT_PINNED_METRIC_NAME )
@@ -91,8 +91,8 @@ public void bindTo(MeterRegistry registry) {
91
91
92
92
recordingStream .onEvent (PINNED_EVENT , event -> pinnedTimer .record (event .getDuration ()));
93
93
recordingStream .onEvent (SUBMIT_FAILED_EVENT , event -> submitFailedCounter .increment ());
94
-
95
- if (activeMetricEnabled ) {
94
+
95
+ if (activeMetricEnabled ) {
96
96
final LongAdder activeCounter = new LongAdder ();
97
97
this .recordingStream .onEvent (START_EVENT , event -> activeCounter .increment ());
98
98
this .recordingStream .onEvent (END_EVENT , event -> activeCounter .decrement ());
@@ -110,7 +110,7 @@ private RecordingStream createRecordingStream(RecordingConfig config) {
110
110
recordingStream .enable (SUBMIT_FAILED_EVENT );
111
111
recordingStream .setMaxAge (config .maxAge );
112
112
recordingStream .setMaxSize (config .maxSizeBytes );
113
- if (activeMetricEnabled ) {
113
+ if (activeMetricEnabled ) {
114
114
recordingStream .enable (START_EVENT );
115
115
recordingStream .enable (END_EVENT );
116
116
}
0 commit comments