Metadata-Version: 2.4
Name: redisbench-admin
Version: 0.12.41
Summary: Redis benchmark run helper. A wrapper around Redis and Redis Modules benchmark tools ( ftsb_redisearch, memtier_benchmark, redis-benchmark, aibench, etc... ).
License-File: LICENSE
Author: filipecosta90
Author-email: filipecosta.90@gmail.com
Requires-Python: >=3.10.0,<4.0.0
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Programming Language :: Python :: 3.15
Requires-Dist: Flask (>=2.0.1,<3.0.0)
Requires-Dist: Flask-HTTPAuth (>=4.4.0,<5.0.0)
Requires-Dist: GitPython (>=3.1.12,<4.0.0)
Requires-Dist: Jinja2 (>=3.0.3,<4.0.0)
Requires-Dist: PyYAML (>=6.0.1,<7.0.0)
Requires-Dist: boto3 (>=1.13.24,<2.0.0)
Requires-Dist: certifi (>=2021.10.8,<2025.0.0)
Requires-Dist: daemonize (>=2.5.0,<3.0.0)
Requires-Dist: flask-restx (>=0.5.1,<0.6.0)
Requires-Dist: humanize (>=4.0.0,<5.0.0)
Requires-Dist: jsonpath_ng (>=1.5.2,<2.0.0)
Requires-Dist: matplotlib (>=3.9.0,<4.0.0)
Requires-Dist: numpy (>=2.0.0,<3.0.0)
Requires-Dist: pandas (>=2.1.2,<3.0.0)
Requires-Dist: paramiko (>=2.7.2,<4.0.0)
Requires-Dist: psutil (>=5.6.6,<6.0.0)
Requires-Dist: pyWorkFlow (>=0.0.2,<0.0.3)
Requires-Dist: py_cpuinfo (>=5.0.0,<6.0.0)
Requires-Dist: pygithub (>=1.57,<2.0)
Requires-Dist: pysftp (>=0.2.9,<0.3.0)
Requires-Dist: pytablewriter[html] (>=0.64.1,<0.65.0)
Requires-Dist: python_terraform (>=0.10.1,<0.11.0)
Requires-Dist: redis (>=4.2.2,<5.0.0)
Requires-Dist: requests (>=2.32.3,<3.0.0)
Requires-Dist: slack-bolt (>=1.13.0,<2.0.0)
Requires-Dist: slack-sdk (>=3.15.2,<4.0.0)
Requires-Dist: sshtunnel (>=0.4.0,<0.5.0)
Requires-Dist: toml (>=0.10.1,<0.11.0)
Requires-Dist: tqdm (>=4.46.1,<5.0.0)
Requires-Dist: watchdog (>=2.1.6,<3.0.0)
Requires-Dist: wget (>=3.2,<4.0)
Description-Content-Type: text/markdown

[![codecov](https://codecov.io/gh/redis-performance/redisbench-admin/branch/master/graph/badge.svg)](https://codecov.io/gh/redis-performance/redisbench-admin)
![Actions](https://github.com/redis-performance/redisbench-admin/workflows/Run%20Tests/badge.svg?branch=master)
![Actions](https://badge.fury.io/py/redisbench-admin.svg)

# [redisbench-admin](https://github.com/redis-performance/redisbench-admin)

Redis benchmark run helper can help you with the following tasks:

- Setup abd teardown of benchmarking infrastructure specified
  on [redis-performance/testing-infrastructure](https://github.com/redis-performance/testing-infrastructure)
- Setup and teardown of an Redis and Redis Modules DBs for benchmarking
- Management of benchmark data and specifications across different setups
- Running benchmarks and recording results
- Exporting performance results in several formats (CSV, RedisTimeSeries, JSON)
- Finding on-cpu, off-cpu, io, and threading performance problems by attaching profiling tools/probers ( perf (a.k.a. perf_events), bpf tooling, vtune )
- **[SOON]** Finding performance problems by attaching telemetry probes

Current supported benchmark tools:

- [redis-benchmark](https://github.com/redis/redis)
- [memtier_benchmark](https://github.com/RedisLabs/memtier_benchmark)
- [redis-benchmark-go](https://github.com/redis-performance/redis-benchmark-go)
- [YCSB](https://github.com/RediSearch/YCSB)
- [tsbs](https://github.com/RedisTimeSeries/tsbs)
- [redisgraph-benchmark-go](https://github.com/RedisGraph/redisgraph-benchmark-go)
- [ftsb_redisearch](https://github.com/RediSearch/ftsb)
- [ann-benchmarks](https://github.com/RedisAI/ann-benchmarks)

Remote SSH connections retry transient connection failures (e.g. a refused
connection or a brief host outage) up to `SSH_CONNECT_MAX_RETRIES` times
(default 5), waiting 1, 2, 4, ... seconds between attempts. Each attempt is
bounded by `SSH_CONNECT_TIMEOUT` seconds (default 30), so an unreachable host
fails after about 3.5 minutes with the defaults; refused connections fail
immediately and only pay the backoff (31 seconds). Only opening the connection is
retried, before any remote command runs, so setup steps and benchmark
measurements are never replayed. Authentication errors are not retried.
Fetching result files retries transient SSH/SFTP errors the same way, up to
`SSH_FETCH_MAX_RETRIES` times (default 3).

## Installation

Installation is done using pip, the package installer for Python, in the following manner:

```bash
python3 -m pip install redisbench-admin
```

## Profiler daemon

You can use the profiler daemon by itself in the following manner. 
On the target machine do as follow:

```bash
pip3 install --upgrade pip
pip3 install redisbench-admin --ignore-installed PyYAML

# install perf
apt install linux-tools-common linux-tools-generic linux-tools-`uname -r` -y

# ensure perf is working
perf --version

# install awscli
snap install aws-cli --classic


# configure aws
aws configure

# start the perf-daemon
perf-daemon start
WARNING:root:Unable to detected github_actor. caught the following error: No section: 'user'
Writting log to /tmp/perf-daemon.log
Starting perf-daemon. PID file /tmp/perfdaemon.pid. Daemon workdir: /root/RedisGraph

# check daemon is working appropriatelly
curl localhost:5000/ping

# start a profile
curl -X POST localhost:5000/profiler/perf/start/<pid to profile>

# stop a profile
curl -X POST -d '{"aws_access_key_id":$AWS_ACCESS_KEY_ID,"aws_secret_access_key":$AWS_SECRET_ACCESS_KEY}' localhost:5000/profiler/perf/stop/<pid to profile>
```


## Development

1. Install [pypoetry](https://python-poetry.org/) to manage your dependencies and trigger tooling.
```sh
pip install poetry
```

2. Installing dependencies from lock file

```
poetry install
```

### Running formaters

```sh
poetry run black .
```


### Running linters

```sh
poetry run flake8
```


### Running tests

A test suite is provided, and can be run with:

```sh
$ tox
```

To run a specific test:
```sh
$ tox -- tests/test_defaults_purpose_built_env.py
```

To run a specific test and persist the docker container used for timeseries:

```
tox  --docker-dont-stop=rts_datasink  -- -vv --log-cli-level=INFO  tests/test_defaults_purpose_built_env.py 
```

To run a specific test with verbose logging:

```sh
# tox -- -vv --log-cli-level=INFO tests/test_run.py
```

## License

redisbench-admin is distributed under the BSD3 license - see [LICENSE](LICENSE)

