Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Scenarios documentation #49

Merged
merged 25 commits into from
Jul 14, 2020
Merged
Show file tree
Hide file tree
Changes from 9 commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 30 additions & 1 deletion src/data/markdown/docs/01 guides/02 Using k6/05 Options.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ Options allow you to configure how k6 will behave during test execution.
| [Config](#config) | Specify the config file in JSON format to read the options values |
na-- marked this conversation as resolved.
Show resolved Hide resolved
| [Discard Response Bodies](#discard-response-bodies) | Specify if response bodies should be discarded |
| [Duration](#duration) | A string specifying the total duration a test run should be run for |
na-- marked this conversation as resolved.
Show resolved Hide resolved
| [Execution Segment](#execution-segment) | Limit execution to a segment of the total test |
| [Extension Options](#extension-options) | An object used to set configuration options for third-party collectors |
| [Hosts](#hosts) | An object with overrides to DNS resolution |
| [HTTP Debug](#http-debug) | Log all HTTP requests and responses |
Expand Down Expand Up @@ -316,6 +317,34 @@ export let options = {
</div>


<h3 id="execution-segment">Execution Segment</h3>

> _New in v0.27.0_

These options specify how to partition the test run and which segment to run.
If defined, k6 will scale the number of VUs and iterations to be run for that
segment, which is useful in distributed execution. Available in `k6 run` and
`k6 cloud` commands.

| Env | CLI | Code / Config file | Default |
|-----|--------------------------------|----------------------------|---------|
| N/A | `--execution-segment` | `executionSegment` | `"0:1"` |
| N/A | `--execution-segment-sequence` | `executionSegmentSequence` | `"0,1"` |

For example, to run 25% of a test, you would specify `--execution-segment '25%'`,
which would be equivalent to `--execution-segment '0:1/4'`, i.e. run the first
1/4 of the test.
To ensure that each instance executes a specific segment, also specify the full
segment sequence, e.g. `--execution-segment-sequence '0,1/4,1/2,1'`.
This way one instance could run with `--execution-segment '0:1/4'`, another with
`--execution-segment '1/4:1/2'`, etc. and there would be no overlap between them.

In v0.27.0 this distinction is not very important, but it will be required
in future versions when support for test data partitioning is added.

<!-- TODO: Add more examples, link to a standalone page? -->


<h3 id="hosts">Hosts</h3>

An object with overrides to DNS resolution, similar to what you can do with `/etc/hosts` on
Expand Down Expand Up @@ -775,7 +804,7 @@ CLI. Available in `k6 run` and `k6 cloud` commands

| Env | CLI | Code / Config file | Default |
|------------------|-----------------|--------------------|--------------------------------------------------------------------------------------------------|
| `K6_SYSTEM_TAGS` | `--system-tags` | `systemTags` | `proto`, `subproto`, `status`, `method`, `url`, `name`, `group`, `check`, `error`, `tls_version` |
| `K6_SYSTEM_TAGS` | `--system-tags` | `systemTags` | `proto`, `subproto`, `status`, `method`, `url`, `name`, `group`, `check`, `error`, `tls_version`, `scenario` |

<div class="code-group" data-props='{"labels": [], "lineNumbers": [true]}'>

Expand Down
Loading