-1

I was trying to get the resource usage for a single process, a python py file, from its initialization to termination. I used ps and top, but it did not give me how much resource this process consumed from birth to death. is there any way I can track a resource usage of a single process which will run about 5 seconds and dies? Thank you!

  • Different units. CPU usage is a time-snapshot, RAM is a time snap-shot. You could mathematically integrate it over time, or sample it and take an average. But still a different unit, % seconds, or MB seconds. – AER Dec 10 '18 at 04:20
  • Possible duplicate of [How can you profile a Python script?](https://stackoverflow.com/q/582336/608639) More generally, [profile a python process site:stackoverflow.com](https://www.google.com/search?q=profile+a+python+process+site%3Astackoverflow.com). – jww Dec 10 '18 at 15:58

1 Answers1

-1

it's very easy to make profiler for your app

  1. sudo apt install htop
  2. htop
  3. find your process name

hope it's working, i'm new in programming