Skip to content

Commit 2c5003a

Browse files
Better graphing for performance
1 parent 21bf0f3 commit 2c5003a

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

cli/tests/pcluster/validators/test_s3_validators_local.py

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -219,12 +219,21 @@ def _get_statistics_by_node_nume(
219219
def plot_statistics(result, statistics_name):
220220
plt.figure(figsize=(12, 6))
221221

222-
# Create x-axis values (assuming each point represents a day)
222+
# Collect all unique timestamps and sort them
223+
all_timestamps = set()
224+
for category in result:
225+
if "-time" in category:
226+
all_timestamps.update(result[category])
227+
sorted_timestamps = sorted(all_timestamps)
228+
229+
# Plot each category using the global sorted timestamps
223230
for category, values in result.items():
224231
if "-time" in category:
225232
continue
226233
x_values = result[f"{category}-time"]
227-
plt.plot(x_values, values, marker='o', label=category)
234+
time_to_value = dict(zip(x_values, values))
235+
sorted_values = [time_to_value.get(t) for t in sorted_timestamps]
236+
plt.plot(sorted_timestamps, sorted_values, marker='o', label=category)
228237

229238
plt.title(statistics_name)
230239
plt.xlabel('Latest timestamp')

0 commit comments

Comments
 (0)