-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
129 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
--------- | ||
Use Cases | ||
--------- | ||
|
||
.. | ||
.. toctree:: | ||
:hidden: | ||
Stressor may be used for several tasks. | ||
Currently we focus on web applications. | ||
|
||
Following a few recommendations, for a start. | ||
|
||
|
||
Stress Tests | ||
============ | ||
|
||
- Define a script that covers relevant functionality of your target application. | ||
- Use ``duration: SECONDS`` and/or ``repeat: COUNT`` options for sequences, | ||
so we have a long-running test. | ||
- Define ``sessions.users`` and ``sessions.count``, to simulate parallel user | ||
access. | ||
- Optionally define ``monitor: true`` for selected activities, to collect extra | ||
statistics. | ||
- Pass ``--monitor`` to view live proogress. | ||
|
||
|
||
CI Tests | ||
======== | ||
|
||
Run stressor as part of a continous integration workflow, e.g. inside Jenkins. | ||
|
||
- Define a script that covers important functionality of your target application. | ||
- Set the ``config.max_errors: 1`` option (or pass the``--max-errors=1`` argument), | ||
so the script will abort in case of errors as soon as possible. | ||
- Set the ``config.max_errors=SECONDS`` option (or pass the ``--max-errors=SECONDS`` | ||
argument), so unexpectedly long execution times will generate errors. |br| | ||
Of course the sequences should not be time constrained using the | ||
``duration: SECONDS`` option for sequences in this case. | ||
- Pass ``--log FOLDER`` so results can be reviewed later. | ||
- Pass ``--verbose`` (``-v``) so logging will contain useful additional information. | ||
|
||
|
||
Benchmarks | ||
========== | ||
|
||
- Pass ``--quiet`` (``-q``), so logging will not impact performance. | ||
- Set the ``config.max_errors: 1`` option (or pass the``--max-errors=1`` argument), | ||
so we fail fast on errors (unless sporadic errors are tolerated). | ||
- Define a script that runs for a given time, for example using the | ||
``duration: SECONDS`` option for sequences. |br| | ||
Take note of 'activities per second per session' in the summary. | ||
- Or define a script that runs a number of sequences, for example using the | ||
``repeat: COUNT`` option for sequences. |br| | ||
Take note of 'run time' in the summary. | ||
- Optionally define ``monitor: true`` for selected activities, to collect extra | ||
statistics. | ||
|
||
|
||
Developing and Debugging Scripts | ||
================================ | ||
|
||
- Pass ``--single`` so ``duration`` and ``repeat`` options are ignored. | ||
- Pass ``--verbose`` (``-v``) or even ``-vv`` to print more information about | ||
requests and responses. | ||
- Set the ``config.max_errors: 1`` option (or pass the``--max-errors=1`` argument), | ||
so we fail on the first error. | ||
- Optionally define ``debug: true`` for selected activities, to print extra | ||
information. | ||
|
||
See `ug_writing_scripts`_ for details. | ||
|
||
|
||
Test Other Targets than Web-Applications | ||
======================================== | ||
|
||
For example run a sequence of SQL statements against relational databases. | ||
|
||
This is **not yet implemented**, but should become possible using the plugin | ||
concept of a later version. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
file_version: stressor#0 | ||
|
||
config: | ||
name: Test no-op | ||
tag: Not set (pass `-o tag:TAG_NAME` to override) | ||
details: | | ||
Contains only one sleep(0) activity. Use to benchmark max. throughput | ||
of the stressor framework | ||
verbose: 3 | ||
base_url: http://127.0.0.1:8082 | ||
timeout: 1 | ||
# max_time: 3.2 | ||
|
||
context: | ||
|
||
sessions: | ||
users: $load(users.yaml) | ||
count: 10 | ||
# basic_auth: true | ||
# threads_per_process: 5 | ||
# duration: 5 | ||
|
||
# Define what actions should be performed by every session | ||
scenario: | ||
- sequence: init | ||
- sequence: main | ||
duration: 30 | ||
- sequence: end | ||
|
||
|
||
# List of named action sequences. Used as building blocks for scenarios | ||
sequences: | ||
# 'init' is the reserved name for the set-up sequence. | ||
init: | ||
|
||
main: | ||
- activity: $sleep(0.0) | ||
|
||
end: |