cpustat
cpustat copied to clipboard
Support for batch mode
As of now, it looks like the main use case for cpustat is interactive. As the provided metrics are super useful, it would be nice to have a batch mode that allows the background logging of the metrics.
To achieve that, at minimum, a timestamp should be logged at the start of each sample. Even better, the tool could support for a machine-parsable CSV output like sadf does.
Many thanks for the outstanding work, much needed!
I've done some work on that. Check out cpustat-agent:
https://github.com/uber-common/cpustat/tree/master/cpustat-agent
It stashes the samples in a circular buffer, and then you can fetch them with a simple client interface.
It has triggered some heap fragmentation issues, which I'm hoping that the next release of Go will fix.
Great!
Any hint about how it can be used?
@stefanodoni we have explored using cpustat, and after all we built https://github.com/jgehrcke/goeffel. Quote from goeffel's README:
The program cpustat open-sourced by Uber has a delightful README about the general measurement methodology and overall seems to be a great tool. However, it seems to be optimized for interactive usage (whereas we were looking for a robust measurement program which can be pointed at a process and then be left unattended for a significant while)