Skip to content

Commit 5c7160b

Browse files
committed
./gradlew spotlessApply
1 parent 60abb2e commit 5c7160b

File tree

1 file changed

+5
-9
lines changed

1 file changed

+5
-9
lines changed

instrumentation/executors/bootstrap/src/main/java/io/opentelemetry/javaagent/bootstrap/executors/ContextPropagatingRunnable.java

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ public static boolean shouldDecorateRunnable(Runnable task) {
2727
public static Runnable propagateContext(Runnable task, Context context) {
2828
return new ContextPropagatingRunnable(task, context);
2929
}
30+
3031
private static final double NANOS_PER_S = TimeUnit.SECONDS.toNanos(1);
3132
private final Runnable delegate;
3233
private final Context context;
@@ -39,8 +40,7 @@ private ContextPropagatingRunnable(Runnable delegate, Context context) {
3940
this.startObservation = System.nanoTime();
4041

4142
this.pendingTimeHistogram =
42-
GlobalOpenTelemetry
43-
.getMeter("thread.pending.duration")
43+
GlobalOpenTelemetry.getMeter("thread.pending.duration")
4444
.histogramBuilder("thread.pending.duration")
4545
.setUnit("s")
4646
.setDescription("Duration of HTTP client requests.")
@@ -50,13 +50,9 @@ private ContextPropagatingRunnable(Runnable delegate, Context context) {
5050
@Override
5151
public void run() {
5252
try (Scope ignored = context.makeCurrent()) {
53-
pendingTimeHistogram
54-
.record(System.nanoTime() - startObservation / NANOS_PER_S,
55-
Attributes.of(
56-
AttributeKey.stringKey("thread"),
57-
Thread.currentThread().getName()
58-
)
59-
);
53+
pendingTimeHistogram.record(
54+
System.nanoTime() - startObservation / NANOS_PER_S,
55+
Attributes.of(AttributeKey.stringKey("thread"), Thread.currentThread().getName()));
6056
delegate.run();
6157
}
6258
}

0 commit comments

Comments
 (0)