Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added cpu_usage_total measurement in CPU input plugin #2594

Closed

Conversation

d-ulyanov
Copy link
Contributor

CPU input plugin: added cpu_usage_total measurement. This measurement is often used and it would be convenient to have possibility to enable it in config.

@d-ulyanov d-ulyanov mentioned this pull request Mar 29, 2017
@danielnelson
Copy link
Contributor

Won't the usage have poor accuracy because you are adding up percentages instead of saving the raw values and then computing a single percentage?

I think there is another problem with how we loop over the CPUs, but only save one cpuCoreUsage instead of one per cpu plus one for total cpu.

@d-ulyanov
Copy link
Contributor Author

d-ulyanov commented Mar 31, 2017

Accuracy is based on CPU usage % that already reported, so here we have the same accuracy.

I have two root causes for adding this measurement:

  1. On graphs where we have several hosts - we don't need to have CPU distributions and per-core usage. It's very convenient to have pre-calculated measurement.
  2. We can't build CPU usage quantiles for cluster from histograms based on several CPU distributions :) We need one consolidated measurement. For these histograms we're using The histogram aggregator plugin was added. #2387
    It's cool feature and we're using it for checking cluster states and capacity planning.

screen shot 2017-03-31 at 14 50 54

To build such graph we need following measurements:

cpu_usage_total{cpu="cpu-total"} 4.485887096501215

cpu_usage_total_bucket{cpu="cpu-total",le="1.0"} 0
cpu_usage_total_bucket{cpu="cpu-total",le="2.0"} 167
...
cpu_usage_total_bucket{cpu="cpu-total",le="90.0"} 32694
cpu_usage_total_bucket{cpu="cpu-total",le="95.0"} 32694

All of them are result of combining #2387 and this PR.

@danielnelson
Copy link
Contributor

@goller Can you review the usage calculation accuracy?

@d-ulyanov Definitely will need to fix the cpuCoreUsage part, we should have stats for all cores and right now it's calculating across cores.

@vlamug
Copy link
Contributor

vlamug commented May 10, 2017

@danielnelson , could you tell us when you plan to release this request?

@danielnelson
Copy link
Contributor

Can't we more easily add this by just essentially reverting 10b0438?

On the histogram use case, what if you created the histograms using cpu-idle and then invert them in the query since total = 100 - idle?

@danielnelson
Copy link
Contributor

We added cpu_time_active and cpu_usage_active in #2943.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants