Skip to content

Commit

Permalink
sort and plot
Browse files Browse the repository at this point in the history
  • Loading branch information
waveywaves committed Mar 29, 2024
1 parent 72e26d5 commit 944e47e
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions hack/e2e/perf/viz/generate_graph.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,22 @@
workers_main = [item['workers'] for item in data_main]
time_main = [item['time'] for item in data_main]

# Sort the data by workers to ensure correct plotting order
sorted_pr = sorted(zip(workers_pr, time_pr), key=lambda x: x[0])
sorted_main = sorted(zip(workers_main, time_main), key=lambda x: x[0])

# Unzip the sorted data
workers_pr_sorted, time_pr_sorted = zip(*sorted_pr)
workers_main_sorted, time_main_sorted = zip(*sorted_main)

# Create a plot
plt.figure(figsize=(10, 6))

# Plot data from 'perf-data-PR.json'
plt.plot(workers_pr, time_pr, marker='o', linestyle='-', label='PR Branch')
# Plot sorted data from 'perf-data-PR.json'
plt.plot(workers_pr_sorted, time_pr_sorted, marker='o', linestyle='-', label='PR Branch')

# Plot data from 'perf-data-main.json'
plt.plot(workers_main, time_main, marker='x', linestyle='--', label='Main Branch')
# Plot sorted data from 'perf-data-main.json'
plt.plot(workers_main_sorted, time_main_sorted, marker='x', linestyle='--', label='Main Branch')

# Add title, labels, grid, and legend
plt.title('Time Taken by UffizziClusters with Varying Workers')
Expand Down

0 comments on commit 944e47e

Please sign in to comment.