diff --git a/misc/python/materialize/scalability/comparison_outcome.py b/misc/python/materialize/scalability/comparison_outcome.py index 2b88fc1fbd43..b135fe0b43d9 100644 --- a/misc/python/materialize/scalability/comparison_outcome.py +++ b/misc/python/materialize/scalability/comparison_outcome.py @@ -41,6 +41,9 @@ def has_significant_improvements(self) -> bool: ) return len(self.significant_improvements) > 0 + def has_scalability_changes(self) -> bool: + return self.has_regressions() or self.has_significant_improvements() + def __str__(self) -> str: return f"{len(self.regressions)} regressions, {len(self.significant_improvements)} significant improvements" @@ -60,17 +63,31 @@ def _to_description(self, entries: Sequence[ScalabilityChange]) -> str: return "\n".join(f"* {x}" for x in entries) def merge(self, other: ComparisonOutcome) -> None: - self.regressions.extend(other.regressions) - self.significant_improvements.extend(other.significant_improvements) - self.append_regression_df(other.regression_df) - self.append_significant_improvement_df(other.significant_improvement_df) + self.append_regressions( + other.regressions, + other.significant_improvements, + other.regression_df, + other.significant_improvement_df, + ) + + def append_regressions( + self, + regressions: list[Regression], + significant_improvements: list[ScalabilityImprovement], + regression_df: DfTotalsExtended, + significant_improvement_df: DfTotalsExtended, + ) -> None: + self.regressions.extend(regressions) + self.significant_improvements.extend(significant_improvements) + self._append_regression_df(regression_df) + self._append_significant_improvement_df(significant_improvement_df) - def append_regression_df(self, regressions_data: DfTotalsExtended) -> None: + def _append_regression_df(self, regressions_data: DfTotalsExtended) -> None: self.regression_df = concat_df_totals_extended( [self.regression_df, regressions_data] ) - def append_significant_improvement_df( + def _append_significant_improvement_df( self, significant_improvements_data: DfTotalsExtended ) -> None: self.significant_improvement_df = concat_df_totals_extended( diff --git a/misc/python/materialize/scalability/result_analyzers.py b/misc/python/materialize/scalability/result_analyzers.py index 6f9b1c2dd34b..1495e377017f 100644 --- a/misc/python/materialize/scalability/result_analyzers.py +++ b/misc/python/materialize/scalability/result_analyzers.py @@ -60,10 +60,10 @@ def perform_comparison_in_workload( workload_name, other_endpoint, ) - comparison_outcome.regressions.extend(regressions) - comparison_outcome.significant_improvements.extend(improvements) - comparison_outcome.append_regression_df(entries_worse_than_threshold) - comparison_outcome.append_significant_improvement_df( - entries_better_than_threshold + comparison_outcome.append_regressions( + regressions, + improvements, + entries_worse_than_threshold, + entries_better_than_threshold, ) return comparison_outcome diff --git a/test/scalability/mzcompose.py b/test/scalability/mzcompose.py index 62d6962cdc8b..a11ff26cdbed 100644 --- a/test/scalability/mzcompose.py +++ b/test/scalability/mzcompose.py @@ -302,7 +302,7 @@ def report_regression_result( baseline_desc = endpoint_name_to_description(baseline_endpoint.try_load_version()) - if outcome.has_regressions() or outcome.has_significant_improvements(): + if outcome.has_scalability_changes(): print( f"{'ERROR' if outcome.has_regressions() else 'INFO'}: " f"The following scalability changes were detected "