Update configuration.rst

reviewed till Modules section
This commit is contained in:
nnugumanov 2013-09-29 21:13:40 +04:00
parent 6b7e6eaa20
commit 9d233a5ecc

View File

@ -8,21 +8,19 @@ There are three executables in Yandex.Tank package: ``yandex-tank``,
``yandex-tank-ab`` и ``yandex-tank-jmeter``. Last two of them just use ``yandex-tank-ab`` и ``yandex-tank-jmeter``. Last two of them just use
different king of load gen utilities, ``ab`` (Apache Benchmark) and different king of load gen utilities, ``ab`` (Apache Benchmark) and
``jmeter`` (Apache JMeter), accordingly. Command line options are common ``jmeter`` (Apache JMeter), accordingly. Command line options are common
for all three: \* **-h, --help** - show command line options \* **-c for all three.
CONFIG, --config=CONFIG** - read options from INI file. It is possible
to set multiple INI files by specifying the option serveral times. - **-h, --help** - show command line options
Default: ``./load.conf`` \* **-i, --ignore-lock** - ignore lock files \* - **-c CONFIG, --config=CONFIG** - read options from INI file. It is possible to set multiple INI files by specifying the option serveral times. Default: ``./load.conf``
**-f, --fail-lock** - don't wait for lock file, quit if it's busy. The - **-i, --ignore-lock** - ignore lock files
default behaviour is to wait for lock file to become free. \* **-l LOG, - **-f, --fail-lock** - don't wait for lock file, quit if it's busy. The default behaviour is to wait for lock file to become free.
--log=LOG** - main log file location. Default: ``./tank.log`` \* **-n, - **-l LOG, --log=LOG** - main log file location. Default: ``./tank.log``
--no-rc** - don't read ``/etc/yandex-tank/*.ini`` and ``~/.yandex-tank`` - **-n, --no-rc** - don't read ``/etc/yandex-tank/*.ini`` and ``~/.yandex-tank``
\* **-o OPTION, --option=OPTION** - set an option from command line. - **-o OPTION, --option=OPTION** - set an option from command line. Options set in cmd line override those have been set in configuration files. Multiple times for multiple options. Format: ``<section>.<option>=value`` Example: ``yandex-tank -o "console.short_only=1" --option="phantom.force_stepping=1"``
Options set in cmd line override those have been set in configuration - **-s SCHEDULED_START, --scheduled-start=SCHEDULED_START** - run test on specified time, date format YYYY-MM-DD hh:mm:ss or hh:mm:ss
files. Multiple times for multiple options. Format: - **-q, --quiet** - only print WARNINGs and ERRORs to console
``<section>.<option>=value`` Example: - **-v, --verbose** - print ALL messages to console. Chatty mode
``yandex-tank -o "console.short_only=1" --option="phantom.force_stepping=1"``
\* **-q, --quiet** - only print WARNINGs and ERRORs to console \* **-v,
--verbose** - print ALL messages to console. Chatty mode
Add an ammo file name as a nameless parameter, e.g.: Add an ammo file name as a nameless parameter, e.g.:
``yandex-tank ammo.txt`` ``yandex-tank ammo.txt``
@ -32,10 +30,18 @@ Advanced configuration
Configuration files organized as standard INI files. Those are files Configuration files organized as standard INI files. Those are files
partitioned into named sections that contain 'name=value' records. For partitioned into named sections that contain 'name=value' records. For
example: \`\`\` [phantom] address=target-mulca.targetnets.yandex.ru:8080 example:
rps\_schedule=const(100,60s)
[autostop] autostop=instances(80%,10) \`\`\` A common rule: options with ::
[phantom]
address=example.com:80
rps_schedule=const(100,60s)
[autostop]
autostop=instances(80%,10)
A common rule: options with
same name override those set before them (in the same file or not). same name override those set before them (in the same file or not).
Default configuration files Default configuration files
@ -51,48 +57,75 @@ The ``DEFAULT`` section
^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^
One can use a **magic** ``DEFAULT`` section, that contains global One can use a **magic** ``DEFAULT`` section, that contains global
options. Those options are in charge for every section: \`\`\` options. Those options are in charge for every section:
[autostop] autostop=time(1,10)
[console] short\_only=1 ::
[aggregator] time\_periods=10 20 30 100 [autostop]
autostop=time(1,10)
[console]
short_only=1
[aggregator]
time_periods=10 20 30 100
[meta]
job_name=ask
[meta] job\_name=ask ``is an equivalent for:`` [DEFAULT] is an equivalent for:
autostop=time(1,10) short\_only=1 time\_periods=10 20 30 100
job\_name=ask \`\`\` !!! Don't use global options wich have same name in
different sections.
The ``web`` section ::
^^^^^^^^^^^^^^^^^^^^^^^
Here are default options, controlling a yandex tank's web frontend:: [DEFAULT]
autostop=time(1,10)
short_only=1
time_periods=10 20 30 100
job_name=ask
!!! Don't use global options wich have same name in different sections.
[web]
port = 8080 # a port to bind to on localhost
interval = 1m # ???
redirect = "" # does nothing except 2 seconds delay on exit
# if 'yes', then webserver will wait for Enter from keyboard
# to exit
manual_stop = 0
Multiline options Multiline options
^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^
Use indent to show that a line is a continuation of a previous one: Use indent to show that a line is a continuation of a previous one:
``[autostop] autostop=time(1,10) http(404,1%,5s) net(xx,1,30)``
**Ask Yandex.Tank developers to add multiline capability for options ::
where you need it!**
[autostop]
autostop=time(1,10)
http(404,1%,5s)
net(xx,1,30)
*Ask Yandex.Tank developers to add multiline capability for options
where you need it!*
Time units Time units
^^^^^^^^^^ ^^^^^^^^^^
Time units encoding is as following: \* ``ms`` = millisecons \* ``s`` = Time units encoding is as following:
seconds \* ``m`` = minutes \* ``h`` = hours Default time unit is a
millisecond. For example, ``30000 == 30s``
* ``ms`` = millisecons \
* ``s`` = seconds \
* ``m`` = minutes \
* ``h`` = hours
Default time unit is a millisecond. For example, ``30000 == 30s``
``time(30000,120)`` is an equivalent to ``time(30s,2m)`` You can also ``time(30000,120)`` is an equivalent to ``time(30s,2m)`` You can also
mix them: ``1h30m15s`` or ``2s15ms`` mix them: ``1h30m15s`` or ``2s15ms``. If somewhere it is not supported - report a bug, please.
Shell-options
^^^^^^^^^^
Option value with backquotes is evaluated in shell, for example
::
[meta]
job_name=`pwd`
Artifacts Artifacts
~~~~~~~~~ ~~~~~~~~~
@ -100,8 +133,8 @@ Artifacts
As a result Yandex.Tank produces some files (logs, results, configs As a result Yandex.Tank produces some files (logs, results, configs
etc). Those files are placed with care to the **artifact directory**. An etc). Those files are placed with care to the **artifact directory**. An
option for that is ``artifacts_base_dir`` in the ``tank`` section. It is option for that is ``artifacts_base_dir`` in the ``tank`` section. It is
recommended to set it to a convinient place, for example, recommended to set it to a convenient place, for example,
``~/yandex-tank-artifacts``, it would be easier to manage the artifacts ``~/yandex-tank-artifacts``; it would be easier to manage the artifacts
there. there.
Modules Modules