better load graph colors

This commit is contained in:
2026-08-11 19:28:44 +02:00
parent a82de89fca
commit 413543ca84
+2 -2
View File
@@ -12,7 +12,7 @@ import subprocess
PERIODS = {"3hours": "3h", "1day": "1d", "2weeks": "2w", "1year": "1y"} PERIODS = {"3hours": "3h", "1day": "1d", "2weeks": "2w", "1year": "1y"}
COLORS = ["#2563EB", "#DC2626", "#16A34A", "#9333EA"] COLORS = ["#2563EB", "#DC2626", "#16A34A", "#9333EA"]
LOAD_COLORS = ["#DC2626", "#F59E0B", "#FACC15"] # red, amber, yellow LOAD_COLORS = ["#FACC15", "#F59E0B", "#DC2626"] # bottom to top
def graph(output: Path, rrd: Path, start: str, title: str, unit: str, def graph(output: Path, rrd: Path, start: str, title: str, unit: str,
@@ -69,7 +69,7 @@ def main() -> None:
if not mounts or mounts[0] != "/": if not mounts or mounts[0] != "/":
mounts.insert(0, "/") mounts.insert(0, "/")
definitions = [ definitions = [
("load", "Processor load", "load", [("load1", "1 minute", "AVERAGE"), ("load5", "5 minutes", "AVERAGE"), ("load15", "15 minutes", "AVERAGE")], False, True, False, False), ("load", "Processor load", "load", [("load15", "15 minutes", "AVERAGE"), ("load5", "5 minutes", "AVERAGE"), ("load1", "1 minute", "AVERAGE")], False, True, False, False),
("cpu", "CPU usage", "%", [("cpu_user", "user", "AVERAGE"), ("cpu_system", "system", "AVERAGE"), ("cpu_nice", "nice", "AVERAGE")], False, True, False, False), ("cpu", "CPU usage", "%", [("cpu_user", "user", "AVERAGE"), ("cpu_system", "system", "AVERAGE"), ("cpu_nice", "nice", "AVERAGE")], False, True, False, False),
("network", "Network throughput", "bytes/s", [("net_out", "sent", "AVERAGE"), ("net_in", "received", "AVERAGE")], False, False, False, True), ("network", "Network throughput", "bytes/s", [("net_out", "sent", "AVERAGE"), ("net_in", "received", "AVERAGE")], False, False, False, True),
("disk", "Disk and memory usage", "%", [(f"disk_{'root' if i == 0 else i}", mount, "AVERAGE") for i, mount in enumerate(mounts)] + [("memory", "memory", "AVERAGE")], False, False, True, False), ("disk", "Disk and memory usage", "%", [(f"disk_{'root' if i == 0 else i}", mount, "AVERAGE") for i, mount in enumerate(mounts)] + [("memory", "memory", "AVERAGE")], False, False, True, False),