-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
feat(swapusage): add swapusage
beacon (complements memusage
beacon)
#59460
feat(swapusage): add swapusage
beacon (complements memusage
beacon)
#59460
Conversation
862a4b8
to
ad364e2
Compare
""" | ||
Beacon to monitor swap usage. | ||
|
||
.. versionadded:: 3003 |
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.
Assumed 3003
.
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.
3003.0
?
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.
We did discuss this in the open hour, but there is not a SEP currently to actually change this. I'll bring it up again to see which release we want to start implementing this and when we can get a SEP prepped. For now you can keep it at 3003 and we can change later if needed.
3e73c49
to
6f4e290
Compare
tests/unit/beacons/test_swapusage.py
Outdated
@@ -0,0 +1,66 @@ | |||
# Python libs |
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.
Since this is a new test module would you mind migrating it to pytest? tests/pytests/unit/beacons
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.
@Ch3LL Done. Since this was based on memusage
, I've migrated that to pytest as well. If there are any changes that need to be made, I'll apply them to both test files.
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.
thanks!!!!
9199d05
to
e1852f3
Compare
Actually, won't If so, https://docs.saltproject.io/en/master/topics/releases/version_numbers.html should also be updated for |
""" | ||
Beacon to monitor swap usage. | ||
|
||
.. versionadded:: 3003 |
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.
We did discuss this in the open hour, but there is not a SEP currently to actually change this. I'll bring it up again to see which release we want to start implementing this and when we can get a SEP prepped. For now you can keep it at 3003 and we can change later if needed.
import salt.beacons.memusage as memusage | ||
from tests.support.mock import MagicMock, patch | ||
|
||
STUB_MEMORY_USAGE = namedtuple( |
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.
We try to avoid module level variables in tests now since this has caused hard to find issues in the test suite if they clash with other testing modules.
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.
import salt.beacons.swapusage as swapusage | ||
from tests.support.mock import MagicMock, patch | ||
|
||
STUB_SWAP_USAGE = namedtuple("sswap", "total used free percent sin sout")( |
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.
here as well
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.
e1852f3
to
6f695b6
Compare
What does this PR do?
Adds a
swapusage
beacon to use alongside the existingmemusage
beacon.What issues does this PR fix or reference?
N/A.
Merge requirements satisfied?
Implementation, docs and tests based on the
memusage
beacon (with obvious changes made).Commits signed with GPG?
Yes