From 19090bdd5b2ca8ff2dd0f8524d746a06638bf687 Mon Sep 17 00:00:00 2001 From: Kevin O'Connor Date: Fri, 21 Jul 2017 14:19:59 -0400 Subject: [PATCH] graphstats: Fix so that older files (predating mcu_awake) still work Signed-off-by: Kevin O'Connor --- scripts/graphstats.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/graphstats.py b/scripts/graphstats.py index edb67624..ca31ecda 100755 --- a/scripts/graphstats.py +++ b/scripts/graphstats.py @@ -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