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

Added version+target to the compare tool. we now have by branch, by version, and by target+version #261

Merged
merged 2 commits into from
Aug 13, 2024
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
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "redis-benchmarks-specification"
version = "0.1.214"
version = "0.1.215"
description = "The Redis benchmarks specification describes the cross-language/tools requirements and expectations to foster performance and observability standards around redis related technologies. Members from both industry and academia, including organizations and individuals are encouraged to contribute."
authors = ["filipecosta90 <[email protected]>","Redis Performance Group <[email protected]>"]
readme = "Readme.md"
Expand Down
6 changes: 6 additions & 0 deletions redis_benchmarks_specification/__compare__/args.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,14 @@ def create_compare_arguments(parser):
)
parser.add_argument("--baseline-branch", type=str, default=None, required=False)
parser.add_argument("--baseline-tag", type=str, default=None, required=False)
parser.add_argument(
"--baseline-target-version", type=str, default=None, required=False
)
parser.add_argument("--comparison-branch", type=str, default=None, required=False)
parser.add_argument("--comparison-tag", type=str, default=None, required=False)
parser.add_argument(
"--comparison-target-version", type=str, default=None, required=False
)
parser.add_argument("--print-regressions-only", type=bool, default=False)
parser.add_argument("--print-improvements-only", type=bool, default=False)
parser.add_argument("--skip-unstable", type=bool, default=False)
Expand Down
38 changes: 36 additions & 2 deletions redis_benchmarks_specification/__compare__/compare.py
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,8 @@ def compare_command_logic(args, project_name, project_version):
testname_regex = args.testname_regex
auto_approve = args.auto_approve
running_platform = args.running_platform
baseline_target_version = args.baseline_target_version
comparison_target_version = args.comparison_target_version

if running_platform is not None:
logging.info(
Expand Down Expand Up @@ -306,6 +308,8 @@ def compare_command_logic(args, project_name, project_version):
to_ts_ms,
use_metric_context_path,
running_platform,
baseline_target_version,
comparison_target_version,
)
prepare_regression_comment(
auto_approve,
Expand Down Expand Up @@ -529,6 +533,8 @@ def compute_regression_table(
to_ts_ms=None,
use_metric_context_path=None,
running_platform=None,
baseline_target_version=None,
comparison_target_version=None,
):
START_TIME_NOW_UTC, _, _ = get_start_time_vars()
START_TIME_LAST_MONTH_UTC = START_TIME_NOW_UTC - datetime.timedelta(days=31)
Expand All @@ -552,7 +558,11 @@ def compute_regression_table(
comparison_branch,
baseline_tag,
comparison_tag,
baseline_target_version,
comparison_target_version,
)
logging.info(f"Using baseline filter {by_str_baseline}={baseline_str}")
logging.info(f"Using comparison filter {by_str_comparison}={comparison_str}")
(
prefix,
testcases_setname,
Expand Down Expand Up @@ -712,6 +722,8 @@ def get_by_strings(
comparison_branch,
baseline_tag,
comparison_tag,
baseline_target_version=None,
comparison_target_version=None,
):
baseline_covered = False
comparison_covered = False
Expand All @@ -738,6 +750,16 @@ def get_by_strings(
by_str_baseline = "version"
baseline_str = baseline_tag

if baseline_target_version is not None:
if comparison_covered:
logging.error(
"--baseline-branch, --baseline-tag and --baseline-target-version are mutually exclusive. Pick one..."
)
exit(1)
baseline_covered = True
by_str_baseline = "target+version"
baseline_str = baseline_target_version

if comparison_tag is not None:
# check if we had already covered comparison
if comparison_covered:
Expand All @@ -748,16 +770,27 @@ def get_by_strings(
comparison_covered = True
by_str_comparison = "version"
comparison_str = comparison_tag
if comparison_target_version is not None:
# check if we had already covered comparison
if comparison_covered:
logging.error(
"--comparison-branch, --comparison-tag, and --comparison-target-table are mutually exclusive. Pick one..."
)
exit(1)
comparison_covered = True
by_str_comparison = "target+version"
comparison_str = comparison_target_version

if baseline_covered is False:
logging.error(
"You need to provider either " + "( --baseline-branch or --baseline-tag ) "
"You need to provider either "
+ "( --baseline-branch, --baseline-tag, or --baseline-target-version ) "
)
exit(1)
if comparison_covered is False:
logging.error(
"You need to provider either "
+ "( --comparison-branch or --comparison-tag ) "
+ "( --comparison-branch, --comparison-tag, or --comparison-target-version ) "
)
exit(1)
return baseline_str, by_str_baseline, comparison_str, by_str_comparison
Expand Down Expand Up @@ -822,6 +855,7 @@ def from_rts_to_regression_table(
filters_comparison = [
"{}={}".format(by_str_comparison, comparison_str),
"metric={}".format(metric_name),
"hash==",
"{}={}".format(test_filter, test_name),
"deployment_name={}".format(comparison_deployment_name),
"triggering_env={}".format(tf_triggering_env),
Expand Down
Loading