Skip to content

Commit 28bd154

Browse files
committed
refactor: remove redundant if-check
See: #14047
1 parent 960e102 commit 28bd154

File tree

1 file changed

+4
-6
lines changed
  • instrumentation/runtime-telemetry/runtime-telemetry-java17/library/src/main/java/io/opentelemetry/instrumentation/runtimemetrics/java17/internal/cpu

1 file changed

+4
-6
lines changed

instrumentation/runtime-telemetry/runtime-telemetry-java17/library/src/main/java/io/opentelemetry/instrumentation/runtimemetrics/java17/internal/cpu/LongLockHandler.java

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,6 @@ public final class LongLockHandler implements RecordedEventHandler {
2525
private static final String METRIC_DESCRIPTION = "Long lock times";
2626
private static final String EVENT_NAME = "jdk.JavaMonitorWait";
2727

28-
private static final String EVENT_THREAD = "eventThread";
29-
3028
private final DoubleHistogram histogram;
3129
private final Attributes attributes;
3230

@@ -54,12 +52,12 @@ public JfrFeature getFeature() {
5452

5553
@Override
5654
public void accept(RecordedEvent recordedEvent) {
57-
if (recordedEvent.hasField(EVENT_THREAD)) {
58-
histogram.record(DurationUtil.toSeconds(recordedEvent.getDuration()), attributes);
59-
}
55+
histogram.record(DurationUtil.toSeconds(recordedEvent.getDuration()), attributes);
6056
// What about the class name in MONITOR_CLASS ?
6157
// We can get a stack trace from the thread on the event
62-
// var eventThread = recordedEvent.getThread(EVENT_THREAD);
58+
//if (recordedEvent.hasField("eventThread")) {
59+
// var eventThread = recordedEvent.getThread("eventThread");
60+
//}
6361
}
6462

6563
@Override

0 commit comments

Comments
 (0)