mirror of
https://github.com/yavook/kiwi-simple-metrics.git
synced 2024-11-22 15:42:59 +00:00
37 lines
847 B
Python
37 lines
847 B
Python
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 = ", "
|
|
|
|
# metrics settings
|
|
cpu: metric.CpuMS = metric.CpuMS()
|
|
memory: metric.MemoryMS = metric.MemoryMS()
|
|
disk: metric.DiskMS = metric.DiskMS()
|
|
external: metric.ExternalMS = metric.ExternalMS()
|
|
|
|
# pinging webhooks
|
|
webhook: misc.WebhookSettings = misc.WebhookSettings()
|
|
|
|
|
|
SETTINGS = Settings()
|
|
|
|
__all__ = [
|
|
"MetricSettings",
|
|
"SETTINGS",
|
|
]
|