summaryrefslogtreecommitdiff
path: root/nemesis/html_gen.py
diff options
context:
space:
mode:
authorbd <bdunahu@operationnull.com>2025-10-11 14:05:13 -0400
committerbd <bdunahu@operationnull.com>2025-10-11 14:05:13 -0400
commit16aa392a3c08c8769cc30bdbc1830a31f9b0808e (patch)
tree1f95e02add06a137b2bb7e2ff38a1ef1976e0084 /nemesis/html_gen.py
parent5f90a5d7ebfa210ddac031ba4ddaeedb3d041cb3 (diff)
try blacklisting _read_from_self from results
Still determining the reason _read_from_self has an abnormally large average callback and biases the results.
Diffstat (limited to 'nemesis/html_gen.py')
-rw-r--r--nemesis/html_gen.py23
1 files changed, 18 insertions, 5 deletions
diff --git a/nemesis/html_gen.py b/nemesis/html_gen.py
index 841fbbc..60d0c06 100644
--- a/nemesis/html_gen.py
+++ b/nemesis/html_gen.py
@@ -7,7 +7,7 @@ def get_color(name):
color_index = int(hash_object.hexdigest(), 16) % 360
return f'hsl({color_index}, 100%, 50%)'
-def plot_results(results, filename):
+def plot_results(results, output_file, input_file):
fig = make_subplots(rows=4, cols=1)
for i, (coro_name, x_values) in enumerate(results.items(), start=1):
@@ -16,6 +16,8 @@ def plot_results(results, filename):
y_throughput_list = []
y_max_latency_list = []
y_num_callbacks_list = []
+ latency_hover_text = []
+ max_latency_hover_text = []
for speedup, experiments in x_values.items():
for experiment in experiments:
@@ -29,16 +31,24 @@ def plot_results(results, filename):
y_num_callbacks_list.append(num_callbacks)
# handle average latency graph
+
if num_callbacks > 0:
+ breakdown = "<br>".join([f" {cb[0]}: {round(cb[1], 4)}" for cb in completed_callbacks])
total_wait = sum([cb[1] for cb in completed_callbacks])
- max_wait = max([cb[1] for cb in completed_callbacks])
+ max_cb = max(completed_callbacks, key=lambda cb: cb[1])
+
latency = total_wait / num_callbacks
- y_max_latency_list.append(max_wait)
+ y_max_latency_list.append(max_cb[1])
y_latency_list.append(latency)
+
else:
- y_latency_list.append(0)
+ latency = 0
+ y_latency_list.append(latency)
+
+ latency_hover_text.append(f"{coro_name}<br>Speedup: {speedup}<br>Average Wait: {round(latency, 4)}<br>Breakdown:<br>{breakdown}")
+ max_latency_hover_text.append(f"{coro_name}<br>Speedup: {speedup}<br>Max Wait: {round(max_cb[1], 4)}<br>Handle: {max_cb[0]}")
# handle throughput graph
throughput = num_callbacks / virtual_run_time
@@ -50,6 +60,7 @@ def plot_results(results, filename):
mode='markers',
name=coro_name,
marker=dict(color=get_color(coro_name)),
+ hovertext=latency_hover_text,
showlegend=True,
), row=1, col=1)
@@ -68,6 +79,7 @@ def plot_results(results, filename):
mode='markers',
name=coro_name,
marker=dict(color=get_color(coro_name)),
+ hovertext=max_latency_hover_text,
showlegend=False,
), row=3, col=1)
@@ -80,10 +92,11 @@ def plot_results(results, filename):
showlegend=False,
), row=4, col=1)
+ fig.update_layout(title=input_file)
fig.update_xaxes(title_text="speedup (% optimized away)", row=4, col=1)
fig.update_yaxes(title_text="average latency (seconds)", row=1, col=1)
fig.update_yaxes(title_text="throughput (handles per second)", row=2, col=1)
fig.update_yaxes(title_text="maximum latency (seconds)", row=3, col=1)
fig.update_yaxes(title_text="# of callbacks", row=4, col=1)
- fig.write_html(filename)
+ fig.write_html(output_file)