forked from btraceio/btrace
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathBTRACE256.java
More file actions
29 lines (23 loc) · 1020 Bytes
/
Copy pathBTRACE256.java
File metadata and controls
29 lines (23 loc) · 1020 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
package traces.issues;
import com.sun.btrace.annotations.*;
import com.sun.btrace.BTraceUtils;
import com.sun.btrace.Profiler;
import com.sun.btrace.services.impl.Statsd;
@BTrace class BTRACE256 {
@Injected(factoryMethod = "getInstance") private Statsd sd;
@Property
Profiler swingProfiler = BTraceUtils.Profiling.newProfiler();
@OnMethod(clazz="/.*\\.BTRACE256/", method="doStuff")
void entry(@ProbeMethodName(fqn=true) String probeMethod) {
BTraceUtils.Profiling.recordEntry(swingProfiler, probeMethod);
}
@OnMethod(clazz="/.*\\.BTRACE256/", method="doStuff", location=@Location(value=Kind.RETURN))
void exit(@ProbeMethodName(fqn=true) String probeMethod, @Duration long duration) {
BTraceUtils.Profiling.recordExit(swingProfiler, probeMethod, duration);
sd.increment("my.metric.b", "regular,distribution:gaussian");
}
@OnTimer(5000)
void timer() {
BTraceUtils.Profiling.printSnapshot("AM performance profile", swingProfiler);
}
}