diamond-DockerContainerCollector icon indicating copy to clipboard operation
diamond-DockerContainerCollector copied to clipboard

Docker Metrics large numbers

Open stevezau opened this issue 9 years ago • 2 comments

Hey,

Looking at the metrics being pushed to graphite it looks like they are all really long numbers.. ie cpu usage is like 150245784 which makes no sense to me.

Doing a little bit of research it appears you are meant to calc to differences between each stats stream? Or at least this is what the docker cli command does..

https://github.com/docker/docker/blob/0d445685b8d628a938790e50517f3fb949b300e0/api/client/stats.go#L199

shouldn't this be doing something similar rather then sending that really large number?

stevezau avatar Jun 05 '16 10:06 stevezau

Hello, this is what the diamond function publish_gauge does, as opposed to publish_counter. I remember having to publish a gauge for some of the network metrics, but not for any of the cpu ones. Maybe something changed in the docker stats api recently. I will take a look and let you know.

lesaux avatar Jun 05 '16 15:06 lesaux

Im also shocked at the big numbers. In cpuPercent = (cpuDelta / systemDelta) * float64(len(v.CpuStats.CpuUsage.PercpuUsage)) * 100.0, it is kinda hard for me to comprehend len(v.CpuStats.CpuUsage.PercpuUsage). Is that ignorable?

ywfluctier avatar Dec 14 '17 09:12 ywfluctier