Closed npit closed 2 years ago
The code you have there is not generating the type of profile file that snakeviz can work with, what you're doing there is creating a text file with some output from the Stats
instance, what you need is the binary profile data the Profile class can create. I think Profile.dump_stats will do it but I'm not 100% sure.
BTW, you can natively use a Profile instance as a context manager.
Reproduction steps and details below.
Python code:
Bash script:
Generated Profile:
Script output Output: