BTrace无法实例化合法属性

时间:2015-09-08 20:58:59

标签: btrace

我正在尝试在Windows 7 Enterprise上使用Java 1.8运行btrace v.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 }

仅供参考,我也在使用Java 8尝试Mac,虽然它稍微进一步,但它仍然没有真正表现得很好。

1 个答案:

答案 0 :(得分:1)

这是由https://github.com/jbachorik/btrace/issues/129

引起的

请使用latest BTrace(当时为1.3.3)