Skip to content

Commit 62e9098

Browse files
Updated dbconfig requests memory limit based uppon client runner checks (#188)
* Updated dbconfig requests memory limit based uppon client runner checks * Specifying failed dbconfig memory limit * fixes used_memory_check() arg call * fixes used_memory_check() arg call * Fixed resources.requests.memory for tests memtier_benchmark-1Mkeys-load-hash-5-fields-with-1000B-values * Fixed resources.requests.memory for tests memtier_benchmark-1Mkeys-load-hash-5-fields-with-1000B-values * Using default metrics on runner * Fixed resources.requests.memory for tests memtier_benchmark-1Mkeys-load-hash-5-fields-with-1000B-values * Fixed resources.requests.memory for tests memtier_benchmark-1Mkeys-load-hash-5-fields-with-1000B-values * Fixed missing exported per test and total info on client runner * Updated metric path of exported defaults * Updated metric path of exported defaults
1 parent c5611c7 commit 62e9098

File tree

95 files changed

+227
-983
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

95 files changed

+227
-983
lines changed

redis_benchmarks_specification/__cli__/args.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,12 @@ def spec_cli_args(parser):
3030
default=SPECS_PATH_TEST_SUITES,
3131
help="Test suites folder, containing the different test variations",
3232
)
33+
parser.add_argument(
34+
"--defaults_filename",
35+
type=str,
36+
default="defaults.yml",
37+
help="specify the defaults file containing spec topologies, common metric extractions,etc...",
38+
)
3339
parser.add_argument("--redis_host", type=str, default=GH_REDIS_SERVER_HOST)
3440
parser.add_argument("--branch", type=str, default="unstable")
3541
parser.add_argument("--commandstats-csv", type=str, default="")

redis_benchmarks_specification/__cli__/stats.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,11 @@ def generate_stats_cli_command_logic(args, project_name, project_version):
5858
fail_on_required_diff = args.fail_on_required_diff
5959
overall_result = True
6060
test_names = []
61+
defaults_filename = args.defaults_filename
62+
6163
for test_file in testsuite_spec_files:
64+
if defaults_filename in test_file:
65+
continue
6266
benchmark_config = {}
6367
requires_override = False
6468
test_result = True

redis_benchmarks_specification/__common__/runner.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,7 @@ def exporter_datasink_common(
178178
]
179179
},
180180
)
181+
print(overall_end_time_metrics)
181182
# 7 days from now
182183
expire_redis_metrics_ms = 7 * 24 * 60 * 60 * 1000
183184
export_redis_metrics(

redis_benchmarks_specification/__runner__/args.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,12 @@ def create_client_runner_args(project_name):
2626
default=MACHINE_NAME,
2727
help="Specify the running platform name. By default it will use the machine name.",
2828
)
29+
parser.add_argument(
30+
"--defaults_filename",
31+
type=str,
32+
default="{}/defaults.yml".format(SPECS_PATH_TEST_SUITES),
33+
help="specify the defaults file containing spec topologies, common metric extractions,etc...",
34+
)
2935
parser.add_argument("--triggering_env", type=str, default="ci")
3036
parser.add_argument("--setup_type", type=str, default="oss-standalone")
3137
parser.add_argument("--github_repo", type=str, default="redis")
@@ -178,4 +184,10 @@ def create_client_runner_args(project_name):
178184
type=int,
179185
help="override memtier test-time for each benchmark. By default will preserve test time specified in test spec",
180186
)
187+
parser.add_argument(
188+
"--override-test-runs",
189+
default=1,
190+
type=int,
191+
help="override memtier number of runs for each benchmark. By default will run once each test",
192+
)
181193
return parser

redis_benchmarks_specification/__runner__/runner.py

Lines changed: 81 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,10 @@
2828
)
2929
from redisbench_admin.run.metrics import extract_results_table
3030
from redisbench_admin.run.run import calculate_client_tool_duration_and_check
31-
from redisbench_admin.utils.benchmark_config import get_final_benchmark_config
31+
from redisbench_admin.utils.benchmark_config import (
32+
get_final_benchmark_config,
33+
get_defaults,
34+
)
3235
from redisbench_admin.utils.local import get_local_run_full_filename
3336
from redisbench_admin.utils.results import post_process_benchmark_results
3437

