plasma-umass / scalene

Scalene: a high-performance, high-precision CPU, GPU, and memory profiler for Python with AI-powered optimization proposals
Apache License 2.0
12.22k stars 399 forks source link

Unable to export scalene summary as a Json output #852

Closed abhishek-gupta-01 closed 3 months ago

abhishek-gupta-01 commented 3 months ago

Describe the bug I am unable to download the json output of the profiler summary.

To Reproduce Steps to reproduce the behavior:

  1. I am running this command in my WSL - scalene --json --outfile report.json sample_code.py
  2. A report.json is generated which actually contains HTML information and not just the json output.
  3. I have tried --json-only also but still html information. Json_issue

Expected behavior When I run "scalene sample_code.py" 2 files are generated automatically - profile.html and profile.json I am trying to get a similar file as profile.json.

Desktop (please complete the following information):

Additional context I am trying to profile my sample.py script with multiple iteration using a bash script that runs this command 100 times. "scalene --no-browser --json --outfile report.json sample_code.py" I am trying to store the json response of each iteration in a folder for further analysis.

emeryberger commented 3 months ago

Thanks for reporting. This should be fixed in the current repo and in an upcoming release.