aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKevin O'Connor <kevin@koconnor.net>2016-12-06 11:10:52 -0500
committerKevin O'Connor <kevin@koconnor.net>2016-12-06 11:10:52 -0500
commit12d4888321bdf44e2a6912b1c58188e748d99a9d (patch)
treed2f6775b73ac65bdb963cc3439a5b55d6030c1ba
parent4565a73e91b4beef08e76b2d23c58529f8203a91 (diff)
downloadkutter-12d4888321bdf44e2a6912b1c58188e748d99a9d.tar.gz
kutter-12d4888321bdf44e2a6912b1c58188e748d99a9d.tar.xz
kutter-12d4888321bdf44e2a6912b1c58188e748d99a9d.zip
graphstats: Updates for recent stats changes
Update the graphstats helper script to account for recent changes in the statistics output. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
-rwxr-xr-xscripts/graphstats.py9
1 files changed, 7 insertions, 2 deletions
diff --git a/scripts/graphstats.py b/scripts/graphstats.py
index 7fa1e901..64ef37e9 100755
--- a/scripts/graphstats.py
+++ b/scripts/graphstats.py
@@ -15,11 +15,13 @@ def parse_log(logname):
out = []
for line in f:
parts = line.split()
- if not parts or parts[0] != 'INFO:root:Stats':
+ if not parts or parts[0] not in ('Stats', 'INFO:root:Stats'):
#if parts and parts[0] == 'INFO:root:shutdown:':
# break
continue
keyparts = dict(p.split('=', 1) for p in parts[2:])
+ if keyparts.get('bytes_write', '0') == '0':
+ continue
keyparts['#sampletime'] = float(parts[1][:-1])
out.append(keyparts)
f.close()
@@ -39,6 +41,9 @@ def plot_mcu(data, maxbw, outname):
if timedelta <= 0.:
continue
bw = float(d['bytes_write']) + float(d['bytes_retransmit'])
+ if bw < lastbw:
+ lastbw = bw
+ continue
load = float(d['mcu_task_avg']) + 3*float(d['mcu_task_stddev'])
if st - basetime < 15.:
load = 0.
@@ -60,8 +65,8 @@ def plot_mcu(data, maxbw, outname):
ax1.set_title("MCU bandwidth and load utilization")
ax1.set_xlabel('Time (UTC)')
ax1.set_ylabel('Usage (%)')
- ax1.plot_date(times, loads, 'r', label='MCU load')
ax1.plot_date(times, bwdeltas, 'g', label='Bandwidth')
+ ax1.plot_date(times, loads, 'r', label='MCU load')
#ax1.plot_date(times, hostbuffers, 'c', label='Host buffer')
ax1.legend()
ax1.xaxis.set_major_formatter(mdates.DateFormatter('%H:%M'))