graphstats: Fix so that older files (predating mcu_awake) still work

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
This commit is contained in:
Kevin O'Connor 2017-07-21 14:19:59 -04:00
parent 4a6254fac3
commit 19090bdd5b
1 changed files with 1 additions and 1 deletions

View File

@ -81,7 +81,7 @@ def plot_mcu(data, maxbw, outname, graph_awake=False):
times.append(datetime.datetime.utcfromtimestamp(st))
bwdeltas.append(100. * (bw - lastbw) / (maxbw * timedelta))
loads.append(100. * load / .001)
awake.append(100. * float(d['mcu_awake']) / STATS_INTERVAL)
awake.append(100. * float(d.get('mcu_awake', 0.)) / STATS_INTERVAL)
lasttime = st
lastbw = bw