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

procstat cpu_usage is null if cpu not used #2626

Closed
phemmer opened this issue Apr 4, 2017 · 1 comment
Closed

procstat cpu_usage is null if cpu not used #2626

phemmer opened this issue Apr 4, 2017 · 1 comment

Comments

@phemmer
Copy link
Contributor

phemmer commented Apr 4, 2017

Bug report

Relevant telegraf.conf:

[[inputs.procstat]]
pattern = "foo"

System info:

Telegraf version: custom build based on 1.2.1 with some master & PR commits cherry-picked. phemmer@1c214d0
OS: Linux, CentOS/7

Steps to reproduce:

  1. Run telegraf with procstat input
  2. Have a monitored process use no cpu between polling interval.

Expected behavior:

Report a 0 value for cpu_usage.

Actual behavior:

Reports a null value for cpu_usage.

Additional info:

A 0 value cpu usage is not the same as a null value cpu usage. Null means we have no data. 0 means we have data, but it was 0. If you want to do something like calculate an average, you'll get incorrect results as it wont factor in the points where CPU usage was really 0.

I personally have no intention of using cpu_usage, as I much prefer to use the raw time metrics and calculate CPU usage myself. Just reporting as it is a bug as it will affect anyone using it.

@danielnelson
Copy link
Contributor

I think I fixed this #2315

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

No branches or pull requests

2 participants