Skip to content
This repository was archived by the owner on Jul 8, 2021. It is now read-only.
Open
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
7 changes: 6 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,13 @@ Optune servo driver for Apache Benchmark
```
["Host: hostname.local", "X-AUTH-TOKEN: aTokenForAuthentication"]
```
* `AB_N_THREADS` - Number of multiple requests to perform at a time.
* `AB_N_REQUESTS` - Number of requests to perform for the benchmarking session.
* `AB_T_LIMIT` - Maximum number of seconds to spend for benchmarking.
* `AB_T_WARMUP` - Number of seconds to wait after start to perform measurement.

Note: Control parameters take precedence over environment variables.
Note: Control parameters can also be defined in code. There are defaults for
AB_N and AB_T parameters if not specified as environment variables.

## Supported control parameters:

Expand Down
11 changes: 10 additions & 1 deletion measure
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import json
from threading import Timer

DESC="Apache Benchmark measure driver for Opsani Optune"
VERSION="1.0.0"
VERSION="1.0.1"
HAS_CANCEL=True
PROGRESS_INTERVAL=30

Expand Down Expand Up @@ -80,6 +80,15 @@ class AB(Measure):
if not load_cfg['test_url']:
raise Exception('Load configuration is missing a test_url')

if os.environ.get('AB_N_THREADS'):
load_cfg['n_threads'] = os.environ.get('AB_N_THREADS')
if os.environ.get('AB_N_REQUESTS'):
load_cfg['n_requests'] = os.environ.get('AB_N_REQUESTS')
if os.environ.get('AB_T_LIMIT'):
load_cfg['t_limit'] = os.environ.get('AB_T_LIMIT')
if os.environ.get('AB_T_WARMUP'):
load_cfg['t_warmup'] = os.environ.get('AB_T_WARMUP')

result, command = self._run_ab(
test_url = load_cfg['test_url'],
headers = load_cfg['headers'],
Expand Down