graphing errors over time
This commit is contained in:
+20
-11
@@ -295,7 +295,7 @@ def run_load_with_metrics(num_requests: int,
|
|||||||
# Latency histogram (total)
|
# Latency histogram (total)
|
||||||
ax1 = axes[0, 1]
|
ax1 = axes[0, 1]
|
||||||
if succ:
|
if succ:
|
||||||
ax1.hist(total_ms, bins=30, color="#4e79a7")
|
ax1.hist(total_ms, bins=30)
|
||||||
ax1.set_title("Total latency (ms)")
|
ax1.set_title("Total latency (ms)")
|
||||||
ax1.set_xlabel("ms")
|
ax1.set_xlabel("ms")
|
||||||
ax1.set_ylabel("freq")
|
ax1.set_ylabel("freq")
|
||||||
@@ -321,7 +321,7 @@ def run_load_with_metrics(num_requests: int,
|
|||||||
ax_idle.plot(ts, vals, "-o", ms=3)
|
ax_idle.plot(ts, vals, "-o", ms=3)
|
||||||
ax_idle.set_title("Completions per second")
|
ax_idle.set_title("Completions per second")
|
||||||
ax_idle.set_xlabel("time (s)")
|
ax_idle.set_xlabel("time (s)")
|
||||||
ax_idle.set_ylabel("req/s")
|
ax_idle.set_ylabel("completions / sec")
|
||||||
|
|
||||||
# Summary text
|
# Summary text
|
||||||
ax3 = axes[1, 1]
|
ax3 = axes[1, 1]
|
||||||
@@ -341,15 +341,24 @@ def run_load_with_metrics(num_requests: int,
|
|||||||
ax3.set_title("Summary")
|
ax3.set_title("Summary")
|
||||||
ax3.text(0.02, 0.98, text, va="top", ha="left", fontsize=11, transform=ax3.transAxes)
|
ax3.text(0.02, 0.98, text, va="top", ha="left", fontsize=11, transform=ax3.transAxes)
|
||||||
|
|
||||||
# Latency CDF (total_ms)
|
# Error count over time
|
||||||
ax_cdf = axes[1, 2]
|
ax_errors = axes[1, 2]
|
||||||
if succ:
|
all_end_times = [int(r.t_end) for r in results if r.t_end > 0]
|
||||||
x = np.sort(total_ms)
|
if all_end_times:
|
||||||
y = np.linspace(0, 1, len(x), endpoint=True)
|
min_second = min(all_end_times)
|
||||||
ax_cdf.plot(x, y)
|
max_second = max(all_end_times)
|
||||||
ax_cdf.set_title("Latency CDF")
|
# Count errors per second
|
||||||
ax_cdf.set_xlabel("ms")
|
errors_per_second = {}
|
||||||
ax_cdf.set_ylabel("fraction ≤ x")
|
for result in errs:
|
||||||
|
second = int(result.t_end)
|
||||||
|
errors_per_second[second] = errors_per_second.get(second, 0) + 1
|
||||||
|
# Create complete timeline including zeros
|
||||||
|
time_seconds = list(range(min_second, max_second + 1))
|
||||||
|
error_counts = [errors_per_second.get(sec, 0) for sec in time_seconds]
|
||||||
|
ax_errors.plot(time_seconds, error_counts, "-o", ms=3)
|
||||||
|
ax_errors.set_title("Errors per second")
|
||||||
|
ax_errors.set_xlabel("time (s)")
|
||||||
|
ax_errors.set_ylabel("errors / sec")
|
||||||
|
|
||||||
# Ensure unique output path and create directory if needed
|
# Ensure unique output path and create directory if needed
|
||||||
final_out_path = get_incremented_path(out_path)
|
final_out_path = get_incremented_path(out_path)
|
||||||
|
|||||||
Reference in New Issue
Block a user