我想对用Python编写的分布式服务进行审计和监视,但想获得一个库,让我能够控制如何以及在何处保存结果。。。我找到了pyinstrument,它几乎满足了我的需要。
在我的flask
REST API中,我试图手动引发一个异常,以查看是否可以在跟踪结果中检查它,并查看它提供了多少有关此异常的信息,它似乎只显示堆栈跟踪中的几个步骤。
它只是说发生了一个错误,我是不是遗漏了什么
以下是我正在使用的配置:
@app.before_request
def before_request():
g.profiler = Profiler()
g.profiler.start()
@app.after_request
def after_request(response):
if not hasattr(g, "profiler"):
return response
g.profiler.stop()
output_html = g.profiler.output_html()
return make_response(output_html)
目前没有回答
相关问题 更多 >
编程相关推荐