Skip to content

Commit 2bd4667

Browse files
[add] Included documentation on how to do a differential analysis bet… (#180)
* [add] Included documentation on how to do a differential analysis between branches * [add] Enabled user-based access to RTS cluster * [add] Enabled user-based access to RTS cluster
1 parent acca224 commit 2bd4667

File tree

5 files changed

+103
-2
lines changed

5 files changed

+103
-2
lines changed

docs/Readme.md

Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,95 @@ a standalone redis-server, copy the dataset and module files to the DB VM and ma
9494
- At the end of each benchmark an output json file is stored with this benchmarks folder and will be named like `<start time>-<deployment type>-<git org>-<git repo>-<git branch>-<test name>-<git sha>.json`
9595
- In the case of a uncaught exception after we've deployed the environment the benchmark script will always try to teardown the created environment.
9696

97+
# Comparing feature branches
98+
99+
You can use the data stored in redistimeseries of different branches to portray a differential analysis between them.
100+
To be able to fetch the RedisTimeseries data, you need to pass either the `--redistimeseries_host,--redistimeseries_port,--redistimeseries_auth,--redistimeseries_user`
101+
or the equivalent `PERFORMANCE_RTS_HOST,PERFORMANCE_RTS_PORT,PERFORMANCE_RTS_AUTH,PERFORMANCE_RTS_USER`.
102+
**To have them, you should ask the performance team for the read-only access keys.**
103+
104+
Depending on the metric type ( example of latency / throughput ) the improvement is checked either via `higher-better`
105+
mode or `lower-better` mode.
106+
107+
By default, the metric used is `Tests.Overall.rps` and the metric mode is `higher-better`.
108+
You can change the metric and metric mode via `--metric_name` and `--metric_mode` parameters.
109+
110+
**Important Note:** The current differential analysis focus only on the last datapoint of result of each branch
111+
( meaning this can and will be improved in the future to take into account multi-datapoints per branch ).
112+
113+
By default, the tool checks for the last week datapoints, and uses the most recent one per branch.
114+
You can control the time-range of the comparison using `--from_timestamp` and `--to_timestamp` arguments.
115+
116+
Bellow, you can find an example comparing RedisJSON 1.0 vs master branch:
117+
118+
**Command:**
119+
```
120+
TRIGGERING_ENV=circleci redisbench-admin compare \
121+
--baseline-branch 1.0 --comparison-branch master \
122+
--github_repo RedisJSON --github_org RedisJSON \
123+
--redistimeseries_host ${REDISTIMESERIES_HOST} \
124+
--redistimeseries_port ${REDISTIMESERIES_PORT} \
125+
--redistimeseries_pass ${REDISTIMESERIES_PASS} \
126+
--redistimeseries_user ${REDISTIMESERIES_USER}
127+
```
128+
129+
**Output:**
130+
```
131+
WARNING:root:Unable to fill git vars. caught the following error:
132+
Effective log level set to INFO
133+
INFO:root:Using: redisbench-admin 0.4.7
134+
2021-08-12 12:01:40,213 INFO Using: redisbench-admin 0.4.7
135+
INFO:root:Checking connection to RedisTimeSeries with user: (....), host: (....), port: (....)
136+
WARNING:root:Based on test-cases set (key=ci.benchmarks.redislabs/circleci/RedisJSON/RedisJSON:testcases) we have 35 distinct benchmarks.
137+
2021-08-12 12:01:40,613 WARNING Based on test-cases set (key=ci.benchmarks.redislabs/circleci/RedisJSON/RedisJSON:testcases) we have 35 distinct benchmarks.
138+
INFO:root:Printing differential analysis between branches
139+
2021-08-12 12:01:47,591 INFO Printing differential analysis between branches
140+
# Comparison between 1.0 and master for metric: Tests.Overall.rps
141+
| Test Case |Baseline value|Comparison Value|% change (higher-better)|
142+
|----------------------------------------------------------------|-------------:|----------------|-----------------------:|
143+
|json_arrappend_geojson | 77811.3| 64503.6| -17.102|
144+
|json_get_ResultSet.totalResultsAvailable_jsonsl-yahoo2_json | 145972.6| 137919.6| -5.517|
145+
|json_get_[0]_jsonsl-1 | 142849.0| 131568.6| -7.897|
146+
|json_get_[7]_jsonsl-1 | 139852.3| 127382.0| -8.917|
147+
|json_get_[8].zero_jsonsl-1 | 153841.4| 137923.4| -10.347|
148+
|json_get_[web-app].servlet[0][servlet-name]_json-parser-0000 | 135584.0| 117633.2| -13.240|
149+
|json_get_[web-app].servlet[0]_json-parser-0000 | 42183.1| 84735.7| 100.876|
150+
|json_get_[web-app].servlet_json-parser-0000 | 31091.2| 78730.2| 153.223|
151+
|json_get_array_of_docs[1]_pass_100_json | 103084.3| 130712.1| 26.801|
152+
|json_get_array_of_docs[1]sclr_pass_100_json | 125776.7| 119751.9| -4.790|
153+
|json_get_array_of_docs_pass_100_json | 88484.6| 125776.7| 42.145|
154+
|json_get_fulldoc_json-parser-0000 | 27572.5| 81956.5| 197.240|
155+
|json_get_fulldoc_jsonsl-1 | 31632.8| 94777.7| 199.619|
156+
|json_get_fulldoc_jsonsl-yahoo2_json | 6278.8| 27770.1| 342.286|
157+
|json_get_fulldoc_jsonsl-yelp_json | 2760.9| 13879.2| 402.715|
158+
|json_get_fulldoc_pass_100_json | 71676.4| 123450.7| 72.233|
159+
|json_get_key_empty | 144919.1| 160266.7| 10.590|
160+
|json_get_message.code_jsonsl-yelp_json | 139848.4| 143876.6| 2.880|
161+
|json_get_sclr_pass_100_json | 141835.9| 151506.0| 6.818|
162+
|json_get_sub_doc.sclr_pass_100_json | 135127.8| 144919.1| 7.246|
163+
|json_get_sub_doc_pass_100_json | 109880.4| 127382.0| 15.928|
164+
|json_numincrby_num_1 | 131568.6| 133322.7| 1.333|
165+
|json_set_ResultSet.totalResultsAvailable_1_jsonsl-yahoo2_json | 135124.2| 119039.1| -11.904|
166+
|json_set_[0]foo_jsonsl-1 | 134221.0| 124217.4| -7.453|
167+
|json_set_[web-app].servlet[0][servlet-name]_bar_json-parser-0000| 139852.3| 98029.6| -29.905|
168+
|json_set_fulldoc_pass_100_json | 72192.8| 87325.6| 20.962|
169+
|json_set_key_empty | 143876.6| 156240.2| 8.593|
170+
|json_set_message.code_1_jsonsl-yelp_json | 141831.9| 117638.8| -17.058|
171+
|json_set_num_0 | 149244.8| 156240.2| 4.687|
172+
|json_set_sclr_1_pass_100_json | 130708.7| 127382.0| -2.545|
173+
|json_set_sclr_pass_100_json | 141835.9| 129863.4| -8.441|
174+
INFO:root:Detected a total of 7 stable tests between versions.
175+
2021-08-12 12:01:47,683 INFO Detected a total of 7 stable tests between versions.
176+
INFO:root:Detected a total of 16 improvements above the improvement water line (> 5.0 %%)
177+
2021-08-12 12:01:47,683 INFO Detected a total of 16 improvements above the improvement water line (> 5.0 %%)
178+
WARNING:root:Detected a total of 11 regressions bellow the regression water line (< -5.0 %%)
179+
2021-08-12 12:01:47,684 WARNING Detected a total of 11 regressions bellow the regression water line (< -5.0 %%)
180+
WARNING:root:Printing BENCHMARK env var compatible list
181+
2021-08-12 12:01:47,684 WARNING Printing BENCHMARK env var compatible list
182+
WARNING:root:BENCHMARK=json_arrappend_geojson.yml,json_get_ResultSet.totalResultsAvailable_jsonsl-yahoo2_json.yml,json_get_[0]_jsonsl-1.yml,json_get_[7]_jsonsl-1.yml,json_get_[8].zero_jsonsl-1.yml,json_get_[web-app].servlet[0][servlet-name]_json-parser-0000.yml,json_set_ResultSet.totalResultsAvailable_1_jsonsl-yahoo2_json.yml,json_set_[0]foo_jsonsl-1.yml,json_set_[web-app].servlet[0][servlet-name]_bar_json-parser-0000.yml,json_set_message.code_1_jsonsl-yelp_json.yml,json_set_sclr_pass_100_json.yml
183+
2021-08-12 12:01:47,684 WARNING BENCHMARK=json_arrappend_geojson.yml,json_get_ResultSet.totalResultsAvailable_jsonsl-yahoo2_json.yml,json_get_[0]_jsonsl-1.yml,json_get_[7]_jsonsl-1.yml,json_get_[8].zero_jsonsl-1.yml,json_get_[web-app].servlet[0][servlet-name]_json-parser-0000.yml,json_set_ResultSet.totalResultsAvailable_1_jsonsl-yahoo2_json.yml,json_set_[0]foo_jsonsl-1.yml,json_set_[web-app].servlet[0][servlet-name]_bar_json-parser-0000.yml,json_set_message.code_1_jsonsl-yelp_json.yml,json_set_sclr_pass_100_json.yml
184+
```
185+
97186
# Attaching profiling tools/probers ( perf (a.k.a. perf_events), bpf tooling, vtune ) while running local benchmarks
98187

99188
**Note:** This part of the guide is only valid for Linux based machines,

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.4.6"
3+
version = "0.4.7"
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/compare/args.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
PERFORMANCE_RTS_PORT,
1313
PERFORMANCE_RTS_AUTH,
1414
extract_git_vars,
15+
PERFORMANCE_RTS_USER,
1516
)
1617

