-
Notifications
You must be signed in to change notification settings - Fork 321
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
Fix overflow in mounstats #165
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm after small nit.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, although I'm still a bit confused about why the problem occurred. AFAICT, the kernel sources store the time in nanoseconds as a signed int64 (https://github.com/torvalds/linux/blob/master/include/linux/ktime.h#L27) and then divide to convert the milliseconds before printing (https://github.com/torvalds/linux/blob/master/net/sunrpc/stats.c#L224). So I would think the max value that could appear in mountstats
would be (max int64)/1000000.
If this was on an older kernel, maybe it was still using the older unsigned long long
format?(torvalds/linux@ff83997#diff-4efb17a470df6029d642a329c7a42123).
Yes, the example data came from a RHEL 7.3 system, 3.10 kernel. |
297bd8b
to
f18cce3
Compare
Don't use time.Duration for mountstats timing data. These values can be large uint64 milliseconds values and easily overflow time.Duration (in64 nanoseconds). Return the raw time in milliseconds. Signed-off-by: Ben Kochie <[email protected]>
f18cce3
to
2539d54
Compare
* Update procfs vendor to pull in github.com/prometheus/procfs/pull/165 * Update mountstats collector to use new types. * Rollover counter automatically to avoid float64 accuracy issues. * Update e2e test. Signed-off-by: Ben Kochie <[email protected]>
* Update procfs vendor to pull in github.com/prometheus/procfs/pull/165 * Update mountstats collector to use new types. * Rollover counter automatically to avoid float64 accuracy issues. * Update e2e test. Signed-off-by: Ben Kochie <[email protected]>
* Update procfs vendor to pull in github.com/prometheus/procfs/pull/165 * Update mountstats collector to use new types. * Rollover counter automatically to avoid float64 accuracy issues. * Update e2e test. Signed-off-by: Ben Kochie <[email protected]>
* Update procfs vendor to pull in github.com/prometheus/procfs/pull/165 * Update mountstats collector to use new types. * Rollover counter automatically to avoid float64 accuracy issues. * Update e2e test. Signed-off-by: Ben Kochie <[email protected]>
* Update procfs vendor to pull in github.com/prometheus/procfs/pull/165 * Update mountstats collector to use new types. * Rollover counter automatically to avoid float64 accuracy issues. * Update e2e test. Signed-off-by: Ben Kochie <[email protected]>
Do not run test_task in parallel with other tests
* Update procfs vendor to pull in github.com/prometheus/procfs/pull/165 * Update mountstats collector to use new types. * Rollover counter automatically to avoid float64 accuracy issues. * Update e2e test. Signed-off-by: Ben Kochie <[email protected]>
* Update procfs vendor to pull in github.com/prometheus/procfs/pull/165 * Update mountstats collector to use new types. * Rollover counter automatically to avoid float64 accuracy issues. * Update e2e test. Signed-off-by: Ben Kochie <[email protected]>
Don't use time.Duration for mountstats timing data. These values can be
large uint64 milliseconds values and easily overflow time.Duration
(in64 nanoseconds). Return the raw time in milliseconds.
Signed-off-by: Ben Kochie [email protected]