From fe248a54f60882d87907a2f5569cc76ee878c9c3 Mon Sep 17 00:00:00 2001 From: Aleksander Kiryk Date: Wed, 19 Oct 2022 11:24:58 +0200 Subject: [PATCH] Autoscale network plot --- graph.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/graph.py b/graph.py index 7b98f31..55cb2da 100644 --- a/graph.py +++ b/graph.py @@ -326,8 +326,8 @@ def graph(session, fname='plot'): space = 3 g("set yrange [0:100]") - g("set object rectangle from graph 0, graph 0 to graph 2, graph 2 behind fillcolor rgb '#111111' fillstyle solid noborder") - g(f"set object rectangle from '{START_DATE.replace(' ', '-')}', 0 to '{END_DATE.replace(' ', '-')}', 100 behind fillcolor rgb '#000000' fillstyle solid noborder") + g("set object rectangle from graph 0, graph 0 to graph 2, graph 2 behind fillcolor rgb '#000000' fillstyle solid noborder") + #g(f"set object rectangle from '{START_DATE.replace(' ', '-')}', 0 to '{END_DATE.replace(' ', '-')}', 100 behind fillcolor rgb '#000000' fillstyle solid noborder") plot("cpu % load (user)", f"cpu load (average = {AVERAGE_LOAD:.2f} %)", session, 2, space=space) @@ -335,6 +335,8 @@ def graph(session, fname='plot'): f"ram usage (max = {MAX_USED_RAM})", session, 3, space=space) plot(f"{NAME_FS}", f"{NAME_FS} usage (max = {MAX_USED_FS})", session, 4, space=space) + + g("set yrange [:*]") plot(f"{NAME_IFACE} received", f"{NAME_IFACE} data received (max = {MAX_RX})", session, 5, space=space) plot(f"{NAME_IFACE} sent", f"{NAME_IFACE} data sent (max = {MAX_TX})",