@@ -215,6 +218,7 @@ def prepare_memtier_benchmark_parameters(
215218
tls_cacert=None,
216219
resp_version=None,
217220
override_memtier_test_time=0,
221+
override_test_runs=1,
218222
):
219223
benchmark_command = [
220224
full_benchmark_path,
@@ -253,6 +257,62 @@ def prepare_memtier_benchmark_parameters(
253257
if "arguments" in clientconfig:
254258
benchmark_command_str = benchmark_command_str + " " + clientconfig["arguments"]
255259
logging.info(override_memtier_test_time)
260+
261+
if override_test_runs > 1:
262+
benchmark_command_str = re.sub(
263+
"--run-count\\s\\d+",
264+
"--run-count={}".format(override_test_runs),
265+
benchmark_command_str,
266+
)
267+
benchmark_command_str = re.sub(
268+
"--run-count=\\d+",
269+
"--run-count={}".format(override_test_runs),
270+
benchmark_command_str,
271+
)
272+
benchmark_command_str = re.sub(
273+
'--run-count="\\d+"',
274+
"--run-count={}".format(override_test_runs),
275+
benchmark_command_str,
276+
)
277+
# short
278+
benchmark_command_str = re.sub(
279+
"-x\\s\\d+",
280+
"-x={}".format(override_test_runs),
281+
benchmark_command_str,
282+
)
283+
benchmark_command_str = re.sub(
284+
"-x=\\d+",
285+
"-x={}".format(override_test_runs),
286+
benchmark_command_str,
287+
)
288+
benchmark_command_str = re.sub(
289+
'-x="\\d+"',
290+
"-x={}".format(override_test_runs),
291+
benchmark_command_str,
292+
)
293+
if (
294+
len(
295+
re.findall(
296+
"--run-count={}".format(override_test_runs),
297+
benchmark_command_str,
298+
)
299+
)
300+
== 0
301+
and len(
302+
re.findall(
303+
"-x={}".format(override_test_runs),
304+
benchmark_command_str,
305+
)
306+
)
307+
== 0
308+
):
309+
logging.info("adding --run-count option to benchmark run. ")
310+
benchmark_command_str = (
311+
benchmark_command_str
312+
+ " "
313+
+ "--run-count={}".format(override_test_runs)
314+
)
315+
256316
if override_memtier_test_time > 0:
257317
benchmark_command_str = re.sub(
258318
"--test-time\\s\\d+",
@@ -301,14 +361,25 @@ def process_self_contained_coordinator_stream(
301361
dry_run_count = 0
302362
dry_run = args.dry_run
303363
dry_run_include_preload = args.dry_run_include_preload
364+
defaults_filename = args.defaults_filename
365+
override_test_runs = args.override_test_runs
366+
(
367+
_,
368+
default_metrics,
369+
_,
370+
_,
371+
_,
372+
) = get_defaults(defaults_filename)
373+
304374
for test_file in testsuite_spec_files:
375+
if defaults_filename in test_file:
376+
continue
305377
client_containers = []
306378

307379
with open(test_file, "r") as stream:
308380
_, benchmark_config, test_name = get_final_benchmark_config(
309381
None, stream, ""
310382
)
311-
default_metrics = []
312383

313384
if tls_enabled:
314385
test_name = test_name + "-tls"
@@ -511,7 +582,7 @@ def process_self_contained_coordinator_stream(
511582
)
512583

513584
used_memory_check(
514-
benchmark_required_memory, r, "start of benchmark"
585+
test_name, benchmark_required_memory, r, "start of benchmark"
515586
)
516587

517588
logging.info("Checking if there is a keyspace check being enforced")
@@ -582,6 +653,7 @@ def process_self_contained_coordinator_stream(
582653
test_tls_cacert,
583654
resp_version,
584655
override_memtier_test_time,
656+
override_test_runs,
585657
)
586658

587659
client_container_image = extract_client_container_image(
@@ -652,7 +724,9 @@ def process_self_contained_coordinator_stream(
652724

653725
logging.info("Printing client tool stdout output")
654726

655-
used_memory_check(benchmark_required_memory, r, "end of benchmark")
727+
used_memory_check(
728+
test_name, benchmark_required_memory, r, "end of benchmark"
729+
)
656730

657731
if args.flushall_on_every_test_end:
658732
logging.info("Sending FLUSHALL to the DB")
@@ -804,14 +878,14 @@ def process_self_contained_coordinator_stream(
804878
)
805879

806880

807-
def used_memory_check(benchmark_required_memory, r, stage):
881+
def used_memory_check(test_name, benchmark_required_memory, r, stage):
808882
used_memory = r.info("memory")["used_memory"]
809883
used_memory_gb = int(math.ceil(float(used_memory) / 1024.0 / 1024.0 / 1024.0))
810884
logging.info("Benchmark used memory at {}: {}g".format(stage, used_memory_gb))
811885
if used_memory > benchmark_required_memory:
812886
logging.error(
813-
"The benchmark specified a dbconfig resource request of memory ({}) bellow the REAL MEMORY USAGE OF: {}. FIX IT!.".format(
814-
benchmark_required_memory, used_memory_gb
887+
"The benchmark {} specified a dbconfig resource request of memory ({}) bellow the REAL MEMORY USAGE OF: {}. FIX IT!.".format(
888+
test_name, benchmark_required_memory, used_memory_gb
815889
)
816890
)
817891
exit(1)

redis_benchmarks_specification/__self_contained_coordinator__/self_contained_coordinator.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -372,6 +372,7 @@ def process_self_contained_coordinator_stream(
372372
cpuset_start_pos=0,
373373
redis_proc_start_port=6379,
374374
docker_air_gap=False,
375+
defaults_filename="defaults.yml",
375376
):
376377
stream_id = "n/a"
377378
overall_result = False
@@ -406,6 +407,8 @@ def process_self_contained_coordinator_stream(
406407
logging.info("Successfully loaded images {}".format(images_loaded))
407408

408409
for test_file in testsuite_spec_files:
410+
if defaults_filename in test_file:
411+
continue
409412
redis_containers = []
410413
client_containers = []
411414

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
2+
exporter:
3+
redistimeseries:
4+
break_by:
5+
- version
6+
- commit
7+
timemetric: $."ALL STATS".Runtime."Start time"
8+
metrics:
9+
- $."BEST RUN RESULTS".Totals."Ops/sec"
10+
- $."BEST RUN RESULTS".Totals."Latency"
11+
- $."BEST RUN RESULTS".Totals."Misses/sec"
12+
- $."BEST RUN RESULTS".Totals."Percentile Latencies"."p50.00"
13+
- $."WORST RUN RESULTS".Totals."Ops/sec"
14+
- $."WORST RUN RESULTS".Totals."Latency"
15+
- $."WORST RUN RESULTS".Totals."Misses/sec"
16+
- $."WORST RUN RESULTS".Totals."Percentile Latencies"."p50.00"
17+
- $."AGGREGATED AVERAGE RESULTS (3 runs)".Totals."Ops/sec"
18+
- $."AGGREGATED AVERAGE RESULTS (3 runs)".Totals."Latency"
19+
- $."AGGREGATED AVERAGE RESULTS (3 runs)".Totals."Misses/sec"
20+
- $."AGGREGATED AVERAGE RESULTS (5 runs)".Totals."Percentile Latencies"."p50.00"
21+
- $."ALL STATS".Totals."Ops/sec"
22+
- $."ALL STATS".Totals."Latency"
23+
- $."ALL STATS".Totals."Misses/sec"
24+
- $."ALL STATS".Totals."Percentile Latencies"."p50.00"

redis_benchmarks_specification/test-suites/memtier_benchmark-10Mkeys-load-hash-5-fields-with-1000B-values-pipeline-10.yml

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ dbconfig:
88
keyspacelen: 0
99
resources:
1010
requests:
11-
memory: 1g
11+
memory: 52g
1212
tested-commands:
1313
- hset
1414
redis-topologies:
@@ -23,17 +23,7 @@ clientconfig:
2323
requests:
2424
cpus: '4'
2525
memory: 2g
26-
exporter:
27-
redistimeseries:
28-
break_by:
29-
- version
30-
- commit
31-
timemetric: $."ALL STATS".Runtime."Start time"
32-
metrics:
33-
- $."ALL STATS".Totals."Ops/sec"
34-
- $."ALL STATS".Totals."Latency"
35-
- $."ALL STATS".Totals."Misses/sec"
36-
- $."ALL STATS".Totals."Percentile Latencies"."p50.00"
26+
3727
tested-groups:
3828
- hash
3929
priority: 5

redis_benchmarks_specification/test-suites/memtier_benchmark-10Mkeys-load-hash-5-fields-with-1000B-values.yml

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ dbconfig:
88
keyspacelen: 0
99
resources:
1010
requests:
11-
memory: 1g
11+
memory: 52g
1212
tested-commands:
1313
- hset
1414
redis-topologies:
@@ -23,17 +23,7 @@ clientconfig:
2323
requests:
2424
cpus: '4'
2525
memory: 2g
26-
exporter:
27-
redistimeseries:
28-
break_by:
29-
- version
30-
- commit
31-
timemetric: $."ALL STATS".Runtime."Start time"
32-
metrics:
33-
- $."ALL STATS".Totals."Ops/sec"
34-
- $."ALL STATS".Totals."Latency"
35-
- $."ALL STATS".Totals."Misses/sec"
36-
- $."ALL STATS".Totals."Percentile Latencies"."p50.00"
26+
3727
tested-groups:
3828
- hash
3929
priority: 5

redis_benchmarks_specification/test-suites/memtier_benchmark-10Mkeys-load-hash-5-fields-with-100B-values-pipeline-10.yml

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ dbconfig:
88
keyspacelen: 0
99
resources:
1010
requests:
11-
memory: 1g
11+
memory: 9g
1212
tested-commands:
1313
- hset
1414
redis-topologies:
@@ -23,17 +23,7 @@ clientconfig:
2323
requests:
2424
cpus: '4'
2525
memory: 2g
26-
exporter:
27-
redistimeseries:
28-
break_by:
29-
- version
30-
- commit
31-
timemetric: $."ALL STATS".Runtime."Start time"
32-
metrics:
33-
- $."ALL STATS".Totals."Ops/sec"
34-
- $."ALL STATS".Totals."Latency"
35-
- $."ALL STATS".Totals."Misses/sec"
36-
- $."ALL STATS".Totals."Percentile Latencies"."p50.00"
26+
3727
tested-groups:
3828
- hash
3929
priority: 5

0 commit comments

Comments
 (0)