SETTINGS.cpu.interval

This commit is contained in:
Jörn-Michael Miehe 2023-09-02 01:56:41 +00:00
parent a6ef9c0c2b
commit e159a17f76
2 changed files with 4 additions and 1 deletions

View file

@ -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,
) )

View file

@ -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"