diff --git a/README.md b/README.md index bfb225e..11100ea 100644 --- a/README.md +++ b/README.md @@ -1,31 +1,26 @@ - + +```markdown # bench plugin ### Docker Run -Run the Docker image using the `docker run` command. I'll provide examples for different scenarios: +Run the Docker image using the `docker run` command. Here are examples adjusted for the new environment variables: 1. **Testing a Single URL:** ```bash - docker run -e TARGET_URLS="http://example.com" -e MAX_TIME=1 -e VARIANCE=2 -e TEST_MODE="report" git.nixc.us/colin/bench:production + docker run -e URLS="http://example.com" -e USERNAME="user" -e PASSWORD="pass" git.nixc.us/colin/bench:production ``` 2. **Testing Multiple URLs:** ```bash - docker run -e TARGET_URLS="http://example.com,http://example2.com" -e MAX_TIME=1 -e VARIANCE=2 -e TEST_MODE="report" git.nixc.us/colin/bench:production - ``` - -3. **Using Fail-Fast Mode:** - - ```bash - docker run -e TARGET_URLS="http://example.com" -e MAX_TIME=1 -e VARIANCE=2 -e TEST_MODE="fail-fast" git.nixc.us/colin/bench:production + docker run -e URLS="http://example.com,http://example2.com" -e USERNAME="user" -e PASSWORD="pass" git.nixc.us/colin/bench:production ``` ### Docker Compose -Example `docker-compose.yml` file that sets up the same configuration: +Example `docker-compose.yml` file adjusted for the new script: ```yaml version: '3' @@ -34,16 +29,15 @@ services: apachebench: image: git.nixc.us/colin/bench:production environment: - TARGET_URLS: "http://example.com,http://example2.com" # Comma-separated list of URLs - MAX_TIME: 1 # Maximum acceptable response time - VARIANCE: 2 # Acceptable time variance - TEST_MODE: "report" # Can be "report" or "fail-fast" - NUM_REQUESTS: 500 # Number of requests to perform - CONCURRENCY: 20 # Number of multiple requests to make at a time + URLS: "http://example.com,http://example2.com" # Comma-separated list of URLs + USERNAME: "user" # Basic auth username + PASSWORD: "pass" # Basic auth password + REQUESTS: 100 # Number of requests for Apache Bench + CONCURRENCY: 10 # Number of multiple requests to make at a time ``` -Run the service defined in the `docker-compose.yml` file, use: +Run the service defined in the `docker-compose.yml` file with: ```bash docker-compose up @@ -51,11 +45,12 @@ docker-compose up ### Customizing the Configuration -You can modify the `TARGET_URLS`, `MAX_TIME`, `VARIANCE`, and `TEST_MODE` environment variables to suit your specific testing needs. Here's what each variable represents: +Adjust the `URLS`, `USERNAME`, `PASSWORD`, `REQUESTS`, and `CONCURRENCY` environment variables to meet your testing needs. Here's the purpose of each: -- `TARGET_URLS`: A comma-separated list of URLs to test. -- `MAX_TIME`: The target maximum response time in seconds. -- `VARIANCE`: The acceptable variance in response time in seconds. -- `TEST_MODE`: The mode of operation, either `report` to test all URLs regardless of individual results, or `fail-fast` to stop testing as soon as a URL fails the performance criteria. +- `URLS`: Comma-separated list of URLs to test. +- `USERNAME` and `PASSWORD`: Credentials for HTTP Basic Authentication. +- `REQUESTS`: Number of requests to perform with Apache Bench. +- `CONCURRENCY`: Number of multiple requests to make at a time. -This setup allows you to run performance tests in a Docker environment, providing an automated way to benchmark and analyze the performance of various web services. \ No newline at end of file +This setup allows you to run authenticated performance tests in a Docker environment, offering an automated approach to benchmarking and analyzing the performance of web services. +``` \ No newline at end of file