在Django服务器上进行剖析 [英] Profiling on live Django server?

查看:98
本文介绍了在Django服务器上进行剖析的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我从来没有在Python中完成代码覆盖,但是我正在寻找类似 GCC gcov ,它告诉我每行执行多少次,或苹果的鲨鱼,它给出了每个功能需要多长时间的层次分解。



我的问题是我有一个正在经历高负载的实时服务器,我无法从日志中得知是什么导致的。我想附加一些Django实例来监视哪些行是最热的和/或哪些函数花费最长的时间。



这是一样的,但不是准确地说,代码覆盖。我想将它介绍给一个现场运行的服务器,最好不要太多修改。



想法?

解决方案

cProfile + RunSnakeRun:
http:// www。 vrplumber.com/programming/runsnakerun/


I've never done code coverage in Python, but I'm looking for something like GCC's gcov, which tells me how many times each line executes, or Apple's Shark which gives a hierarchial breakdown of how long each function is taking.

My problem is that I have a live server which is experiencing high load, and I can't tell from the logs what's causing it. I would like to attach something to my Django instance to monitor which lines are the hottest and/or which functions are taking the longest time.

This is something like, but not exactly, code coverage. I would like to introduce it to a live running server, preferably without modifying too much.

Ideas?

解决方案

cProfile + RunSnakeRun: http://www.vrplumber.com/programming/runsnakerun/

这篇关于在Django服务器上进行剖析的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