castelislogice/tsung

By castelislogice

Updated almost 5 years ago

Tsung - Stress test tool - Docker Image (Multiarch)

Image

1.4K

Tsung - Docker Image

Docker PullsDocker StarsPayPal donationBuy me a coffeeBecome a Patron

Prerequisites

Initializing container

docker run -d --name tsung -v /path/to/local/folder/for/scenario:/root/.tsung/ -p 8090:8090 -p 8091:8091 castelislogice/tsung 

This will create a container with a running Tsung instance. You can then call docker stop tsung to stop it.

Preparing scenario

  1. Starting scenario recorder

Launch this command to start router to listen to your scenario

docker exec tsung tsung-recorder start

This will create a new scenario in your /path/to/local/folder/for/scenario defined in initialization.

  1. Configure router

In your browser, configure proxy for all your calls (usually : Settings > Network > Proxy) with these values :

  • host : localhost
  • port : 8090
  1. Write scenario

To write your scenario, just navigate though your website. Each action will be grabbed by the Tsung router and added to the scenario. Once finished, stop the record

Important note : Tsung cannot handle HTTPS request through HTTPS protocol. Replace it to http://- instead.

E.g. https://www.google.com -> http://-www.google.com

  1. Stop scenario recorder
docker exec tsung tsung-recorder stop

Your scenario is now written in your folder!

Running benchmark

Just run this command

docker exec tsung tsung start

By default, it reads tsung.xml but you can use :

docker exec tsung tsung start -f <scenario>

with <scenario> the file of your scenario to test.

When running, you can check the dashboard right here http://localhost:8091

Generating export

When everything went fine for your tests, You'll probably want to see graph report on your stats.

Just run this command to generate a report:

docker exec tsung tsung-report <log_file>

With <log_file> optional parameter to your log folder session. By default, it reads the latest folder in you log directory.

For example, for log ./log/20170609-1623, just precise 20170609-1623

Docker Pull Command

docker pull castelislogice/tsung