Commit b91fac1d authored by wolfsack's avatar wolfsack
Browse files

Update metrics.py

parent 50a150ae
import platform
import platform, time
import psutil
......@@ -11,8 +11,10 @@ def metrics(node: int):
cores_physical = psutil.cpu_count(logical=False)
memory = psutil.virtual_memory()
boot_time = psutil.boot_time()
system_time = time.time()
partitions = psutil.disk_partitions()
metrics_list = [Metric(
metric_name="cpu_usage",
metric_type="gauge",
......@@ -42,11 +44,19 @@ def metrics(node: int):
), Metric(
metric_name="boot_time",
metric_type="gauge",
comment="Time in ms",
comment="Time in sec since epoch",
value=boot_time,
params={
"node": f"{node}"
}
), Metric(
metric_name="system_time",
metric_type="gauge",
comment="Time in sec since epoch",
value=system_time,
params={
"node": f"{node}"
}
), Metric(
metric_name="memory_usage",
metric_type="gauge",
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment