Tencent / matrix

Matrix is a plugin style, non-invasive APM system developed by WeChat.
Other
11.61k stars 1.88k forks source link

如何直接看到耗时堆栈详情呢,目前还是太麻烦了 #215

Closed demoface closed 5 years ago

demoface commented 5 years ago

如何可视化类似blockcanary,ArgusAPM看到耗时堆栈的信息呢,而不是通过mapping去查,现在使用起来太麻烦了。或者直接在logcat,日志完整输出也行啊

star3136 commented 5 years ago

目前我是这样处理的,你可以参考一下。 1.在matrix-trace-canary中创建一个类,里面只有一个List的成员变量,用于保存mapping文件的每一行。 2.在matrix-gradle-plugin中的MethodTracer#innerTraceMethodFromJar(...)方法中,取到这个类的class,通过ASM/javassit给其中的List类型的成员变量添加上collectedMethodMap的所有value。 3.在matrix-trace-canary中再创建一个类来解析保存mapping文件信息的类,结果为SparseArray类型,键为methodId,值为方法信息。 4.修改诊断报告,将显示methodId的地方改为显示方法信息。

以上,也希望有更好的方法。

demoface commented 5 years ago

你这样也挺麻烦的,要修改源代码和gradle插件,都9012年了,展示方式非常不利于介入。希望官方直接加上这块内容

txfelixzhou commented 5 years ago

之前issue有回答过,可参考sample的做法