mirror of
https://github.com/yavook/kiwi-simple-metrics.git
synced 2024-12-22 12:33:01 +00:00
Merge branch 'develop' into release/0.1.0
This commit is contained in:
commit
e4296327b0
3 changed files with 9 additions and 5 deletions
2
.vscode/launch.json
vendored
2
.vscode/launch.json
vendored
|
@ -12,7 +12,7 @@
|
|||
"env": {
|
||||
"METRIC__INTERVAL": "5",
|
||||
"METRIC__LOG__ENABLED": "True",
|
||||
"METRIC__DISK__PATHS": "[\"/var\", \"/\", \"/dev\"]",
|
||||
"METRIC__EXTERNAL__ENABLED": "True",
|
||||
"METRIC__EXTERNAL__EXECUTABLES": "[\"${workspaceFolder}/example/dummy-metric\"]",
|
||||
},
|
||||
"justMyCode": true
|
||||
|
|
|
@ -102,6 +102,9 @@ class Report:
|
|||
|
||||
reports = [data.report for data in get_data()]
|
||||
|
||||
if not reports:
|
||||
return None
|
||||
|
||||
return cls(
|
||||
result=settings.report_outer.format(
|
||||
name=settings.name,
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
import math
|
||||
from typing import Any, Literal
|
||||
|
||||
from pydantic import (BaseModel, DirectoryPath, Field, FieldValidationInfo,
|
||||
FilePath, field_validator)
|
||||
from pydantic import (BaseModel, DirectoryPath, FieldValidationInfo, FilePath,
|
||||
field_validator)
|
||||
|
||||
|
||||
class MetricSettings(BaseModel):
|
||||
|
@ -81,15 +81,16 @@ class DiskMS(MetricSettings):
|
|||
count: int | None = 1
|
||||
|
||||
# paths to check for disk space
|
||||
paths: list[DirectoryPath] = Field(default_factory=list)
|
||||
paths: list[DirectoryPath] = [DirectoryPath("/")]
|
||||
|
||||
|
||||
class ExternalMS(MetricSettings):
|
||||
name: str = "External Metric"
|
||||
enabled: bool = False
|
||||
threshold: float = 0
|
||||
|
||||
# path to executable files
|
||||
executables: list[FilePath] = Field(default_factory=list)
|
||||
executables: list[FilePath] = []
|
||||
|
||||
# wait at most this many seconds for each executable
|
||||
timeout: int = 60
|
||||
|
|
Loading…
Reference in a new issue