我试图在Windows7Enterprise上使用Java1.8运行btracev.1.3 (20150516),并且存在许多问题。
在我的btrace脚本中,我使用以下方法创建了一个聚合:
private static Aggregation methodDuration = Aggregations
.newAggregation(AggregationFunction.AVERAGE);聚合创建正在悄悄地失败,随后的调用正在抛出一个试图访问它的NullPointerException。
在运行股票分析示例https://github.com/jbachorik/btrace/blob/master/samples/Profiling.java时,我遇到了几乎相同的问题。
然而,这一次我收到了一条错误消息:不允许使用BTraceScript.java:131:instance变量。
该示例的btrace代码如下所示
@BTrace
public class BTraceScript {
. . .
131 @Property
132 Profiler profiler = BTraceUtils.Profiling.newProfiler();
133
134 @OnMethod(clazz="com.vgrazi.btrace.SynchronizationExample", method="/.*/")
135 void entry(@ProbeMethodName(fqn=true) String probeMethod) {
136 BTraceUtils.Profiling.recordEntry(profiler, probeMethod);
137 }FYI,我也在尝试使用Java 8的Mac,虽然它稍微深入了一些,但仍然没有正常运行。
发布于 2015-10-07 21:37:28
这是由https://github.com/jbachorik/btrace/issues/129引起的
请使用最新BTrace (当时的1.3.3)
https://stackoverflow.com/questions/32467130
复制相似问题