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>
This commit is contained in:
parent
4565a73e91
commit
12d4888321
|
@ -15,11 +15,13 @@ def parse_log(logname):
|
||||||
out = []
|
out = []
|
||||||
for line in f:
|
for line in f:
|
||||||
parts = line.split()
|
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:':
|
#if parts and parts[0] == 'INFO:root:shutdown:':
|
||||||
# break
|
# break
|
||||||
continue
|
continue
|
||||||
keyparts = dict(p.split('=', 1) for p in parts[2:])
|
keyparts = dict(p.split('=', 1) for p in parts[2:])
|
||||||
|
if keyparts.get('bytes_write', '0') == '0':
|
||||||
|
continue
|
||||||
keyparts['#sampletime'] = float(parts[1][:-1])
|
keyparts['#sampletime'] = float(parts[1][:-1])
|
||||||
out.append(keyparts)
|
out.append(keyparts)
|
||||||
f.close()
|
f.close()
|
||||||
|
@ -39,6 +41,9 @@ def plot_mcu(data, maxbw, outname):
|
||||||
if timedelta <= 0.:
|
if timedelta <= 0.:
|
||||||
continue
|
continue
|
||||||
bw = float(d['bytes_write']) + float(d['bytes_retransmit'])
|
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'])
|
load = float(d['mcu_task_avg']) + 3*float(d['mcu_task_stddev'])
|
||||||
if st - basetime < 15.:
|
if st - basetime < 15.:
|
||||||
load = 0.
|
load = 0.
|
||||||
|
@ -60,8 +65,8 @@ def plot_mcu(data, maxbw, outname):
|
||||||
ax1.set_title("MCU bandwidth and load utilization")
|
ax1.set_title("MCU bandwidth and load utilization")
|
||||||
ax1.set_xlabel('Time (UTC)')
|
ax1.set_xlabel('Time (UTC)')
|
||||||
ax1.set_ylabel('Usage (%)')
|
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, bwdeltas, 'g', label='Bandwidth')
|
||||||
|
ax1.plot_date(times, loads, 'r', label='MCU load')
|
||||||
#ax1.plot_date(times, hostbuffers, 'c', label='Host buffer')
|
#ax1.plot_date(times, hostbuffers, 'c', label='Host buffer')
|
||||||
ax1.legend()
|
ax1.legend()
|
||||||
ax1.xaxis.set_major_formatter(mdates.DateFormatter('%H:%M'))
|
ax1.xaxis.set_major_formatter(mdates.DateFormatter('%H:%M'))
|
||||||
|
|
Loading…
Reference in New Issue