/pyflame-server

A webservice to facilate the use of pyflame

Primary LanguagePerl

pyflame-server

A webservice to facilate the use of pyflame

Pyflame解析和扩展

Installation

pip install -r requirements.txt
python wsgi.py

visit http://localhost:5000/

change localhost to your host ip

Usage

1 get pyflame for py2.6 py2.7 py3.4 py3.5 py3.6 py3.7

curl -o pyflame http://<your-host-ip>:5000/pyflame ; chmod +x pyflame

2.1 start python to profile

./pyflame -t python test.py > profile.txt

2.2 or attach python pid to profile, -s seconds -p pid, reference

sudo ./pyflame -s 5 -p 28947 > profile.txt

2.3 if you need to profile c stack at the same time (when you are curious about idle), add -c option

sudo ./pyflame -c -s 5 -p 28947 > profile.txt

3 upload to pyflame-server

curl -F "file=@profile.txt" http://<your-host-ip>:5000/upload

4 visit the url printed by curl, samples here

My fork of Pyflame

Since the author of uber/pyflame no longer works at uber, the official repo is not well maintained. I forked to Meteorix/pyflame and did the following things:

  1. Merge PR of py3.7 support
  2. Merge PR of anaconda fix
  3. Fix py2.7 build script
  4. Add Dockerfile to build pyflame which enables py2.6/py2.7/py3.4/py3.5/py3.6/py3.7 support
  5. Add c/c++ stack profile