Automated profiling and stopping a background process. #902
Unanswered
hansbretscher
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello,
I tried to profile a process that has some interaction via HTTP. For that I attempted to make an automation to eliminate the time it is just waiting for user input.
Scalene has that nice feature to write "Scalene now profiling process 12345" when started in background. I tried to use that.
My attempt looked like that (pseudocode):
`
#!/bin/bash
scalene python_script.py > file &
curl some stuff
kill $(grep pid from file)
`
This does not work. Scalene does no longer output the line above when it's output is piped somewhere. I did also try 2>file, still the line is not there.
How can I get the PID from the process that scalene is profiling?
Beta Was this translation helpful? Give feedback.
All reactions