aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/graphstats.py
diff options
context:
space:
mode:
authorKevin O'Connor <kevin@koconnor.net>2017-10-29 20:30:36 -0400
committerKevin O'Connor <kevin@koconnor.net>2017-10-29 20:36:33 -0400
commit8463a833245938a2d5fc20d0d06e28a15f2c1a1c (patch)
tree78d6c4412950d1bf67e5440609e781c55e14081d /scripts/graphstats.py
parentfc0e016a6dc2e87c72ec19eed077818ca31532ed (diff)
downloadkutter-8463a833245938a2d5fc20d0d06e28a15f2c1a1c.tar.gz
kutter-8463a833245938a2d5fc20d0d06e28a15f2c1a1c.tar.xz
kutter-8463a833245938a2d5fc20d0d06e28a15f2c1a1c.zip
graphstats: Fix graphing script
Update the graphstats.py graphing script so that it works with recent stats changes - the stats can now contain groups that end with a ':' and the print_time is no longer reset to zero on a new print. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Diffstat (limited to 'scripts/graphstats.py')
-rwxr-xr-xscripts/graphstats.py10
1 files changed, 6 insertions, 4 deletions
diff --git a/scripts/graphstats.py b/scripts/graphstats.py
index 3cb79cb2..d037983a 100755
--- a/scripts/graphstats.py
+++ b/scripts/graphstats.py
@@ -21,7 +21,8 @@ def parse_log(logname):
#if parts and parts[0] == 'INFO:root:shutdown:':
# break
continue
- keyparts = dict(p.split('=', 1) for p in parts[2:])
+ keyparts = dict(p.split('=', 1)
+ for p in parts[2:] if not p.endswith(':'))
if keyparts.get('bytes_write', '0') == '0':
continue
keyparts['#sampletime'] = float(parts[1][:-1])
@@ -34,10 +35,11 @@ def find_print_restarts(data):
print_resets = []
for d in data:
print_time = float(d.get('print_time', last_print_time))
- if print_time < last_print_time:
+ buffer_time = float(d.get('buffer_time', 0.))
+ if print_time == last_print_time and not buffer_time:
print_resets.append(d['#sampletime'])
last_print_time = 0.
- else:
+ elif buffer_time:
last_print_time = print_time
sample_resets = {}
for d in data:
@@ -74,7 +76,7 @@ def plot_mcu(data, maxbw, outname, graph_awake=False):
load = 0.
pt = float(d['print_time'])
hb = float(d['buffer_time'])
- if pt <= 2. * MAXBUFFER or hb >= MAXBUFFER or st in sample_resets:
+ if not hb or hb >= MAXBUFFER or st in sample_resets:
hb = 0.
else:
hb = 100. * (MAXBUFFER - hb) / MAXBUFFER