-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Extended profile data expiration from 7 to 30 days (#349)
- Loading branch information
1 parent
f332159
commit a718ba8
Showing
3 changed files
with
180 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,97 @@ | ||
# BSD 3-Clause License | ||
# | ||
# Copyright (c) 2022., Redis Labs Modules | ||
# All rights reserved. | ||
# | ||
import os | ||
|
||
import redis | ||
|
||
from redisbench_admin.run.grafana import ( | ||
generate_artifacts_table_grafana_redis, | ||
get_profile_zset_names, | ||
) | ||
|
||
|
||
def test_generate_artifacts_table_grafana_redis(): | ||
rts_host = os.getenv("RTS_DATASINK_HOST", None) | ||
rts_port = 16379 | ||
if rts_host is None: | ||
assert False | ||
redis_conn = redis.Redis(port=rts_port, host=rts_host, decode_responses=True) | ||
redis_conn.ping() | ||
redis_conn.flushall() | ||
push_results_redistimeseries = True | ||
grafana_profile_dashboard = ( | ||
"https://benchmarksrediscom.grafana.net/d/uRPZar57k/ci-profiler-viewer" | ||
) | ||
setup_name = "oss-standalone" | ||
test_name = ( | ||
"memtier_benchmark-1Mkeys-load-stream-1-fields-with-100B-values-pipeline-10" | ||
) | ||
start_time_ms = 1650018944037 | ||
start_time_str = "2022-04-22-10-34-25" | ||
tf_github_org = "redis" | ||
tf_github_repo = "redis" | ||
tf_github_sha = "96c8751069a89ecfa62e4291d8f879882bc0f0aa" | ||
tf_github_branch = "unstable" | ||
profile_artifacts = [ | ||
{ | ||
"artifact_name": "artifact 1", | ||
"s3_link": "s3:212312", | ||
} | ||
] | ||
generate_artifacts_table_grafana_redis( | ||
push_results_redistimeseries, | ||
grafana_profile_dashboard, | ||
profile_artifacts, | ||
redis_conn, | ||
setup_name, | ||
start_time_ms, | ||
start_time_str, | ||
test_name, | ||
tf_github_org, | ||
tf_github_repo, | ||
tf_github_sha, | ||
tf_github_branch, | ||
) | ||
profile_id = "{}_{}_hash_{}".format(start_time_str, setup_name, tf_github_sha) | ||
( | ||
profile_set_redis_key, | ||
zset_profiles, | ||
zset_profiles_setup, | ||
zset_profiles_setups_testcases, | ||
zset_profiles_setups_testcases_branches, | ||
zset_profiles_setups_testcases_branches_latest_link, | ||
zset_profiles_setups_testcases_profileid, | ||
) = get_profile_zset_names( | ||
profile_id, | ||
setup_name, | ||
test_name, | ||
tf_github_branch, | ||
tf_github_org, | ||
tf_github_repo, | ||
) | ||
assert redis_conn.exists(zset_profiles) | ||
assert redis_conn.exists(profile_set_redis_key) | ||
assert redis_conn.exists(zset_profiles_setup) | ||
assert redis_conn.exists(zset_profiles_setups_testcases) | ||
assert redis_conn.exists(zset_profiles_setups_testcases_branches) | ||
assert redis_conn.exists(zset_profiles_setups_testcases_branches_latest_link) | ||
assert redis_conn.exists(zset_profiles_setups_testcases_profileid) | ||
assert redis_conn.type(zset_profiles) == "zset" | ||
assert redis_conn.zcard(zset_profiles) == 1 | ||
assert redis_conn.zcard(zset_profiles_setup) == 1 | ||
assert redis_conn.zcard(zset_profiles_setups_testcases) == 1 | ||
assert redis_conn.zcard(zset_profiles_setups_testcases_branches) == 1 | ||
assert redis_conn.zcard(zset_profiles_setups_testcases_branches_latest_link) == 1 | ||
assert redis_conn.zcard(zset_profiles_setups_testcases_profileid) == 1 | ||
assert redis_conn.zrangebyscore( | ||
zset_profiles_setups_testcases, start_time_ms - 1, start_time_ms + 1 | ||
) == [test_name] | ||
assert redis_conn.zrangebyscore( | ||
zset_profiles_setup, start_time_ms - 1, start_time_ms + 1 | ||
) == [setup_name] | ||
assert redis_conn.zrangebyscore( | ||
zset_profiles_setups_testcases_branches, start_time_ms - 1, start_time_ms + 1 | ||
) == [tf_github_branch] |