2023-09-01 00:26:29 +00:00
|
|
|
from pydantic_settings import BaseSettings, SettingsConfigDict
|
|
|
|
|
|
|
|
from . import metric, misc
|
|
|
|
from .metric import MetricSettings
|
|
|
|
|
|
|
|
|
|
|
|
class Settings(BaseSettings):
|
|
|
|
model_config = SettingsConfigDict(
|
|
|
|
env_prefix="METRIC__",
|
|
|
|
env_nested_delimiter="__",
|
|
|
|
)
|
|
|
|
|
|
|
|
# time between gathering reports
|
|
|
|
interval: float = 600
|
|
|
|
|
|
|
|
# reporting to stdout
|
|
|
|
log: misc.LogSettings = misc.LogSettings()
|
|
|
|
|
|
|
|
# separates metrics and values in reports
|
|
|
|
separator: str = ", "
|
|
|
|
|
2023-09-02 02:38:12 +00:00
|
|
|
# maximum threads for concurrent metric execution
|
|
|
|
threads: int | None = None
|
|
|
|
|
2023-09-01 00:26:29 +00:00
|
|
|
# metrics settings
|
|
|
|
cpu: metric.CpuMS = metric.CpuMS()
|
|
|
|
memory: metric.MemoryMS = metric.MemoryMS()
|
|
|
|
disk: metric.DiskMS = metric.DiskMS()
|
2023-09-01 14:57:06 +00:00
|
|
|
external: metric.ExternalMS = metric.ExternalMS()
|
2023-09-01 00:26:29 +00:00
|
|
|
|
|
|
|
# pinging webhooks
|
|
|
|
webhook: misc.WebhookSettings = misc.WebhookSettings()
|
|
|
|
|
|
|
|
|
|
|
|
SETTINGS = Settings()
|
|
|
|
|
|
|
|
__all__ = [
|
|
|
|
"MetricSettings",
|
|
|
|
"SETTINGS",
|
|
|
|
]
|