-
Notifications
You must be signed in to change notification settings - Fork 814
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
[swap stats] add swap in/out check to checks.d #1549
Conversation
return {} | ||
|
||
swap_mem = psutil.swap_memory() | ||
self.gauge('system.swap.swapped_in', swap_mem.sin / B2MB) |
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.
You should use a rate for these.
According to the psutil documentation, sin is
the number of bytes the system has swapped in from disk (cumulative)
By submitting the metric as a rate, you will compute the # of bytes per second swapped in.
Otherwise the graphs will just display a monotonically increasing value.
Also you should submit this value in bytes as per our discussion earlier.
from checks import AgentCheck | ||
import psutil | ||
|
||
B2MB = float(1048576) |
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.
looks like it's not needed anymore :)
2963984
to
ff718ac
Compare
That looks great! 💥 |
👍 |
You should also use a "Fixes #716" expression to link that to currently opened issues. |
ff718ac
to
52f11f3
Compare
[swap stats] add swap in/out check to checks.d
Uses
psutil
to collect the rate of memory swapped in and swapped out. New metrics are labelledsystem.swap.swapped_in
andsystem.swap.swapped_out
.Fixes #716