cpustat icon indicating copy to clipboard operation
cpustat copied to clipboard

Support for batch mode

Open stefanodoni opened this issue 8 years ago • 3 comments

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!

stefanodoni avatar Jun 20 '16 09:06 stefanodoni

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.

mranney avatar Jun 20 '16 19:06 mranney

Great!

Any hint about how it can be used?

stefanodoni avatar Oct 06 '16 07:10 stefanodoni

@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)

jgehrcke avatar Sep 18 '19 12:09 jgehrcke