我正在使用打开“--profiler”标志的uWSGI,但我似乎找不到输出文件(如果有的话),并且(就像uWSGI中的许多东西一样)这没有正确记录。
问问题
1661 次
2 回答
0
我今天刚遇到这个问题。这是一个很好的项目,你可以使用:https ://github.com/what-studio/profiling
我从我的代码中使用它,如下所示:
from profiling.tracing import TracingProfiler
profiler = TracingProfiler()
profiler.start()
# ... run your program...
profiler.stop()
# save profile data to file
profiler.dump('path/to/file')
于 2020-04-28T15:30:56.637 回答
0
一个有用的技巧是使用uWSGI的记录器将分析器日志过滤到它们自己的文件中:
uwsgi \
<< other uwsgi options >> \
--logger profiler file:/path/to/profile.log \
--log-route profiler uWSGI Python profiler
于 2017-02-08T14:49:34.713 回答