Skip to content

Commit

Permalink
documentation samples update to yaml and appropriate examples
Browse files Browse the repository at this point in the history
  • Loading branch information
netort committed Feb 21, 2018
1 parent fa6e7ec commit a70c1dd
Show file tree
Hide file tree
Showing 3 changed files with 107 additions and 86 deletions.
36 changes: 18 additions & 18 deletions docs/configuration.rst
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,9 @@ Example:
load_type: rps
schedule: const(100,60s)
autostop:
autostop:|
instances(80%,10)
time(1s,10s)
autostop:
- instances(80%,10)
- time(1s,10s)
.. note::
A common rule: options with the
Expand All @@ -102,10 +102,10 @@ Use indent to show that a line is a continuation of a previous one:
.. code-block:: yaml
autostop:
autostop:|
time(1,10)
http(404,1%,5s)
net(xx,1,30)
autostop:
- time(1,10)
- http(404,1%,5s)
- net(xx,1,30)
.. note::

Expand Down Expand Up @@ -160,21 +160,21 @@ load.yaml example
.. code-block:: yaml
phantom:
address: "[fe80::200:f8ff:fe21:67cf]:8080"
address: "ya.ru:80"
instances: 1000
load_profile:
load_type: rps
schedule: const(1,30) line(1,1000,2m) const(1000,5m)
header_http: 1.1
uris:|
/
/test
/test2
headers:|
[Host: www.ya.ru]
[Connection: close]
header_http: "1.1"
uris:
- "/"
- "/test"
- "/test2"
headers:
- "[Host: www.ya.ru]"
- "[Connection: close]"
autostop:
autostop:
autostop:|
http(5xx,10%,5s)
- http(5xx,10%,5s)
112 changes: 65 additions & 47 deletions docs/core_and_modules.rst
Original file line number Diff line number Diff line change
Expand Up @@ -165,29 +165,42 @@ Basic options
:ammofile:
Ammo file path (ammo file is a file containing requests that are to be sent to a server. Could be gzipped).

:rps_schedule:
Load schedule in terms of RPS.
:load_profile:
Load profile behaviour. Specify load_type (`rps`, schedule load by defining requests per second or `instances`
- schedule load defining concurrent active threads) and schedule.

.. code-block:: yaml
phantom:
address: [hostname]:port
load_profile:
load_type: rps #
schedule: line(1, 10, 10m) # starting from 1rps growing linearly to 10rps during 10 minutes

:instances:
Max number of instances (concurrent requests).

:instances_schedule:
Load schedule in terms of number of instances.

:loop:
Number of times requests from ammo file are repeated in loop.

:ammo_limit:
Limit request number.

:autocases:
Enable marking requests automatically. ``autocases = 2`` means 2 uri path elements will be used. I.e ``/hello/world/please/help`` will produce case ``_hello_world``
Enable marking requests automatically. ``autocases: 2`` means 2 uri path elements will be used. I.e ``/hello/world/please/help`` will produce case ``_hello_world``


:chosen_cases:
Use only selected cases.

There are 3 ways to constrain requests number: by schedule with ``rps_schedule``, by requests number with ``ammo_limit`` or by loop number with ``loop`` option. Tank stops if any constraint is reached. If stop reason is reached ``ammo_limit`` or ``loop`` it will be mentioned in log file. In test without ``rps_schedule`` file with requests is used one time by default.
There are 3 ways to constrain requests number:
* by load_type `rps` and `schedule`,
* by requests number with `ammo_limit`
* by loop number with `loop` option.

Tank stops if any constraint is reached.
If stop reason is reached `ammo_limit` or `loop` it will be mentioned in log file.
In test without load_type `rps` ammofile with requests used once by default.

Additional options
^^^^^^^^^^^^^^^^^^
Expand Down Expand Up @@ -225,11 +238,6 @@ Additional options

Format: ``[host]:port``, ``[ipv4]:port``, ``[ipv6]:port``. Tank checks each test if port is available.

:port (deprecated, use ``address``):
Port of target.

Default: ``80``.

:gatling_ip:
Use multiple source addresses. List, divided by spaces.

Expand All @@ -254,13 +262,16 @@ URI-style options
:uris:
URI list, multiline option.
:headers:
HTTP headers list in the following form: ``[Header: value]``, multiline option.
HTTP headers list in the following form: `[Header: value]`.
:header\_http:
HTTP version.

Default: ``1.0``

Available options: ``1.0`` and ``1.1``. ``2.0`` is NOT supported by this load generator.
Available options: ``1.0`` and ``1.1``.

.. note::
HTTP/2.0 is NOT supported by this load generator. Use Pandora or BFG.

stpd-file cache options
^^^^^^^^^^^^^^^^^^^^^^^
Expand Down Expand Up @@ -330,7 +341,7 @@ Advanced options
:affinity:
Set a phantom's CPU affinity.

