Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change min/max to overall_min/overall_max + update comparison results publisher #692

Merged
merged 3 commits into from
Nov 15, 2024

Conversation

OVI3D0
Copy link
Member

@OVI3D0 OVI3D0 commented Nov 13, 2024

Description

This change updates min/max values in aggregated test results, to reflect the overall min/max values across all test executions, rather than just the average of each. The names of these values have also been prefixed with overall_ in order to reflect these changes. Changes were also made to the ComparisonResultsPublisher class, so these values can still be read if used in a compare command. Tests were also updated to reflect the recent changes to the aggregator class, and also to test the ComparisonResultsPublisher class.

Issues Resolved

#684

Testing

  • New functionality includes testing

make test


By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.

@@ -193,24 +193,27 @@ def build_aggregated_results(self):

def calculate_weighted_average(self, task_metrics: Dict[str, List[Any]], iterations: int) -> Dict[str, Any]:
weighted_metrics = {}
num_executions = len(next(iter(task_metrics.values())))
total_iterations = iterations * num_executions
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To clarify, iterations is the number of iterations that the user inputted in workload params / default number of times a task is run in a workload? Not the number of times we executed the same test?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's correct!


for metric, values in task_metrics.items():
if isinstance(values[0], dict):
weighted_metrics[metric] = {}
for item_key in values[0].keys():
if item_key == 'unit':
weighted_metrics[metric][item_key] = values[0][item_key]
elif item_key == 'min':
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: We can improve the readability of this section by renaming item_key to something like metric_field

else:
# for items like median or percentile values
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For fields like median or containing percentile values

Copy link
Collaborator

@IanHoang IanHoang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM but suggested some quick fixes

@OVI3D0 OVI3D0 merged commit 2d14ed4 into opensearch-project:main Nov 15, 2024
10 checks passed
@OVI3D0 OVI3D0 deleted the adjust-metrics branch November 15, 2024 22:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants