summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArthur She <arthur.she@linaro.org>2023-03-17 10:11:38 -0700
committerArthur She <arthur.she@linaro.org>2023-03-17 10:11:38 -0700
commite8e2a803b93c8f16beb00cb890dc6ff2b889ab82 (patch)
tree861aa9172bb196ee29c3995595134704cae58383
parentdb69aa34cc891c4e7b2f19ef3ec1ffa9ca8d106d (diff)
draw-timestamp-chart.py: Handle version 1 timestamp files
From Bence This version of the timestamps moves the "main" dictionary into the "subtasks" dictionary. Signed-off-by: Arthur She <arthur.she@linaro.org>
-rwxr-xr-xdraw-timestamp-chart.py12
1 files changed, 8 insertions, 4 deletions
diff --git a/draw-timestamp-chart.py b/draw-timestamp-chart.py
index c5068e5..aa5dbc4 100755
--- a/draw-timestamp-chart.py
+++ b/draw-timestamp-chart.py
@@ -153,9 +153,13 @@ if __name__ == "__main__":
worksheet = create_worksheet(spreadsheet, job_name)
# Draw main task
- main_task = list(td["main"].keys())[0]
- main_start_timestamp = td["main"][main_task]["start"]
- end_timestamp = td["main"][main_task]["end"]
+ if td.get("version", 0) == 0:
+ main_group = td["main"]
+ else:
+ main_group = td["subtasks"]["main"]
+ main_task = list(main_group.keys())[0]
+ main_start_timestamp = main_group[main_task]["start"]
+ end_timestamp = main_group[main_task]["end"]
duration = end_timestamp - main_start_timestamp
new_row = [f"{main_task}\n(Total: {ms_to_hr_min(duration)}"]
updated_row = worksheet.append_row(new_row)
@@ -194,7 +198,7 @@ if __name__ == "__main__":
row_num += 1
st_duration[i] = {"start": s_start, "end": s_end, "duration": ms_to_hr_min(s_end - s_start)}
- print(st_duration)
+# print(st_duration)
main_str = worksheet.get("A1")[0][0]
for i in st_duration:
if i in subtask_mapping: