Skip to content

Commit b127fcd

Browse files
Added --maxmemory to client runner. (#221)
* Added --maxmemory to client runner. * Fixed typo on cli.py
1 parent b63a28b commit b127fcd

File tree

5 files changed

+20
-5
lines changed

5 files changed

+20
-5
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 = "redis-benchmarks-specification"
3-
version = "0.1.67"
3+
version = "0.1.68"
44
description = "The Redis benchmarks specification describes the cross-language/tools requirements and expectations to foster performance and observability standards around redis related technologies. Members from both industry and academia, including organizations and individuals are encouraged to contribute."
55
authors = ["filipecosta90 <filipecosta.90@gmail.com>","Redis Performance Group <performance@redis.com>"]
66
readme = "Readme.md"

redis_benchmarks_specification/__cli__/cli.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,7 @@ def get_commits_by_tags(args, repo):
135135
pass
136136
return commits
137137

138+
138139
def get_repo(args):
139140
redisDirPath = args.redis_repo
140141
cleanUp = False
@@ -186,7 +187,7 @@ def trigger_tests_cli_command_logic(args, project_name, project_version):
186187
if args.use_branch:
187188
commits, total_commits = get_commits_by_branch(args, repo)
188189
if args.use_tags:
189-
commtis = get_commits_by_tags(args, repo)
190+
commits = get_commits_by_tags(args, repo)
190191

191192
by_description = "n/a"
192193
if args.use_branch:

redis_benchmarks_specification/__runner__/args.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,12 @@ def create_client_runner_args(project_name):
6363
parser.add_argument("--db_server_password", type=str, default=None)
6464
parser.add_argument("--db_server_port", type=int, default=6379)
6565
parser.add_argument("--cpuset_start_pos", type=int, default=0)
66+
parser.add_argument(
67+
"--maxmemory",
68+
type=int,
69+
default=0,
70+
help="If specified will not retrieved the maxmemory from the DB Server and will use this limit. If 0 will read the this value from the DB servers.",
71+
)
6672
parser.add_argument(
6773
"--tests-priority-lower-limit",
6874
type=int,

redis_benchmarks_specification/__runner__/runner.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -495,8 +495,11 @@ def process_self_contained_coordinator_stream(
495495
benchmark_config
496496
)
497497
maxmemory = 0
498-
for conn in redis_conns:
499-
maxmemory = maxmemory + get_maxmemory(conn)
498+
if args.maxmemory > 0:
499+
maxmemory = args.maxmemory
500+
else:
501+
for conn in redis_conns:
502+
maxmemory = maxmemory + get_maxmemory(conn)
500503
if benchmark_required_memory > maxmemory:
501504
logging.warning(
502505
"Skipping test {} given maxmemory of server is bellow the benchmark required memory: {} < {}".format(

utils/tests/test_cli.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,12 @@
88
import git
99

1010
from redis_benchmarks_specification.__cli__.args import spec_cli_args
11-
from redis_benchmarks_specification.__cli__.cli import trigger_tests_cli_command_logic, get_commits_by_branch, get_commits_by_tags, get_repo
11+
from redis_benchmarks_specification.__cli__.cli import (
12+
trigger_tests_cli_command_logic,
13+
get_commits_by_branch,
14+
get_commits_by_tags,
15+
get_repo,
16+
)
1217

1318

1419
def test_run_local_command_logic_oss_cluster():

0 commit comments

Comments
 (0)