@@ -12,7 +12,8 @@ Follow along to learn how to:
1212With these example snippets, you'll run the test with your machine's resources.
1313But, if you have a k6 Cloud account, you can also use the ` k6 cloud ` command to outsource the test to k6 servers.
1414
15- ## Running local tests
15+ <!-- preserving old anchor --->
16+ ## Run local tests {#running-local-tests}
1617
1718To run a simple local script:
18191 . Copy the following code, paste it into your favorite editor, and save it as ` script.js ` :
@@ -31,7 +32,7 @@ To run a simple local script:
3132
3233 </CodeGroup >
3334
34- 1 . Then, run k6 with this command:
35+ 1 . Run k6 with the following command:
3536
3637 <CodeGroup labels={[ "CLI", "Docker", "Docker in Win PowerShell"] }>
3738
@@ -55,7 +56,7 @@ To run a simple local script:
5556
5657 </CodeGroup >
5758
58- ## Adding more VUs
59+ ## Add VUs {#adding-more-vus}
5960
6061Now run a load test with more than one virtual user and a longer duration:
6162
@@ -77,11 +78,16 @@ PS C:\> cat script.js | docker run --rm -i grafana/k6 run --vus 10 --duration 30
7778
7879_ Running a 30-second, 10-VU load test_
7980
80- k6 works with the concept of _ virtual users_ (VUs), which run your test scripts.
81+ <Blockquote mod =" note " title =" Virtual users " >
82+
83+ k6 runs multiple interations in parellel with _ virtual users_ (VUs).
84+ In general terms, more virtual users means more simulated traffic.
85+
8186VUs are essentially parallel ` while(true) ` loops.
8287Scripts are written in JavaScript, as ES6 modules,
8388so you can break larger tests into smaller pieces or make reusable pieces as you like.
8489
90+ </Blockquote >
8591
8692### The init context and the default function
8793
@@ -90,7 +96,7 @@ For a test to run, you need to have *init code*, which prepares the test, and *V
9096Code in the init context defines functions and configures the test options (like ` duration ` ).
9197
9298Every test also has a ` default ` function.
93- This function defines the entry point for your VUs.
99+ This function defines the logic for your VUs.
94100
95101<CodeGroup labels ={[]} >
96102
@@ -106,13 +112,12 @@ export default function () {
106112
107113Init code runs first and is called only once per VU.
108114On the other hand, default code executes as many times as the test options set.
115+ To learn more, read about [ The test lifecycle] ( /using-k6/test-lifecycle ) .
109116
110- - [ The life cycle of a k6 test] ( /using-k6/test-lifecycle ) .
111-
112- ## Using options
117+ ## Set options {#using-options}
113118
114119Instead of typing ` --vus 10 ` and ` --duration 30s ` each time you run the script,
115- you can include the options in your JavaScript file:
120+ you can set the options in your JavaScript file:
116121
117122<CodeGroup labels={[ "script.js"] } lineNumbers={[ true] }>
118123
@@ -131,7 +136,7 @@ export default function () {
131136
132137</CodeGroup >
133138
134- Then, run the script without those options on the command line :
139+ If you run the script without flags, k6 uses the options defined in the script :
135140
136141<CodeGroup labels={[ "CLI", "Docker", "Docker in Win PowerShell"] }>
137142
@@ -149,7 +154,7 @@ PS C:\> cat script.js | docker run --rm -i grafana/k6 run -
149154
150155</CodeGroup >
151156
152- ## Stages: ramping up/ down VUs
157+ ## Ramp VUs up and down in stages {#stages-ramping-up-down-vus}
153158
154159You can ramp the number of VUs up and down during the test.
155160To configure ramping, use the ` options.stages ` property.
@@ -178,7 +183,7 @@ export default function () {
178183
179184</CodeGroup >
180185
181- For advanced ramping , you can use [ scenarios] ( /using-k6/scenarios ) and the ` ramping-vus ` executor.
186+ For more granular ramp configuration , you can use [ scenarios] ( /using-k6/scenarios ) and the ` ramping-vus ` executor.
182187
183188## Execution modes
184189
0 commit comments