Sign inSign up

johnshumon/docker-api-benchmark

By johnshumon

Updated over 9 years ago

A simple tool to load test APIs using api-benchmark and analyse result.

Image
1

356

johnshumon/docker-api-benchmark repository overview

API-BENCHMARK

It's a dockerized tool to load test APIs. Either pull the image using docker pull johnshumon/docker-api-benchmark or build from Dockerfile. Make a directory where test script (e.g. start-test.js) would be in. Once image is built successfully launch the container either with docker-compose file or following command:

docker run --name benchmarker -it -dp 8096:8096 -v `pwd`/test-script:/api-benchmark/test-script api-benchmark

Above command mounts test script directory. Now you can start load-testing your APIs either from inside or outside of the container. Once container is launched execute either one of the following

  1. Commands:

    Get inside the container

    $ docker exec -it benchmarker /bin/sh

    Run the test

    $ /api-benchmark/start-test.js

  2. Command:

    Run the test

    docker exec benchmarker node ./test-script/start-test.js

Number of endpoints to be added and configured with heavy traffic are listed in start-test.js file.

Reports of API load test are browsable through http://<container_host_ip>:8096

LICENSE

MIT

Tag summary

Content type

Image

Digest

Size

20.9 MB

Last updated

over 9 years ago

docker pull johnshumon/docker-api-benchmark