You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/sources/k6/next/testing-guides/automated-performance-testing.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -40,7 +40,7 @@ Without automation, the lack of a shared framework often leads to isolated and s
40
40
41
41
Automation often refers to running tests with pass/fail conditions as part of the release process within CI/CD pipelines. However, not all performance tests are suited for CI/CD workflows, nor are they solely about providing a Pass/Fail (green/red) status and acting as a release gatekeeper.
42
42
43
-
[Automation into CI/CD pipelines](https://grafana.com/docs/k6/<K6_VERSION>/misc/integrations/#continuous-integration-and-continuous-delivery) is an option, but it's not the only method to schedule the execution of performance tests. When creating a performance testing plan, it's important to remember that there are different ways to run performance tests in a frequent basis:
43
+
[Automation into CI/CD pipelines](https://grafana.com/docs/k6/<K6_VERSION>/reference/integrations/#continuous-integration-and-continuous-delivery) is an option, but it's not the only method to schedule the execution of performance tests. When creating a performance testing plan, it's important to remember that there are different ways to run performance tests in a frequent basis:
44
44
45
45
- Cron and cron job runners.
46
46
- Cloud testing tools, such as [scheduling in Grafana Cloud k6](https://grafana.com/docs/grafana-cloud/testing/k6/author-run/schedule-a-test/).
Copy file name to clipboardExpand all lines: docs/sources/k6/next/testing-guides/running-distributed-tests.md
+7-7Lines changed: 7 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -10,15 +10,15 @@ It has already been established that k6 can [run large load tests](https://grafa
10
10
11
11
Several reasons why you may wish to run a distributed test include:
12
12
13
-
- Your [system under test](https://grafana.com/docs/k6/<K6_VERSION>/misc/glossary#system-under-test) (SUT) should be accessed from multiple IP addresses.
13
+
- Your [system under test](https://grafana.com/docs/k6/<K6_VERSION>/reference/glossary#system-under-test) (SUT) should be accessed from multiple IP addresses.
14
14
- A fully optimized node cannot produce the load required by your extremely large test.
15
15
- Kubernetes is already your preferred operations environment.
16
16
17
17
For scenarios such as these, we've created the [k6-operator](https://github.com/grafana/k6-operator).
18
18
19
19
## Introducing k6-operator
20
20
21
-
[k6-operator](https://github.com/grafana/k6-operator) is an implementation of the [operator pattern](https://grafana.com/docs/k6/<K6_VERSION>/misc/glossary#operator-pattern) in Kubernetes, defining [custom resources](https://grafana.com/docs/k6/<K6_VERSION>/misc/glossary#custom-resource) in Kubernetes.
21
+
[k6-operator](https://github.com/grafana/k6-operator) is an implementation of the [operator pattern](https://grafana.com/docs/k6/<K6_VERSION>/reference/glossary#operator-pattern) in Kubernetes, defining [custom resources](https://grafana.com/docs/k6/<K6_VERSION>/reference/glossary#custom-resource) in Kubernetes.
22
22
The intent is to automate tasks that a _human operator_ would normally do; tasks like provisioning new application components, changing configurations, or resolving run-time issues.
23
23
24
24
The k6-operator defines the custom `TestRun` resource type and listens for changes to, or creation of, `TestRun` objects.
@@ -193,7 +193,7 @@ To learn more about creating `PersistentVolume` and `PersistentVolumeClaim` reso
193
193
During [installation](#1-install-the-operator), the `TestRun`[Custom Resource definition](https://kubernetes.io/docs/concepts/extend-kubernetes/api-extension/custom-resources/) was added to the Kubernetes API.
194
194
The data we provide in the custom resource `TestRun` object should contain all the information necessary for the k6-operator to start a distributed load test.
195
195
196
-
Specifically, the main elements defined within the `TestRun` object relate to the name and location of the test script to run, and the amount of [parallelism](https://grafana.com/docs/k6/<K6_VERSION>/misc/glossary#parallelism) to utilize.
196
+
Specifically, the main elements defined within the `TestRun` object relate to the name and location of the test script to run, and the amount of [parallelism](https://grafana.com/docs/k6/<K6_VERSION>/reference/glossary#parallelism) to utilize.
197
197
198
198
{{< admonition type="note" >}}
199
199
@@ -206,7 +206,7 @@ The following examples will show some common variations for the custom resource:
206
206
207
207
### Script in a ConfigMap
208
208
209
-
When the test script to be executed is contained within a `ConfigMap` resource, we specify the script details within the `configMap` block of [YAML](https://grafana.com/docs/k6/<K6_VERSION>/misc/glossary#yaml).
209
+
When the test script to be executed is contained within a `ConfigMap` resource, we specify the script details within the `configMap` block of [YAML](https://grafana.com/docs/k6/<K6_VERSION>/reference/glossary#yaml).
210
210
The `name` is the name of the ConfigMap and the `file` is the key-value for the entry.
211
211
212
212
Let's create the file `run-k6-from-configmap.yaml` with the following content:
@@ -233,7 +233,7 @@ We created the ConfigMap named `my-test`.
233
233
The test script content was added to the map using the filename as the key-value, therefore the `file` value is `test.js`.
234
234
235
235
The amount of `parallelism` is up to you; how many pods do you want to split the test amongst?
236
-
The operator will split the workload between the pods using [execution segments](https://grafana.com/docs/k6/<K6_VERSION>/misc/glossary#execution-segment).
236
+
The operator will split the workload between the pods using [execution segments](https://grafana.com/docs/k6/<K6_VERSION>/reference/glossary#execution-segment).
237
237
238
238
{{< admonition type="caution" >}}
239
239
@@ -278,7 +278,7 @@ Not everything should be included directly in your scripts.
278
278
Well written scripts will allow for variability to support multiple scenarios and to avoid hard-coding values that tend to change.
279
279
These could be anything from passwords to target urls, in addition to system options.
280
280
281
-
We can pass this data as [environment variables](https://grafana.com/docs/k6/<K6_VERSION>/misc/glossary#environment-variables) for use with each pod executing your script.
281
+
We can pass this data as [environment variables](https://grafana.com/docs/k6/<K6_VERSION>/reference/glossary#environment-variables) for use with each pod executing your script.
282
282
This can be defined explicitly within the `TestRun` resource, or by referencing a `ConfigMap` or `Secret`.
283
283
284
284
{{< code >}}
@@ -346,7 +346,7 @@ spec:
346
346
347
347
{{< /code >}}
348
348
349
-
With the above arguments, we're adding a [test-wide custom tag](https://grafana.com/docs/k6/<K6_VERSION>/using-k6/tags-and-groups#test-wide-tags) to metrics and changing the output format of logs to [JSON](https://grafana.com/docs/k6/<K6_VERSION>/misc/glossary#json).
349
+
With the above arguments, we're adding a [test-wide custom tag](https://grafana.com/docs/k6/<K6_VERSION>/using-k6/tags-and-groups#test-wide-tags) to metrics and changing the output format of logs to [JSON](https://grafana.com/docs/k6/<K6_VERSION>/reference/glossary#json).
Copy file name to clipboardExpand all lines: docs/sources/k6/next/testing-guides/running-large-tests.md
+4-4Lines changed: 4 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -13,10 +13,10 @@ Maximizing the load a machine generates is a multi-faceted process, which includ
13
13
- Changing operating system settings to increase the default network and user limits.
14
14
- Monitoring the load-generator machine to ensure adequate resource usage.
15
15
- Designing efficient tests, with attention to scripting, k6 options, and file uploads.
16
-
- Monitoring the test run to detect errors logged by k6, which could indicate limitations of the load generator machine or the [system under test](https://grafana.com/docs/k6/<K6_VERSION>/misc/glossary#system-under-test) (SUT).
16
+
- Monitoring the test run to detect errors logged by k6, which could indicate limitations of the load generator machine or the [system under test](https://grafana.com/docs/k6/<K6_VERSION>/reference/glossary#system-under-test) (SUT).
17
17
18
18
A single k6 process efficiently uses all CPU cores on a load generator machine. Depending on the available resources, and with the guidelines described in this document, a single instance of k6 can run 30,000-40,000 simultaneous users (VUs).
19
-
In some cases, this number of VUs can generate up to 300,000 HTTP [requests per second](https://grafana.com/docs/k6/<K6_VERSION>/misc/glossary#requests-per-second) (RPS).
19
+
In some cases, this number of VUs can generate up to 300,000 HTTP [requests per second](https://grafana.com/docs/k6/<K6_VERSION>/reference/glossary#requests-per-second) (RPS).
20
20
21
21
Unless you need more than 100,000-300,000 requests per second (6-12M requests per minute), a single instance of k6 is likely sufficient for your needs.
22
22
Read on to learn about how to get the most load from a single machine.
@@ -109,7 +109,7 @@ As the test runs, these are good indicators to monitor:
109
109
## Error handling should be resilient
110
110
111
111
When running [large stress tests](https://grafana.com/docs/k6/<K6_VERSION>/testing-guides/test-types/stress-testing), your script shouldn't assume anything about the HTTP response.
112
-
An oversight of some scripts is to test with only the [happy path](https://grafana.com/docs/k6/<K6_VERSION>/misc/glossary#happy-path'The default behavior that happens when the system returns no errors') in mind.
112
+
An oversight of some scripts is to test with only the [happy path](https://grafana.com/docs/k6/<K6_VERSION>/reference/glossary#happy-path'The default behavior that happens when the system returns no errors') in mind.
113
113
114
114
For example, in k6 scripts, we often see something like this _happy path_ check:
115
115
@@ -351,7 +351,7 @@ k6 run --execution-segment "3/4:1" --execution-segment-sequence "0,1/4,2/4,3
351
351
352
352
However, at this moment, the distributed execution mode of k6 is not entirely functional. The current limitations are:
353
353
354
-
- k6 does not provide the functionality of a "primary" instance to coordinate the distributed execution of the test. Alternatively, you can use the [k6 REST API](https://grafana.com/docs/k6/<K6_VERSION>/misc/k6-rest-api) and [`--paused`](https://grafana.com/docs/k6/<K6_VERSION>/using-k6/k6-options/reference#paused) to synchronize the multiple k6 instances' execution.
354
+
- k6 does not provide the functionality of a "primary" instance to coordinate the distributed execution of the test. Alternatively, you can use the [k6 REST API](https://grafana.com/docs/k6/<K6_VERSION>/reference/k6-rest-api) and [`--paused`](https://grafana.com/docs/k6/<K6_VERSION>/using-k6/k6-options/reference#paused) to synchronize the multiple k6 instances' execution.
355
355
- Each k6 instance evaluates [Thresholds](https://grafana.com/docs/k6/<K6_VERSION>/using-k6/thresholds) independently - excluding the results of the other k6 instances. If you want to disable the threshold execution, use [`--no-thresholds`](https://grafana.com/docs/k6/<K6_VERSION>/using-k6/k6-options/reference#no-thresholds).
356
356
- k6 reports the metrics individually for each instance. Depending on how you store the load test results, you'll have to aggregate some metrics to calculate them correctly.
Copy file name to clipboardExpand all lines: docs/sources/k6/next/using-k6/environment-variables.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,7 +7,7 @@ weight: 1300
7
7
# Environment variables
8
8
9
9
Often, scripts need only minor tweaks to be reusable in different contexts.
10
-
Rather than creating several separate scripts for these different contexts or environments, you can use [environment variables](https://grafana.com/docs/k6/<K6_VERSION>/misc/glossary#environment-variables) to make parts of your script tweakable.
10
+
Rather than creating several separate scripts for these different contexts or environments, you can use [environment variables](https://grafana.com/docs/k6/<K6_VERSION>/reference/glossary#environment-variables) to make parts of your script tweakable.
11
11
12
12
You can use environment variables for two main purposes:
Copy file name to clipboardExpand all lines: docs/sources/k6/next/using-k6/javascript-typescript-compatibility-mode.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -108,4 +108,4 @@ The examples below demonstrate the use of Babel with bundlers like [Webpack](htt
108
108
109
109
-[Running large tests](https://grafana.com/docs/k6/<K6_VERSION>/testing-guides/running-large-tests): Optimize k6 for better performance.
110
110
-[k6 Modules](https://grafana.com/docs/k6/<K6_VERSION>/using-k6/modules): Different options to import modules in k6.
111
-
-[k6 Archive Command](https://grafana.com/docs/k6/<K6_VERSION>/misc/archive): The `k6 archive` command bundles all k6 test dependencies into a `tar` file, which can then be used for execution. It may also reduce the execution startup time.
111
+
-[k6 Archive Command](https://grafana.com/docs/k6/<K6_VERSION>/reference/archive): The `k6 archive` command bundles all k6 test dependencies into a `tar` file, which can then be used for execution. It may also reduce the execution startup time.
Copy file name to clipboardExpand all lines: docs/sources/k6/next/using-k6/k6-options/reference.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -92,7 +92,7 @@ and `k6 cloud run ...`, which you can use to override options specified in the c
92
92
Address of the API server. When executing scripts with `k6 run`, an HTTP server with a REST API is spun up,
93
93
which can be used to control some of the parameters of the test execution.
94
94
95
-
By default, the server listens on `localhost:6565`. Read more on [k6 REST API](https://grafana.com/docs/k6/<K6_VERSION>/misc/k6-rest-api). You can disable the HTTP server by setting the address value to an empty string, for example: `k6 run -a '' script.js`.
95
+
By default, the server listens on `localhost:6565`. Read more on [k6 REST API](https://grafana.com/docs/k6/<K6_VERSION>/reference/k6-rest-api). You can disable the HTTP server by setting the address value to an empty string, for example: `k6 run -a '' script.js`.
Copy file name to clipboardExpand all lines: docs/sources/k6/next/using-k6/scenarios/executors/_index.md
+3-1Lines changed: 3 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -12,6 +12,8 @@ The executor that you choose depends on the goals of your test and the type of t
12
12
Define the executor in `executor` key of the scenario object.
13
13
The value is the executor name separated by hyphens.
14
14
15
+
<!-- md-k6:skip -->
16
+
15
17
```javascript
16
18
exportconstoptions= {
17
19
scenarios: {
@@ -36,7 +38,7 @@ The following table lists all k6 executors and links to their documentation.
36
38
|[Ramping VUs](https://grafana.com/docs/k6/<K6_VERSION>/using-k6/scenarios/executors/ramping-vus)|`ramping-vus`| A variable number of VUs execute as many<br/> iterations as possible for a specified amount of time. |
37
39
|[Constant Arrival Rate](https://grafana.com/docs/k6/<K6_VERSION>/using-k6/scenarios/executors/constant-arrival-rate)|`constant-arrival-rate`| A fixed number of iterations are executed<br/> in a specified period of time. |
38
40
|[Ramping Arrival Rate](https://grafana.com/docs/k6/<K6_VERSION>/using-k6/scenarios/executors/ramping-arrival-rate)|`ramping-arrival-rate`| A variable number of iterations are <br/> executed in a specified period of time. |
39
-
|[Externally Controlled](https://grafana.com/docs/k6/<K6_VERSION>/using-k6/scenarios/executors/externally-controlled)|`externally-controlled`| Control and scale execution at runtime<br/> via [k6's REST API](https://grafana.com/docs/k6/<K6_VERSION>/misc/k6-rest-api) or the [CLI](https://k6.io/blog/how-to-control-a-live-k6-test). |
41
+
|[Externally Controlled](https://grafana.com/docs/k6/<K6_VERSION>/using-k6/scenarios/executors/externally-controlled)|`externally-controlled`| Control and scale execution at runtime<br/> via [k6's REST API](https://grafana.com/docs/k6/<K6_VERSION>/reference/k6-rest-api) or the [CLI](https://k6.io/blog/how-to-control-a-live-k6-test). |
Copy file name to clipboardExpand all lines: docs/sources/k6/next/using-k6/tags-and-groups.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -312,7 +312,7 @@ Groups do the following tasks internally:
312
312
- When a taggable resource—a check, request, or custom metric—runs within a group, k6 sets the tag `group` with the current group name.
313
313
For more info, refer to the [Tags section](https://grafana.com/docs/k6/<K6_VERSION>/using-k6/tags-and-groups#tags).
314
314
315
-
Both options, the `group_duration` metric and `group tagging`, could help you analyze and visualize complex test results. Check out how they work in your [k6 result output](https://grafana.com/docs/k6/<K6_VERSION>/misc/integrations#result-store-and-visualization).
315
+
Both options, the `group_duration` metric and `group tagging`, could help you analyze and visualize complex test results. Check out how they work in your [k6 result output](https://grafana.com/docs/k6/<K6_VERSION>/reference/integrations#result-store-and-visualization).
0 commit comments