-
Notifications
You must be signed in to change notification settings - Fork 356
Add support for /proc/swaps #246
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
Conversation
This code (both implementation and tests) is largely based on the existing mountinfo implementation. Signed-off-by: Steven McDonald <steven.mcdonald@usabilla.com>
mdlayher
left a comment
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.
From a code perspective this seems pretty good.
I'd like to see the tests make use of subtests and go-cmp, and I'd also like to see some tests with a fixture copied from /proc/swaps on your own system.
You can see what I did for tests in https://github.com/prometheus/procfs/blob/master/net_sockstat_test.go.
You can add fixtures by following https://github.com/prometheus/procfs#updating-test-fixtures.
b705b63 to
ec928a2
Compare
|
@mdlayher Does this look reasonable to you? |
Signed-off-by: Steven McDonald <steven.mcdonald@usabilla.com>
ec928a2 to
4e7c2da
Compare
pgier
left a comment
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
Building on prometheus/procfs#246 this PR is introducing metrics around swap devices. Today metrics around swap are already available, but they are on the node level. With this PR, metrics are now available per device. Relates to: prometheus#1890 Signed-off-by: Fabian Deutsch <fabiand@fedoraproject.org>
Building on prometheus/procfs#246 this PR is introducing metrics around swap devices. Today metrics around swap are already available, but they are on the node level. With this PR, metrics are now available per device. Relates to: prometheus#1890 Signed-off-by: Fabian Deutsch <fabiand@fedoraproject.org> Co-authored-by: claude.ai
* Add /proc/swaps collector Building on prometheus/procfs#246 this PR is introducing metrics around swap devices. Today metrics around swap are already available, but they are on the node level. With this PR, metrics are now available per device. Relates to: #1890 Signed-off-by: Fabian Deutsch <fabiand@fedoraproject.org> Co-authored-by: claude.ai --------- Signed-off-by: Fabian Deutsch <fabiand@fedoraproject.org>
This code (both implementation and tests) is largely based on the existing mountinfo implementation.
Implementation of #244.