[modules/memory] Adapt limits

Limits are now actually against the amount of memory used, instead of
memory still free (more intuitive).

fixes #12
This commit is contained in:
Tobi-wan Kenobi 2016-11-15 20:34:14 +01:00
parent 8b78b20d11
commit 36d723e7e6

View file

@ -7,8 +7,8 @@ def description():
def parameters():
return [
"memory.warning: Warning threshold in % of memory still available (defaults to 20%)",
"memory.critical: Critical threshold in % of memory still available (defaults to 10%)",
"memory.warning: Warning threshold in % of memory used (defaults to 80%)",
"memory.critical: Critical threshold in % of memory used (defaults to 90%)",
]
class Module(bumblebee.module.Module):
@ -30,9 +30,9 @@ class Module(bumblebee.module.Module):
)
def warning(self, widget):
return self._mem.percent < self._config.parameter("warning", 20)
return self._mem.percent > self._config.parameter("warning", 80)
def critical(self, widget):
return self._mem.percent < self._config.parameter("critical", 10)
return self._mem.percent > self._config.parameter("critical", 90)
# vim: tabstop=8 expandtab shiftwidth=4 softtabstop=4