Skip to content

Commit f332159

Browse files
Fixed generate_artifacts_table_grafana_redis() not to rely on args (#348)
1 parent 1d8f457 commit f332159

File tree

6 files changed

+23
-21
lines changed

6 files changed

+23
-21
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.8.4"
3+
version = "0.8.5"
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 <filipecosta.90@gmail.com>","Redis Performance Group <performance@redis.com>"]
66
readme = "README.md"

redisbench_admin/run/grafana.py

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,10 @@
1616

1717

1818
def generate_artifacts_table_grafana_redis(
19-
args,
19+
push_results_redistimeseries,
2020
grafana_profile_dashboard,
2121
profile_artifacts,
22-
rts,
22+
redis_conn,
2323
setup_name,
2424
start_time_ms,
2525
start_time_str,
@@ -103,30 +103,30 @@ def generate_artifacts_table_grafana_redis(
103103
test_name,
104104
profile_id,
105105
)
106-
if args.push_results_redistimeseries:
106+
if push_results_redistimeseries:
107107
current_time = time.time() * 1000
108108
timeframe_by_branch = current_time - EXPIRE_TIME_MSECS_PROFILE_KEYS
109-
rts.zadd(
109+
redis_conn.zadd(
110110
zset_profiles_setups_testcases_branches,
111111
{tf_github_branch: start_time_ms},
112112
)
113-
rts.zadd(
113+
redis_conn.zadd(
114114
zset_profiles_setups_testcases_branches_latest_link,
115115
{https_link: start_time_ms},
116116
)
117-
rts.zadd(
117+
redis_conn.zadd(
118118
zset_profiles_setup,
119119
{setup_name: start_time_ms},
120120
)
121-
rts.zadd(
121+
redis_conn.zadd(
122122
zset_profiles_setups_testcases,
123123
{test_name: start_time_ms},
124124
)
125-
rts.zadd(
125+
redis_conn.zadd(
126126
zset_profiles_setups_testcases_profileid,
127127
{profile_id: start_time_ms},
128128
)
129-
rts.zadd(
129+
redis_conn.zadd(
130130
zset_profiles,
131131
{profile_id: start_time_ms},
132132
)
@@ -138,11 +138,11 @@ def generate_artifacts_table_grafana_redis(
138138
zset_profiles_setups_testcases_branches_latest_link,
139139
]
140140
for keyname in sorted_set_keys:
141-
rts.zremrangebyscore(keyname, 0, int(timeframe_by_branch))
141+
redis_conn.zremrangebyscore(keyname, 0, int(timeframe_by_branch))
142142

143-
rts.sadd(profile_set_redis_key, test_name)
144-
rts.expire(profile_set_redis_key, EXPIRE_TIME_SECS_PROFILE_KEYS)
145-
rts.setex(
143+
redis_conn.sadd(profile_set_redis_key, test_name)
144+
redis_conn.expire(profile_set_redis_key, EXPIRE_TIME_SECS_PROFILE_KEYS)
145+
redis_conn.setex(
146146
profile_string_testcase_markdown_key,
147147
EXPIRE_TIME_SECS_PROFILE_KEYS,
148148
profile_markdown_str,

redisbench_admin/run_remote/run_remote.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -641,7 +641,7 @@ def run_remote_command_logic(args, project_name, project_version):
641641
else:
642642
https_link = (
643643
generate_artifacts_table_grafana_redis(
644-
args,
644+
args.push_results_redistimeseries,
645645
grafana_profile_dashboard,
646646
profile_artifacts,
647647
rts,

redisbench_admin/watchdog/watchdog.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,9 @@ def watchdog_command_logic(args, project_name, project_version):
177177
)
178178
except redis.exceptions.ConnectionError as e:
179179
logging.error(
180-
"Detected an error while writing data to rts: {}".format(e.__str__())
180+
"Detected an error while writing data to redis_conn: {}".format(
181+
e.__str__()
182+
)
181183
)
182184
sleep_time_secs = float(update_interval) - (
183185
(datetime.datetime.now() - starttime).total_seconds()

tests/test_aa_run_remote.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ def test_redistimeseries_results_logic():
3535
# deployment_type,
3636
# exporter_timemetric_path,
3737
# results_dict,
38-
# rts,
38+
# redis_conn,
3939
# test_name,
4040
# tf_github_branch,
4141
# tf_github_org,

tests/test_run_local.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -93,9 +93,9 @@ def test_datasink_profile_tabular_data():
9393
pprof_format, profile_test_suffix
9494
)
9595
assert rts.exists(table_columns_text_key)
96-
# assert rts.exists(testcases_setname)
97-
# assert rts.exists(running_platforms_setname)
98-
# assert rts.exists(build_variant_setname)
96+
# assert redis_conn.exists(testcases_setname)
97+
# assert redis_conn.exists(running_platforms_setname)
98+
# assert redis_conn.exists(build_variant_setname)
9999

100100
except redis.exceptions.ConnectionError:
101101
pass
@@ -183,7 +183,7 @@ def test_run_local_command_logic():
183183
except SystemExit as e:
184184
assert e.code == 1
185185

186-
## run while pushing results to rts
186+
## run while pushing results to redis_conn
187187
rts_host = os.getenv("RTS_DATASINK_HOST", None)
188188
rts_port = 16379
189189
if rts_host is None:

0 commit comments

Comments
 (0)