Skip to content

Commit 21cfe07

Browse files
committed
remove PekkoScheduleOnceInstrumentation
1 parent 2eefed9 commit 21cfe07

File tree

3 files changed

+18
-48
lines changed

3 files changed

+18
-48
lines changed

instrumentation/pekko/pekko-actor-1.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/pekkoactor/v1_0/PekkoActorInstrumentationModule.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ public List<TypeInstrumentation> typeInstrumentations() {
2424
new PekkoDispatcherInstrumentation(),
2525
new PekkoActorCellInstrumentation(),
2626
new PekkoDefaultSystemMessageQueueInstrumentation(),
27-
new PekkoScheduleInstrumentation(),
28-
new PekkoScheduleOnceInstrumentation());
27+
new PekkoScheduleInstrumentation());
2928
}
3029
}

instrumentation/pekko/pekko-actor-1.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/pekkoactor/v1_0/PekkoScheduleInstrumentation.java

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,12 @@ public void transform(TypeTransformer transformer) {
3232
.and(takesArgument(2, named("java.lang.Runnable")))
3333
.and(takesArgument(3, named("scala.concurrent.ExecutionContext"))),
3434
PekkoScheduleInstrumentation.class.getName() + "$ScheduleAdvice");
35+
transformer.applyAdviceToMethod(
36+
named("scheduleOnce")
37+
.and(takesArgument(0, named("scala.concurrent.duration.FiniteDuration")))
38+
.and(takesArgument(1, named("java.lang.Runnable")))
39+
.and(takesArgument(2, named("scala.concurrent.ExecutionContext"))),
40+
PekkoScheduleInstrumentation.class.getName() + "$ScheduleOnceAdvice");
3541
}
3642

3743
@SuppressWarnings("unused")
@@ -44,4 +50,15 @@ public static void enterSchedule(
4450
runnable = context.wrap(runnable);
4551
}
4652
}
53+
54+
@SuppressWarnings("unused")
55+
public static class ScheduleOnceAdvice {
56+
57+
@Advice.OnMethodEnter(suppress = Throwable.class)
58+
public static void enterScheduleOnce(
59+
@Advice.Argument(value = 1, readOnly = false) Runnable runnable) {
60+
Context context = Java8BytecodeBridge.currentContext();
61+
runnable = context.wrap(runnable);
62+
}
63+
}
4764
}

instrumentation/pekko/pekko-actor-1.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/pekkoactor/v1_0/PekkoScheduleOnceInstrumentation.java

Lines changed: 0 additions & 46 deletions
This file was deleted.

0 commit comments

Comments
 (0)