[問題] 記錄python script的效能使用

作者: amigcamel (阿吉amig)   2014-01-10 12:24:47
想請問一下
有沒有簡單的方式可以記錄
某一個python script或function在執行時
所消耗的cpu memory ...等等
已經查到一些可能跟這相關的東西有
top (linux command)
psutil (python module)
但是還是不太了解
有人願意分享一下經驗嘛?
我的用途主要是做效能回報
PS. OS為Ubuntu
作者: DemonDeath (Beethoven Virus)   2014-01-10 15:20:00
簡單的python tool有line_profiler跟memory_profiler
作者: amigcamel (阿吉amig)   2014-01-10 15:58:00
line_profiler 可以profile CPU usage 嗎?
作者: Wush978 (拒看低質媒體)   2014-01-11 00:09:00
OS中直接用system call 查/proc/<pid>/status來看狀態

Links booklink

Contact Us: admin [ a t ] ucptt.com