summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Friesel <daniel.friesel@uos.de>2020-10-29 14:01:21 +0100
committerDaniel Friesel <daniel.friesel@uos.de>2020-10-29 14:01:21 +0100
commit48e34b2dbde909cad61f618b2ea8a2ea286012af (patch)
tree90cd9ece29df245bc9268438871975bf6cd6dd31
parent506a49fd49e028055378af2e35d6022e6bb99b9c (diff)
EnergyTraceWithTimer: Gracefully handle errors in a single measurement run
-rw-r--r--lib/loader.py13
1 files changed, 10 insertions, 3 deletions
diff --git a/lib/loader.py b/lib/loader.py
index a319c94..8aecbe0 100644
--- a/lib/loader.py
+++ b/lib/loader.py
@@ -1789,9 +1789,16 @@ class EnergyTraceWithTimer(EnergyTraceWithLogicAnalyzer):
for tr in traces:
for t in tr["trace"]:
# print(t["online_aggregates"]["duration"][offline_index])
- timestamps.append(
- timestamps[-1] + t["online_aggregates"]["duration"][offline_index]
- )
+ try:
+ timestamps.append(
+ timestamps[-1]
+ + t["online_aggregates"]["duration"][offline_index]
+ )
+ except IndexError:
+ self.errors.append(
+ f"""offline_index {offline_index} missing in trace {tr["id"]}"""
+ )
+ return list()
# print(timestamps)