Skip to content

Commit a3f60ef

Browse files
[fix] minor typos and formatting
1 parent e9a9d72 commit a3f60ef

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

src/data/markdown/docs/05 Examples/01 Examples/24 distribute-workloads.md

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ k6 can schedule different load patterns for different VU functions.
88
A test with multiple workloads might better simulate traffic in the real world, where user behavior is rarely uniform.
99
For example, most traffic to an e-commerce site might come from users who only search for items and read reviews. A small percentage of users might actively shop, performing actions that involve writes to the database and calls to different APIs.
1010

11-
1211
The following sections provide examples of how to structure k6 scripts to split logic across VUs.
1312
To inspect the results for a certain behavior, you can [create a custom metric](/using-k6/metrics/create-custom-metrics) or use [Tags](/using-k6/tags-and-groups) to filter by scenario, code block, or individual request.
1413

@@ -19,7 +18,6 @@ However, more complexity creates more ambiguity in result interpretation
1918

2019
</Blockquote>
2120

22-
2321
## Split logic across scenarios
2422

2523
<Blockquote mod="note" title="">
@@ -28,7 +26,6 @@ In this context, _workload_ refers to the traffic pattern simulated by a scenari
2826

2927
</Blockquote>
3028

31-
3229
One way to distribute traffic is to use scenarios to schedule different workloads for different functions.
3330
1. Define multiple scenarios in your [options](/using-k6/options).
3431
1. Use the scenario `exec` property to execute different VU functions with a workload.
@@ -88,11 +85,11 @@ if (exec.vu.idInTest <= 25) {
8885
```
8986
9087
91-
For more flexibility, you can use modulo expressions distribute VUs according to percentages.
88+
For more flexibility, you can use modulo expressions to distribute VUs according to percentages.
9289
For example, the following script distributes logic according to different user profiles:
9390
- 40 percent of users check the news.
9491
- 60 percent play a coinflip game.
95-
- Half bet `heads` and half bet `tails`.
92+
- Half bet `heads`, and half bet `tails`.
9693
9794
<CodeGroup labels={["behavior-based-on-exec-context.js"]} lineNumbers={[true]} showCopyButton={[true]}>
9895
@@ -128,14 +125,12 @@ export default function () {
128125
http.get("http://test.k6.io/flip_coin.php?bet=tails");
129126
}
130127
}
131-
132128
```
133129
134130
To view results for a specific request or group, you can define [tags](/using-k6/tags-and-groups).
135131
136132
</CodeGroup>
137133
138-
139134
## Randomize behavior
140135
141136
To add a degree of random behavior, consider one of the randomizing functions from the [k6 utils](https://k6.io/docs/javascript-api/jslib/utils/).

0 commit comments

Comments
 (0)