mirror of
https://github.com/yavook/kiwi-simple-metrics.git
synced 2024-11-21 23:32:59 +00:00
SETTINGS.cpu.interval
This commit is contained in:
parent
a6ef9c0c2b
commit
e159a17f76
2 changed files with 4 additions and 1 deletions
|
@ -9,7 +9,7 @@ from ._report import Report, ReportData
|
||||||
def _hwdata() -> Iterator[ReportData]:
|
def _hwdata() -> Iterator[ReportData]:
|
||||||
yield ReportData.from_settings(
|
yield ReportData.from_settings(
|
||||||
name=SETTINGS.cpu.name,
|
name=SETTINGS.cpu.name,
|
||||||
value=psutil.cpu_percent(interval=1),
|
value=psutil.cpu_percent(interval=SETTINGS.cpu.interval),
|
||||||
settings=SETTINGS.cpu,
|
settings=SETTINGS.cpu,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
@ -54,6 +54,9 @@ class CpuMS(MetricSettings):
|
||||||
name: str = "CPU"
|
name: str = "CPU"
|
||||||
threshold: float = math.inf
|
threshold: float = math.inf
|
||||||
|
|
||||||
|
# timespan to analyze average CPU usage
|
||||||
|
interval: float = 1
|
||||||
|
|
||||||
|
|
||||||
class MemoryMS(MetricSettings):
|
class MemoryMS(MetricSettings):
|
||||||
name: str = "Memory"
|
name: str = "Memory"
|
||||||
|
|
Loading…
Reference in a new issue