summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArthur She <arthur.she@linaro.org>2023-03-18 21:17:26 -0700
committerArthur She <arthur.she@linaro.org>2023-03-18 21:17:26 -0700
commitd1842597a367e85dca6ba9c1afeba86f5a554934 (patch)
tree0e192b87c553b5c1c7a3386b8ff49434911e4454
parente8e2a803b93c8f16beb00cb890dc6ff2b889ab82 (diff)
draw-timestamp-chart.py: draw main task inner color
Signed-off-by: Arthur She <arthur.she@linaro.org>
-rwxr-xr-xdraw-timestamp-chart.py20
1 files changed, 15 insertions, 5 deletions
diff --git a/draw-timestamp-chart.py b/draw-timestamp-chart.py
index aa5dbc4..ef253e9 100755
--- a/draw-timestamp-chart.py
+++ b/draw-timestamp-chart.py
@@ -15,7 +15,8 @@ colors = {"main": {"backgroundColor": {"red": 1, "green": 0, "
"container-host-C": {"backgroundColor": {"red": 0, "green": 1, "blue": 1}},
"container-host-D": {"backgroundColor": {"red": 0.85, "green": 0.82, "blue": 0.91}},
"freebsd": {"backgroundColor": {"red": 0.8, "green": 0.25, "blue": 0.15}},
- "dockerfile-builder": {"backgroundColor": {"red": 0.27, "green": 0.5, "blue": 0.55}}}
+ "dockerfile-builder": {"backgroundColor": {"red": 0.27, "green": 0.5, "blue": 0.55}},
+ "helper-container-host": {"backgroundColor": {"red": 0.27, "green": 0.5, "blue": 0.55}}}
inner_colors = {"main": {"backgroundColor": {"red": 0.63, "green": 0.77, "blue": 0.79}},
"windows": {"backgroundColor": {"red": 1, "green": 0.6, "blue": 0}},
@@ -25,10 +26,13 @@ inner_colors = {"main": {"backgroundColor": {"red": 0.63, "green":
"container-host-C": {"backgroundColor": {"red": 1, "green": 0, "blue": 1}},
"container-host-D": {"backgroundColor": {"red": 1, "green": 0, "blue": 1}},
"freebsd": {"backgroundColor": {"red": 0, "green": 1, "blue": 1}},
- "dockerfile-builder": {"backgroundColor": {"red": 0.27, "green": 0.5, "blue": 0.55}}}
+ "dockerfile-builder": {"backgroundColor": {"red": 0.27, "green": 0.5, "blue": 0.55}},
+ "helper-container-host": {"backgroundColor": {"red": 0.27, "green": 0.5, "blue": 0.55}}}
subtask_mapping = {"windows": "Windows",
"container-host": "Linux",
+ "container-host-A": "Linux-A",
+ "container-host-B": "Linux-B",
"freebsd": "FreeBSD"}
min_block = 3 # Minute per block
@@ -166,7 +170,12 @@ if __name__ == "__main__":
num_blk = round(duration / ms_block)
start_blk = 2
a1_notation = get_a1_notation_range(1, start_blk, num_blk)
- worksheet.format(a1_notation, colors["main"])
+ row_formats.append({"range": a1_notation, "format": colors["main"]})
+ if (main_group[main_task]["innerStart"] != -1):
+ first_blk = start_blk + round((main_group[main_task]["innerStart"] - main_start_timestamp)/ms_block)
+ num_blk = round((main_group[main_task]["innerEnd"] - main_group[main_task]["innerStart"])/ms_block)
+ a1_notation = get_a1_notation_range(1, first_blk, num_blk)
+ row_formats.append({"range": a1_notation, "format": inner_colors["main"]})
# Subtasks
subtasks = td["subtasks"]
row_num = 2
@@ -174,6 +183,8 @@ if __name__ == "__main__":
st_duration = {}
for i in subtasks:
subtask = subtasks[i]
+ if (i == 'main'):
+ continue
# Sort the tests
tests = {k: subtask[k] for k in sorted(subtask)}
s_start = end_timestamp
@@ -193,8 +204,7 @@ if __name__ == "__main__":
first_blk = start_blk + round((test[start] - main_start_timestamp)/ms_block)
num_blk = round((test[end] - test[start]) / ms_block)
a1_notation = get_a1_notation_range(row_num, first_blk, num_blk)
- row_format = {"range": a1_notation, "format": color[i]}
- row_formats.append(row_format)
+ row_formats.append({"range": a1_notation, "format": color[i]})
row_num += 1
st_duration[i] = {"start": s_start, "end": s_end, "duration": ms_to_hr_min(s_end - s_start)}