better y-axis range
This commit is contained in:
+16
-2
@@ -22,10 +22,22 @@ def graph(output: Path, rrd: Path, start: str, title: str, unit: str,
|
|||||||
trouble_mixed: bool = False) -> None:
|
trouble_mixed: bool = False) -> None:
|
||||||
args = ["rrdtool", "graph", str(output), "--start", f"end-{start}",
|
args = ["rrdtool", "graph", str(output), "--start", f"end-{start}",
|
||||||
"--end", "now", "--width", "900", "--height", "260",
|
"--end", "now", "--width", "900", "--height", "260",
|
||||||
"--title", title, "--vertical-label", unit, "--slope-mode",
|
"--title", title, "--vertical-label", unit,
|
||||||
"--watermark", "cheap-system-monitor"]
|
"--watermark", "cheap-system-monitor"]
|
||||||
|
if not trouble_mixed:
|
||||||
|
args.append("--slope-mode")
|
||||||
if logarithmic:
|
if logarithmic:
|
||||||
args += ["--logarithmic", "--lower-limit", "1"]
|
args += ["--logarithmic", "--lower-limit", "1"]
|
||||||
|
if title.startswith("Processor load"):
|
||||||
|
# RRD's `m` axis suffix means milli-load: 1000m is a load of 1.0.
|
||||||
|
args += ["--lower-limit", "0", "--upper-limit", "1", "--rigid",
|
||||||
|
"--units-exponent", "-3"]
|
||||||
|
if title.startswith("CPU usage"):
|
||||||
|
args += ["--lower-limit", "0", "--upper-limit", "80", "--rigid"]
|
||||||
|
if trouble_mixed:
|
||||||
|
args += ["--lower-limit", "0", "--upper-limit", "20", "--rigid"]
|
||||||
|
if disk_memory:
|
||||||
|
args += ["--lower-limit", "0", "--upper-limit", "100", "--rigid"]
|
||||||
if thermal_mixed:
|
if thermal_mixed:
|
||||||
args += ["--lower-limit", "0", "--upper-limit", "100", "--rigid"]
|
args += ["--lower-limit", "0", "--upper-limit", "100", "--rigid"]
|
||||||
if any(ds.startswith("health_") for ds, _label, _cf in series):
|
if any(ds.startswith("health_") for ds, _label, _cf in series):
|
||||||
@@ -51,7 +63,9 @@ def graph(output: Path, rrd: Path, start: str, title: str, unit: str,
|
|||||||
f"GPRINT:{var}:AVERAGE:Average\\:%8.2lf",
|
f"GPRINT:{var}:AVERAGE:Average\\:%8.2lf",
|
||||||
f"GPRINT:{var}:MAX:Maximum\\:%8.2lf\\n"]
|
f"GPRINT:{var}:MAX:Maximum\\:%8.2lf\\n"]
|
||||||
continue
|
continue
|
||||||
if network_mixed and ds == "net_out":
|
if trouble_mixed and ds == "failed_services":
|
||||||
|
drawing = f"AREA:{var}#2563EB80:{label}"
|
||||||
|
elif network_mixed and ds == "net_out":
|
||||||
drawing = f"AREA:{var}#86EFAC:{label}"
|
drawing = f"AREA:{var}#86EFAC:{label}"
|
||||||
elif network_mixed and ds == "net_in":
|
elif network_mixed and ds == "net_in":
|
||||||
drawing = f"LINE3:{var}#2563EB:{label}"
|
drawing = f"LINE3:{var}#2563EB:{label}"
|
||||||
|
|||||||
Reference in New Issue
Block a user