- git clone git@github.com:/brendangregg/flamegraph
- pick the python worker. based on the following command:
ps -aux | grep python
# or
top -o RES -c
If you know what process you want to monitor just get the pid of the process. 3. Attach the pyflame with the process.
sudo pyflame -s <TIME-WINDOW-IN-SECONDS> -r 0.01 <PROCESS-ID> >> profile.out
- Go to the FlameGraph directory to run the FlameGraph script.
cd flamegraph
# in case file is remote then run the following command
scp -r <HOST-NAME>:/home/rakeshkumar/profile.out .
- Run the following command to filter idle time from the data. It will just reduce the noise from the final svg file.
cat profile.out | grep -v idle | ./flamegraph.pl > flamegraph.svg
- Open the svg file in a browser.