Example: ``0-3`` enabling first 4 cores, '0,1,2,16,17,18' enabling 6 cores.
Example: `0-3` enabling first 4 cores, '0,1,2,16,17,18' enabling 6 cores.

Default: empty.

Expand All @@ -339,7 +350,7 @@ TLS/SSL additional options
^^^^^^^^^^^^^^^^^^^^^^^^^^

.. note::
``ssl=1`` is required
`ssl: 1` is required

:client_cipher_suites:
Cipher list, consists of one or more cipher strings separated by colons (see man ciphers).
Expand Down Expand Up @@ -406,40 +417,47 @@ Artifacts
Multi-tests
-----------

To make several simultaneous tests with phantom, add proper amount of sections with names ``phantom-_N_``. All subtests are executed in parallel. Multi-test ends as soon as one subtest stops.
To make several simultaneous tests with phantom, add proper amount of sections to special section `multi` for `phantom`
with names ``phantom-N``. All subtests are executed in parallel. Multi-test ends as soon as one subtest stops.

Example:

::

[phantom]
phantom_path=phantom
ammofile=data/dummy.ammo
instances=10
instances_schedule=line(1,10,1m)
loop=1
use_caching=1

[phantom-1]
uris=/
/test
/test2
headers=[Host: www.ya.ru]
[Connection: close]
rps_schedule=const(1,30) line(1,1000,2m) const(1000,5m)
address=fe80::200:f8ff:fe21:67cf
port=8080
ssl=1
timeout=15
instances=3
gatling_ip=127.0.0.1 127.0.0.2
phantom_http_line=123M

[phantom-2]
uris=/3
rps_schedule=const(1,30) line(1,50,2m) const(50,5m)

Options that apply only for main section: buffered_seconds, writelog, phantom_modules_path, phout_file, config, eta_file, phantom_path
.. code-block:: yaml
phantom:
address: hostname:port
load_profile:
load_type: rps
schedule: const(1,30s)
uris:
- /
autocases: 1
multi:
- phantom-1:
address: hostname1:port1
load_profile:
load_type: rps
schedule: const(1,10s)
uris:
- /123
- /321
ssl: 1
autocases: 1
- phantom-2:
address: hostname2:port2
load_profile:
load_type: rps
schedule: const(1,10s)
uris:
- /123
- /321
ssl: 1
autocases: 1
telegraf:
enabled: false
Options that apply only for main section:
`buffered_seconds`, `writelog`, `phantom_modules_path`, `phout_file`, `config`, `eta_file`, `phantom_path`

JMeter
======
Expand Down
45 changes: 24 additions & 21 deletions docs/tutorial.rst
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,9 @@ have following lines:
load_profile:
load_type: rps
schedule: const(10, 10m)
uris:
- "/uri1"
- "/uri2"
telegraf:
enabled: false # let's disable telegraf monitoring for this time
Expand Down Expand Up @@ -139,10 +142,10 @@ where /tmp/access.log is a path to access.log file.
load_profile:
load_type: rps
schedule: line(1, 10, 10m)
header_http: '1.1'
headers: |
[Host: www.target.example.com]
[Connection: close]
header_http: "1.1"
headers:
- "[Host: www.target.example.com]"
- "[Connection: close]"
ammofile: /tmp/access.log
ammo_type: access
telegraf:
Expand All @@ -165,15 +168,15 @@ Update configuration file with HTTP headers and URIs:
load_profile:
load_type: rps
schedule: line(1, 10, 10m)
header_http: '1.1'
headers: |
[Host: www.target.example.com]
[Connection: close]
uris: |
/
/buy
/sdfg?sdf=rwerf
/sdfbv/swdfvs/ssfsf
header_http: "1.1"
headers:
- "[Host: www.target.example.com]"
- "[Connection: close]"
uris:
- "/uri1"
- "/buy"
- "/sdfg?sdf=rwerf"
- "/sdfbv/swdfvs/ssfsf"
telegraf:
enabled: false # let's disable telegraf monitoring for this time
Expand Down Expand Up @@ -455,10 +458,10 @@ So, if we want to stop test when all answers in 1 second period are 5xx plus som
load_type: rps
schedule: line(1, 10, 10m)
autostop:
autostop: |
time(1s,10s)
http(5xx,100%,1s)
net(xx,1,30)
autostop:
- time(1s,10s)
- http(5xx,100%,1s)
- net(xx,1,30)
Logging
=======
Expand Down Expand Up @@ -511,10 +514,10 @@ For ``load.yaml`` like this:
schedule: line(1, 10, 10m)
writelog: true
autostop:
autostop: |
time(1,10)
http(5xx,100%,1s)
net(xx,1,30)
autostop:
- time(1,10)
- http(5xx,100%,1s)
- net(xx,1,30)
Results in phout
================
Expand Down

0 comments on commit a70c1dd

Please sign in to comment.