Skip to content

Commit

Permalink
override throughput + client parameters if load testing
Browse files Browse the repository at this point in the history
Signed-off-by: Michael Oviedo <[email protected]>
  • Loading branch information
OVI3D0 committed Jan 30, 2025
1 parent 60782d1 commit 9c07c2d
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 6 deletions.
9 changes: 4 additions & 5 deletions osbenchmark/benchmark.py
Original file line number Diff line number Diff line change
Expand Up @@ -648,10 +648,9 @@ def add_workload_source(subparser):
help="Stop executing tests if an error occurs in one of the test iterations (default: false).",
)
test_execution_parser.add_argument(
"--load-test",
action="store_true",
help="Run a load test (default: false).",
default=False
"--load-test-qps",
help="Run a load test on your cluster, up to a certain QPS value (default: 0)",
default=0
)

###############################################################################
Expand Down Expand Up @@ -926,7 +925,7 @@ def configure_test(arg_parser, args, cfg):
"load_worker_coordinator_hosts",
opts.csv_to_list(args.load_worker_coordinator_hosts))
cfg.add(config.Scope.applicationOverride, "workload", "test.mode.enabled", args.test_mode)
cfg.add(config.Scope.applicationOverride, "workload", "load.test.enabled", args.load_test)
cfg.add(config.Scope.applicationOverride, "workload", "load.test.clients", int(args.load_test_qps))
cfg.add(config.Scope.applicationOverride, "workload", "latency.percentiles", args.latency_percentiles)
cfg.add(config.Scope.applicationOverride, "workload", "throughput.percentiles", args.throughput_percentiles)
cfg.add(config.Scope.applicationOverride, "workload", "randomization.enabled", args.randomization_enabled)
Expand Down
10 changes: 9 additions & 1 deletion osbenchmark/worker_coordinator/worker_coordinator.py
Original file line number Diff line number Diff line change
Expand Up @@ -657,7 +657,15 @@ def start_benchmark(self):
self.logger.info("Attaching cluster-level telemetry devices.")
self.telemetry.on_benchmark_start()
self.logger.info("Cluster-level telemetry devices are now attached.")

# if load testing is enabled, modify the client number for the task(s)
# target throughput will then be equal to the number of clients passed in through --load-test
load_test_clients = self.config.opts("workload", "load.test.clients", mandatory=False)
if load_test_clients > 0:
for task in self.test_procedure.schedule:
for subtask in task:
subtask.clients = load_test_clients
subtask.params["target-throughput"] = load_test_clients
self.logger.info("Load test mode enabled - set client count to %d", load_test_clients)
allocator = Allocator(self.test_procedure.schedule)
self.allocations = allocator.allocations
self.number_of_steps = len(allocator.join_points) - 1
Expand Down

0 comments on commit 9c07c2d

Please sign in to comment.