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

Do not die if kernel is too old for full /proc/stat info #117

Merged
merged 1 commit into from Jun 21, 2016

Conversation

manpen
Copy link

@manpen manpen commented Apr 25, 2016

LinuxProcStat fails (and dies) on Linux Kernels < 2.6.33 since /proc/stat contains less values than expected.
This small change circumvents the problem by reporting "na" if the value is not availble.

@lorenzhs
Copy link
Member

Wow 2.6.32 borders on OS archaeology – do I want to know how you got a C++14 compiler running on that system? ;)
Timo will probably take a look at it.

@bingmann
Copy link
Member

There are two problems with this:
a) you have some typos in the LOG messages.
b) I don't think "na" is valid Json. actually, NaN and Inf or Infinity is also not valid json. I would consider outputting 0 is the best choice.

@manpen
Copy link
Author

manpen commented Apr 26, 2016

a) Clearly, sorry about that
b) If we already have a NaN why not use it to clearly indicate that something is missing?

@bingmann
Copy link
Member

NaN and Inf or Infinity is also not valid json. See wikipedia, set to zero.

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.

None yet

3 participants