Home > Enterprise >  Measure CPU Usage (in Cores) and Memory Usage of Compiled Programs
Measure CPU Usage (in Cores) and Memory Usage of Compiled Programs

Time:11-24

I have two programs, one in go and one in python that I am trying to characterize. For this, I'd like to measure the CPU usage and Memory Usage by regularly measuring the amounts consumed by the two programs at regular intervals (say, every 0.1 seconds) for some given amount of time. I have been looking everywhere for any sort of solution to this problem, but I can't find any.

Does a good solution to this exist? If so, what?

CodePudding user response:

You can also try Check server load with top, htop, iotop.

CodePudding user response:

For my particular case, the best choice is to instrument the each of the programs for something like Prometheus. Then I can scrape the data at regular intervals to get what I am looking for.

In this case, I would follow off of something like: https://prometheus.io/docs/guides/go-application/

Or: https://linuxhint.com/monitor-python-applications-prometheus/

  • Related