diff options
author | Daniel Friesel <daniel.friesel@uos.de> | 2020-10-29 14:01:21 +0100 |
---|---|---|
committer | Daniel Friesel <daniel.friesel@uos.de> | 2020-10-29 14:01:21 +0100 |
commit | 48e34b2dbde909cad61f618b2ea8a2ea286012af (patch) | |
tree | 90cd9ece29df245bc9268438871975bf6cd6dd31 /lib | |
parent | 506a49fd49e028055378af2e35d6022e6bb99b9c (diff) |
EnergyTraceWithTimer: Gracefully handle errors in a single measurement run
Diffstat (limited to 'lib')
-rw-r--r-- | lib/loader.py | 13 |
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) |