问题描述
在 Python 中,
我可以使用这个程序: https://pycallgraph.readthedocs.io/
我可以用 with 语句 (example of code) 包装代码的地方:
with PyCallGraph(output=graphviz):
person = Person()
for a in xrange(10):
person.add_banana(Banana())
person.eat_bananas()
如果我有一个 Java 程序...有没有办法生成类似的调用图?我尝试在 eclipse (https://marketplace.eclipse.org/content/callgraph-viewer) 中使用静态分析工具,但由于它是静态的,因此它没有显示每个函数所需的实际时间,并且在遇到接口时会撞墙,因为它在运行时无法通过它们进行分析。
class MyProgram{
public void myMethod(){
// is there some library/line of code I can add here to mimic what the python program above has done?
doReallyComplexMethodWith100DeepSubcallsINeedToSeeWhenItHitsBottom();
//I dont care about anything after this function above
functionIDontCareAbout();
}
}
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)