[modules/cpu] Add configurable warning and critical thresholds

The cpu module now has cpu.warning and cpu.critical thresholds. If the
CPU utilization is higher than any of those values, the widget's state
changes to warning or critical, respectively.

see #23
This commit is contained in:
Tobi-wan Kenobi 2016-12-10 08:09:13 +01:00
parent 87e76b9e40
commit 225d471c6a
5 changed files with 60 additions and 17 deletions

View file

@ -31,9 +31,17 @@ class MockEngine(object):
self.input = MockInput()
class MockConfig(object):
def __init__(self):
self._data = {}
def get(self, name, default):
if name in self._data:
return self._data[name]
return default
def set(self, name, value):
self._data[name] = value
class MockOutput(object):
def start(self):
pass