This is a load generator for Opbeans as a Docker container.
It has two primary modes of operation -- either as a stand-alone container which can generate load based on environment variables present at runtime or as a long-running web service which can receive commands to control load-generation over a HTTP REST interface.
Load is generated through invocation of molotov
which is a load-generation tool provided by the Molotov project.
Start the docker container with a list of base URLs to generate load on
> docker run --rm -e OPBEANS_URLS=opbeans-node:http://opbeans-node:3000,opbeans-python:http://opbeans-python:3000 opbeans/opbeans-loadgen
The use of HTTP mode was developed specifically as a load-generation component for use in the APM Integration Test suite.
Specifically, it is designed for use when the suite is launched using the --dyno
flag, which enables user-controlled load-testing with the ability to manipulate the performance constraints of various services at-will.
To run the Opbeans Load Generator in HTTP mode, start the container by defining the environment variable WS
in the context of the running container. Typically, this is done using the -e
flag as shown in the Docker documentation.
When running the Opbeans Load Generator in the APM Integration Test suite with the --dyno
flag, the WS
environment variable will be defined automatically and the container will start in HTTP mode.
The list of HTTP methods and their purpose can be found in the http method overview section.
For further discussion, please see the detailed documentation in the README
that is included in the /dyno
directory.
The simplest way to run all tests for this project is by running:
> make test
Tests are written using BATS under the /tests
dir.
To run the Python tests, one must first install the test requirements:
> pip install requirements-dev.txt
This project includes a pytest test suite which provides a set of unit and functional tests.
To run these tests, both pytest
and the pytest-flask
modules must be installed and available to Python.
Publish the docker image with
> VERSION=1.2.3 make publish
NOTE: VERSION refers to the tag for the docker image which will be published in the registry