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

Support I (idle) process state on procfs+Linux #3530

Merged
merged 1 commit into from
Dec 11, 2017

Conversation

tzz
Copy link
Contributor

@tzz tzz commented Nov 30, 2017

I is a Linux process state: https://github.com/torvalds/linux/blob/master/fs/proc/array.c#L135

This is a fairly recent change but causes lots of Telegraf log noise with 4.x kernels.

I'll do the rest of the paperwork for the PR if the underlying idea is acceptable.

Required for all PRs:

  • Signed CLA.
  • Associated README.md updated.
  • Has appropriate unit tests.

@danielnelson
Copy link
Contributor

👍

@phemmer
Copy link
Contributor

phemmer commented Dec 1, 2017

I think it would be nice to not emit this field on systems which don't support it.

@danielnelson
Copy link
Contributor

How can we tell if its supported though, it looks like we are running ps axo state and counting the items.

@danielnelson
Copy link
Contributor

Oh whoops I was looking at the wrong code :/

@danielnelson
Copy link
Contributor

Now I'm looking at /proc/1/stat, it seems like its the same problem. Is there a location we can get the known states from? It would be great if we can do this, since 0 is not the same as unset.

@phemmer
Copy link
Contributor

phemmer commented Dec 1, 2017

Not sure. I was hoping for bright ideas, but the only thing I can think of is the kernel version. Which I'm not sure is justified to bother checking when it's just a field that's always 0.

"total": int64(0),
"unknown": int64(0),
}
switch runtime.GOOS {
case "freebsd":
fields["idle"] = int64(0)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should leave these as before, and add "idle" to the linux section. In my opinion better to report 0 than unset.

`I` is a Linux process state: https://github.com/torvalds/linux/blob/master/fs/proc/array.c#L135

This is a fairly recent change but causes lots of Telegraf log noise with 4.x kernels.
@tzz
Copy link
Contributor Author

tzz commented Dec 9, 2017

@danielnelson thanks for the review. I've updated the README and signed the CLA.

I changed it to do the minimum possible, which was to do I parsing and stats sending only on Linux, as you and others requested.

I'm not sure how to do the tests, since they will depend on the right version of Linux and you don't have anything in that direction currently in the processes tests. Would you like to add the tests yourself after merge?

Either way, I appreciate the help and attention.

@danielnelson danielnelson added this to the 1.6.0 milestone Dec 11, 2017
@danielnelson danielnelson added the feat Improvement on an existing feature such as adding a new setting/mode to an existing plugin label Dec 11, 2017
@danielnelson danielnelson merged commit 663a5b1 into influxdata:master Dec 11, 2017
@danielnelson
Copy link
Contributor

Thank you!

@atc-cegodk
Copy link

I see that this got added to the 1.6.0 milestone.

Is there a plan to support I (idle) process state in version 1.4.x?

@danielnelson
Copy link
Contributor

I'm not planning to make another release on the 1.4 branch, but I will add this to the upcoming 1.5.0 release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feat Improvement on an existing feature such as adding a new setting/mode to an existing plugin
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants