question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

start/stop profiling programmatically while target program is running

See original GitHub issue

Is your feature request related to a problem? Please describe. I’d like to use scalene to profile production workloads. I can’t easily reproduce the production load pattern offline, so I can’t just run scalene myprog offline. I can’t start my job as scalene myprog in production either, because 1) I don’t want to incur the overhead, and 2) I don’t want it to profile from the start of program - I only want to profile specific periods and I want to see the report without stopping my job.

Describe the solution you’d like A way to start and stop profiling, and produce reports programmatically from my program. I don’t mind modifying my program.

Describe alternatives you’ve considered I tried py-spy which allows attaching to a running process, but the results don’t look plausible. I would like to get cross validation from scalene.

Additional context

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:9 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
guoshimincommented, Feb 16, 2021

I’m interested in CPU profiling primarily. Even if the overhead is low enough that I can enable it in production, I still don’t want it to profile the entire duration of my job. The load varies with time and I’d like to run profiling for the periods of my choosing.

0reactions
emerybergercommented, Mar 22, 2021

Great! Please report your findings (if successful!) here: https://github.com/plasma-umass/scalene/issues/58

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to start and stop sampling (ti… | Apple Developer Forums
I'd like to be able to start Instruments collecting performance data when the task starts, then stop it again as soon as it...
Read more >
Profiler User's Guide - NVIDIA Documentation Center
The user manual for NVIDIA profiling tools for optimizing performance of CUDA applications.
Read more >
Visual Studio Profiling: Start/Stop from code - Stack Overflow
In my case, I would like to start it when clicking on a button in my application, which switches to a new view,...
Read more >
Azure Automation Start/Stop VMs during off-hours overview
WhatIf enables validation of runbook logic without executing. AutoStop_Disable, None, Disables Auto-Stop alerts and default schedule.
Read more >
Stop and start EC2 instances at set intervals using Lambda
Important: When attaching a permissions policy to Lambda, make sure that you choose the IAM policy that you just created. Create Lambda functions...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found