Skip to content

Commit b0c7027

Browse files
Added by.branch time-series for benchmark_duration and dataset_load_duration metrics (#132)
* [add] Added by.branch time-series for benchmark_duration and dataset_load_duration metrics * Bumping version from 0.2.3 to 0.2.4
1 parent c80d61a commit b0c7027

File tree

2 files changed

+84
-4
lines changed

2 files changed

+84
-4
lines changed

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tool.poetry]
22
name = "redisbench-admin"
3-
version = "0.2.3"
3+
version = "0.2.4"
44
description = "Redis benchmark run helper. A wrapper around Redis and Redis Modules benchmark tools ( ftsb_redisearch, memtier_benchmark, redis-benchmark, aibench, etc... )."
55
authors = ["filipecosta90 <[email protected]>"]
66
readme = "README.md"

redisbench_admin/run_remote/run_remote.py

Lines changed: 83 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -599,7 +599,31 @@ def run_remote_command_logic(args):
599599
tf_triggering_env,
600600
),
601601
)
602-
add_standardized_metric(
602+
add_standardized_metric_bybranch(
603+
"benchmark_duration",
604+
benchmark_duration_seconds,
605+
tf_github_branch,
606+
deployment_type,
607+
rts,
608+
start_time_ms,
609+
test_name,
610+
tf_github_org,
611+
tf_github_repo,
612+
tf_triggering_env,
613+
)
614+
add_standardized_metric_bybranch(
615+
"dataset_load_duration",
616+
dataset_load_duration_seconds,
617+
tf_github_branch,
618+
deployment_type,
619+
rts,
620+
start_time_ms,
621+
test_name,
622+
tf_github_org,
623+
tf_github_repo,
624+
tf_triggering_env,
625+
)
626+
add_standardized_metric_byversion(
603627
"benchmark_duration",
604628
benchmark_duration_seconds,
605629
artifact_version,
@@ -611,7 +635,7 @@ def run_remote_command_logic(args):
611635
tf_github_repo,
612636
tf_triggering_env,
613637
)
614-
add_standardized_metric(
638+
add_standardized_metric_byversion(
615639
"dataset_load_duration",
616640
dataset_load_duration_seconds,
617641
artifact_version,
@@ -679,7 +703,63 @@ def run_remote_command_logic(args):
679703
exit(return_code)
680704

681705

682-
def add_standardized_metric(
706+
def add_standardized_metric_bybranch(
707+
metric_name,
708+
metric_value,
709+
tf_github_branch,
710+
deployment_type,
711+
rts,
712+
start_time_ms,
713+
test_name,
714+
tf_github_org,
715+
tf_github_repo,
716+
tf_triggering_env,
717+
):
718+
tsname_use_case_duration = get_ts_metric_name(
719+
"by.branch",
720+
tf_github_branch,
721+
tf_github_org,
722+
tf_github_repo,
723+
deployment_type,
724+
test_name,
725+
tf_triggering_env,
726+
metric_name,
727+
)
728+
labels = get_project_ts_tags(
729+
tf_github_org,
730+
tf_github_repo,
731+
deployment_type,
732+
tf_triggering_env,
733+
)
734+
labels["branch"] = tf_github_branch
735+
labels["test_name"] = str(test_name)
736+
labels["metric"] = str(metric_name)
737+
logging.info(
738+
"Adding metric {}={} to time-serie named {}".format(
739+
metric_name, metric_value, tsname_use_case_duration
740+
)
741+
)
742+
try:
743+
logging.info(
744+
"Creating timeseries named {} with labels {}".format(
745+
tsname_use_case_duration, labels
746+
)
747+
)
748+
rts.create(tsname_use_case_duration, labels=labels)
749+
except redis.exceptions.ResponseError:
750+
logging.warning(
751+
"Timeseries named {} already exists".format(tsname_use_case_duration)
752+
)
753+
pass
754+
rts.add(
755+
tsname_use_case_duration,
756+
start_time_ms,
757+
metric_value,
758+
labels=labels,
759+
)
760+
761+
762+
def add_standardized_metric_byversion(
683763
metric_name,
684764
metric_value,
685765
artifact_version,

0 commit comments

Comments
 (0)