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

Add field lower_is_better to the perfcompare endpoint #7852

Merged
merged 1 commit into from
Oct 25, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions tests/webapp/api/test_perfcompare_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,7 @@ def test_perfcompare_results_against_no_base(
'delta_percentage': round(response['delta_pct'], 2),
'magnitude': round(response['magnitude'], 2),
'new_is_better': response['new_is_better'],
'lower_is_better': response['lower_is_better'],
'is_confident': response['is_confident'],
'more_runs_are_needed': response['more_runs_are_needed'],
'noise_metric': False,
Expand Down Expand Up @@ -293,6 +294,7 @@ def test_perfcompare_results_with_only_one_run_and_diff_repo(
'delta_percentage': round(response['delta_pct'], 2),
'magnitude': round(response['magnitude'], 2),
'new_is_better': response['new_is_better'],
'lower_is_better': response['lower_is_better'],
'is_confident': response['is_confident'],
'more_runs_are_needed': response['more_runs_are_needed'],
'noise_metric': False,
Expand Down Expand Up @@ -451,6 +453,7 @@ def test_perfcompare_results_multiple_runs(
'delta_percentage': round(first_row['delta_pct'], 2),
'magnitude': round(first_row['magnitude'], 2),
'new_is_better': first_row['new_is_better'],
'lower_is_better': first_row['lower_is_better'],
'is_confident': first_row['is_confident'],
'more_runs_are_needed': first_row['more_runs_are_needed'],
'noise_metric': False,
Expand Down Expand Up @@ -497,6 +500,7 @@ def test_perfcompare_results_multiple_runs(
'delta_percentage': round(second_row['delta_pct'], 2),
'magnitude': round(second_row['magnitude'], 2),
'new_is_better': second_row['new_is_better'],
'lower_is_better': second_row['lower_is_better'],
'is_confident': second_row['is_confident'],
'more_runs_are_needed': second_row['more_runs_are_needed'],
'noise_metric': False,
Expand Down Expand Up @@ -620,6 +624,7 @@ def get_expected(
response['new_is_better'] = perfcompare_utils.is_new_better(
response['delta_value'], base_sig.lower_is_better
)
response['lower_is_better'] = base_sig.lower_is_better
response['confidence'] = perfcompare_utils.get_abs_ttest_value(
base_perf_data_values, new_perf_data_values
)
Expand Down
1 change: 1 addition & 0 deletions treeherder/webapp/api/performance_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -964,6 +964,7 @@ def list(self, request):
'delta_percentage': delta_percentage,
'magnitude': magnitude,
'new_is_better': new_is_better,
'lower_is_better': lower_is_better,
'is_confident': is_confident,
'more_runs_are_needed': more_runs_are_needed,
# highlighted revisions is the base_revision and the other highlighted revisions is new_revision
Expand Down
2 changes: 2 additions & 0 deletions treeherder/webapp/api/performance_serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -524,6 +524,7 @@ class PerfCompareResultsSerializer(serializers.ModelSerializer):
delta_percentage = PerfCompareDecimalField()
magnitude = PerfCompareDecimalField()
new_is_better = OptionalBooleanField()
lower_is_better = OptionalBooleanField()
is_confident = OptionalBooleanField()
more_runs_are_needed = OptionalBooleanField()
noise_metric = OptionalBooleanField(default=False)
Expand Down Expand Up @@ -571,6 +572,7 @@ class Meta:
'delta_percentage',
'magnitude',
'new_is_better',
'lower_is_better',
'is_confident',
'more_runs_are_needed',
'noise_metric',
Expand Down