Skip to content

Added --maxmemory to client runner. #221

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Feb 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "redis-benchmarks-specification"
version = "0.1.67"
version = "0.1.68"
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."
authors = ["filipecosta90 <filipecosta.90@gmail.com>","Redis Performance Group <performance@redis.com>"]
readme = "Readme.md"
Expand Down
3 changes: 2 additions & 1 deletion redis_benchmarks_specification/__cli__/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,7 @@ def get_commits_by_tags(args, repo):
pass
return commits


def get_repo(args):
redisDirPath = args.redis_repo
cleanUp = False
Expand Down Expand Up @@ -186,7 +187,7 @@ def trigger_tests_cli_command_logic(args, project_name, project_version):
if args.use_branch:
commits, total_commits = get_commits_by_branch(args, repo)
if args.use_tags:
commtis = get_commits_by_tags(args, repo)
commits = get_commits_by_tags(args, repo)

by_description = "n/a"
if args.use_branch:
Expand Down
6 changes: 6 additions & 0 deletions redis_benchmarks_specification/__runner__/args.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,12 @@ def create_client_runner_args(project_name):
parser.add_argument("--db_server_password", type=str, default=None)
parser.add_argument("--db_server_port", type=int, default=6379)
parser.add_argument("--cpuset_start_pos", type=int, default=0)
parser.add_argument(
"--maxmemory",
type=int,
default=0,
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.",
)
parser.add_argument(
"--tests-priority-lower-limit",
type=int,
Expand Down
7 changes: 5 additions & 2 deletions redis_benchmarks_specification/__runner__/runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -495,8 +495,11 @@ def process_self_contained_coordinator_stream(
benchmark_config
)
maxmemory = 0
for conn in redis_conns:
maxmemory = maxmemory + get_maxmemory(conn)
if args.maxmemory > 0:
maxmemory = args.maxmemory
else:
for conn in redis_conns:
maxmemory = maxmemory + get_maxmemory(conn)
if benchmark_required_memory > maxmemory:
logging.warning(
"Skipping test {} given maxmemory of server is bellow the benchmark required memory: {} < {}".format(
Expand Down
7 changes: 6 additions & 1 deletion utils/tests/test_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,12 @@
import git

from redis_benchmarks_specification.__cli__.args import spec_cli_args
from redis_benchmarks_specification.__cli__.cli import trigger_tests_cli_command_logic, get_commits_by_branch, get_commits_by_tags, get_repo
from redis_benchmarks_specification.__cli__.cli import (
trigger_tests_cli_command_logic,
get_commits_by_branch,
get_commits_by_tags,
get_repo,
)


def test_run_local_command_logic_oss_cluster():
Expand Down