1718
(
@@ -58,6 +59,9 @@ def create_compare_arguments(parser):
5859
parser.add_argument(
5960
"--redistimeseries_pass", type=str, default=PERFORMANCE_RTS_AUTH
6061
)
62+
parser.add_argument(
63+
"--redistimeseries_user", type=str, default=PERFORMANCE_RTS_USER
64+
)
6165
parser.add_argument("--from_timestamp", type=int, default=LAST_WEEK_UTC)
6266
parser.add_argument("--to_timestamp", type=int, default=NOW_UTC)
6367
return parser

redisbench_admin/compare/compare.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,18 @@ def compare_command_logic(args, project_name, project_version):
2020
project_name=project_name, project_version=project_version
2121
)
2222
)
23-
logging.info("Checking connection to RedisTimeSeries.")
23+
logging.info(
24+
"Checking connection to RedisTimeSeries with user: {}, host: {}, port: {}".format(
25+
args.redistimeseries_user,
26+
args.redistimeseries_host,
27+
args.redistimeseries_port,
28+
)
29+
)
2430
rts = Client(
2531
host=args.redistimeseries_host,
2632
port=args.redistimeseries_port,
2733
password=args.redistimeseries_pass,
34+
username=args.redistimeseries_user,
2835
)
2936
rts.redis.ping()
3037

redisbench_admin/utils/remote.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
# environment variables
3131
PERFORMANCE_RTS_PUSH = bool(os.getenv("PUSH_RTS", False))
3232
PERFORMANCE_RTS_AUTH = os.getenv("PERFORMANCE_RTS_AUTH", None)
33+
PERFORMANCE_RTS_USER = os.getenv("PERFORMANCE_RTS_USER", None)
3334
PERFORMANCE_RTS_HOST = os.getenv("PERFORMANCE_RTS_HOST", "localhost")
3435
PERFORMANCE_RTS_PORT = os.getenv("PERFORMANCE_RTS_PORT", 6379)
3536
TERRAFORM_BIN_PATH = os.getenv("TERRAFORM_BIN_PATH", "terraform")

0 commit comments

Comments
 (0)