From 149b4247cbd450da11dea3895e64be98d13a4af3 Mon Sep 17 00:00:00 2001 From: filipecosta90 Date: Thu, 10 Jun 2021 17:01:38 +0100 Subject: [PATCH 1/5] [add] Added by.branch time-series for benchmark_duration and dataset_load_duration metrics --- redisbench_admin/run_remote/run_remote.py | 86 ++++++++++++++++++++++- 1 file changed, 83 insertions(+), 3 deletions(-) diff --git a/redisbench_admin/run_remote/run_remote.py b/redisbench_admin/run_remote/run_remote.py index c4f8d7a..5c723e7 100644 --- a/redisbench_admin/run_remote/run_remote.py +++ b/redisbench_admin/run_remote/run_remote.py @@ -599,7 +599,31 @@ def run_remote_command_logic(args): tf_triggering_env, ), ) - add_standardized_metric( + add_standardized_metric_bybranch( + "benchmark_duration", + benchmark_duration_seconds, + tf_github_branch, + deployment_type, + rts, + start_time_ms, + test_name, + tf_github_org, + tf_github_repo, + tf_triggering_env, + ) + add_standardized_metric_bybranch( + "dataset_load_duration", + dataset_load_duration_seconds, + tf_github_branch, + deployment_type, + rts, + start_time_ms, + test_name, + tf_github_org, + tf_github_repo, + tf_triggering_env, + ) + add_standardized_metric_byversion( "benchmark_duration", benchmark_duration_seconds, artifact_version, @@ -611,7 +635,7 @@ def run_remote_command_logic(args): tf_github_repo, tf_triggering_env, ) - add_standardized_metric( + add_standardized_metric_byversion( "dataset_load_duration", dataset_load_duration_seconds, artifact_version, @@ -679,7 +703,63 @@ def run_remote_command_logic(args): exit(return_code) -def add_standardized_metric( +def add_standardized_metric_bybranch( + metric_name, + metric_value, + tf_github_branch, + deployment_type, + rts, + start_time_ms, + test_name, + tf_github_org, + tf_github_repo, + tf_triggering_env, +): + tsname_use_case_duration = get_ts_metric_name( + "by.branch", + tf_github_branch, + tf_github_org, + tf_github_repo, + deployment_type, + test_name, + tf_triggering_env, + metric_name, + ) + labels = get_project_ts_tags( + tf_github_org, + tf_github_repo, + deployment_type, + tf_triggering_env, + ) + labels["branch"] = tf_github_branch + labels["test_name"] = str(test_name) + labels["metric"] = str(metric_name) + logging.info( + "Adding metric {}={} to time-serie named {}".format( + metric_name, metric_value, tsname_use_case_duration + ) + ) + try: + logging.info( + "Creating timeseries named {} with labels {}".format( + tsname_use_case_duration, labels + ) + ) + rts.create(tsname_use_case_duration, labels=labels) + except redis.exceptions.ResponseError: + logging.warning( + "Timeseries named {} already exists".format(tsname_use_case_duration) + ) + pass + rts.add( + tsname_use_case_duration, + start_time_ms, + metric_value, + labels=labels, + ) + + +def add_standardized_metric_byversion( metric_name, metric_value, artifact_version, From 471701e61d61639d88a2eedb3c249b211e412ca0 Mon Sep 17 00:00:00 2001 From: filipecosta90 Date: Thu, 10 Jun 2021 17:02:00 +0100 Subject: [PATCH 2/5] Bumping version from 0.2.3 to 0.2.4 --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index c795080..8f94a79 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "redisbench-admin" -version = "0.2.3" +version = "0.2.4" description = "Redis benchmark run helper. A wrapper around Redis and Redis Modules benchmark tools ( ftsb_redisearch, memtier_benchmark, redis-benchmark, aibench, etc... )." authors = ["filipecosta90 "] readme = "README.md" From 28bff2d6e29fe217ea8964c574f8996d55f9f74f Mon Sep 17 00:00:00 2001 From: filipecosta90 Date: Thu, 10 Jun 2021 17:19:33 +0100 Subject: [PATCH 3/5] [fix] fixed benchmark repetitions range --- redisbench_admin/run_remote/run_remote.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/redisbench_admin/run_remote/run_remote.py b/redisbench_admin/run_remote/run_remote.py index 5c723e7..7e741ff 100644 --- a/redisbench_admin/run_remote/run_remote.py +++ b/redisbench_admin/run_remote/run_remote.py @@ -290,7 +290,7 @@ def run_remote_command_logic(args): password=args.redistimesies_pass, ) rts.redis.ping() - for repetition in range(1, BENCHMARK_REPETITIONS): + for repetition in range(1, BENCHMARK_REPETITIONS + 1): for test_name, benchmark_config in benchmark_definitions.items(): s3_bucket_path = get_test_s3_bucket_path( s3_bucket_name, test_name, tf_github_org, tf_github_repo From 05df2c614f943d1d920f96c88f79b2ddae20cdf3 Mon Sep 17 00:00:00 2001 From: filipecosta90 Date: Thu, 10 Jun 2021 17:19:56 +0100 Subject: [PATCH 4/5] Bumping version from 0.2.4 to 0.2.5 --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 8f94a79..deff7be 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "redisbench-admin" -version = "0.2.4" +version = "0.2.5" description = "Redis benchmark run helper. A wrapper around Redis and Redis Modules benchmark tools ( ftsb_redisearch, memtier_benchmark, redis-benchmark, aibench, etc... )." authors = ["filipecosta90 "] readme = "README.md" From 7e397a87f053f7ef5fc1ae60b5ee613c34fbef37 Mon Sep 17 00:00:00 2001 From: filipecosta90 Date: Thu, 10 Jun 2021 17:38:21 +0100 Subject: [PATCH 5/5] [fix] Fixed standardized metrics by branch --- pyproject.toml | 2 +- redisbench_admin/run_remote/run_remote.py | 49 ++++++++++++----------- 2 files changed, 26 insertions(+), 25 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index deff7be..df19a61 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "redisbench-admin" -version = "0.2.5" +version = "0.2.6" description = "Redis benchmark run helper. A wrapper around Redis and Redis Modules benchmark tools ( ftsb_redisearch, memtier_benchmark, redis-benchmark, aibench, etc... )." authors = ["filipecosta90 "] readme = "README.md" diff --git a/redisbench_admin/run_remote/run_remote.py b/redisbench_admin/run_remote/run_remote.py index 7e741ff..7b50fdd 100644 --- a/redisbench_admin/run_remote/run_remote.py +++ b/redisbench_admin/run_remote/run_remote.py @@ -599,30 +599,31 @@ def run_remote_command_logic(args): tf_triggering_env, ), ) - add_standardized_metric_bybranch( - "benchmark_duration", - benchmark_duration_seconds, - tf_github_branch, - deployment_type, - rts, - start_time_ms, - test_name, - tf_github_org, - tf_github_repo, - tf_triggering_env, - ) - add_standardized_metric_bybranch( - "dataset_load_duration", - dataset_load_duration_seconds, - tf_github_branch, - deployment_type, - rts, - start_time_ms, - test_name, - tf_github_org, - tf_github_repo, - tf_triggering_env, - ) + if tf_github_branch is not None and tf_github_branch != "": + add_standardized_metric_bybranch( + "benchmark_duration", + benchmark_duration_seconds, + str(tf_github_branch), + deployment_type, + rts, + start_time_ms, + test_name, + tf_github_org, + tf_github_repo, + tf_triggering_env, + ) + add_standardized_metric_bybranch( + "dataset_load_duration", + dataset_load_duration_seconds, + str(tf_github_branch), + deployment_type, + rts, + start_time_ms, + test_name, + tf_github_org, + tf_github_repo, + tf_triggering_env, + ) add_standardized_metric_byversion( "benchmark_duration", benchmark_duration_seconds,