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/next/javascript-api/k6-net-grpc/client/client-load-protoset.md
+1Lines changed: 1 addition & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,6 @@
1
1
---
2
2
title: 'Client.loadProtoset(protosetPath)'
3
+
slug: 'client-loadprotoset'
3
4
excerpt: 'Loads and parses the protoset file (serialized FileDescriptor set) so they are available to the client to marshal/unmarshal the correct request and response data structures for the RPC schema.'
Copy file name to clipboardExpand all lines: docs/sources/next/using-k6/metrics/create-custom-metrics.md
+5-5Lines changed: 5 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,7 +1,7 @@
1
1
---
2
2
title: Create custom metrics
3
3
excerpt: How to build custom k6 metrics for each metric type.
4
-
weight: 100
4
+
weight: 200
5
5
---
6
6
7
7
# Create custom metrics
@@ -24,14 +24,14 @@ Each topic has examples to make a custom metric and create [thresholds](https://
24
24
Custom metrics must be created in [init context](https://grafana.com/docs/k6/<K6_VERSION>/using-k6/test-lifecycle).
25
25
This limits memory and ensures that k6 can validate that all thresholds are evaluating defined metrics.
26
26
27
-
{{% /admonition %}}
27
+
{{% /admonition %}}
28
28
29
29
The generic procedure to create a custom metric is as follows:
30
30
31
31
1. Import the [`k6/metrics`](https://grafana.com/docs/k6/<K6_VERSION>/javascript-api/k6-metrics) module. Optionally, specify the type of metrics you want to create with a named import:
32
32
33
33
```javascript
34
-
import { Counter } from'k6/metrics';
34
+
import { Trend } from'k6/metrics';
35
35
```
36
36
37
37
1. In init context, construct a new custom-metric object.
@@ -75,7 +75,7 @@ You can use these tags to filter test results.
75
75
Here's how the output of the preceding script might look in the end-of-test summary.
76
76
Since the metric is a trend, k6 calculates various trends based on the number of values and their summation.
77
77
78
-
{{< code >}}
78
+
{{< code >}}
79
79
80
80
```bash
81
81
$ k6 run script.js
@@ -96,7 +96,7 @@ $ k6 run script.js
96
96
Custom metrics are collected from VU threads only at the end of a VU iteration.
97
97
For long-running scripts, custom metrics might appear only after the test runs a while.
| vus | Gauge | Current number of active virtual users |
19
-
| vus_max | Gauge | Max possible number of virtual users (VU resources are [pre-allocated](https://grafana.com/docs/k6/<K6_VERSION>/using-k6/scenarios/concepts/arrival-rate-vu-allocation), to avoid affecting performance when scaling up load )|
20
-
| iterations | Counter | The aggregate number of times the VUs execute the JS script (the `default` function). |
21
-
| iteration_duration | Trend | The time to complete one full iteration, including time spent in `setup` and `teardown`. To calculate the duration of the iteration's function for the specific scenario, [try this workaround](https://grafana.com/docs/k6/<K6_VERSION>/using-k6/workaround-iteration-duration)|
22
-
| dropped_iterations | Counter | The number of iterations that weren't started due to lack of VUs (for the arrival-rate executors) or lack of time (expired maxDuration in the iteration-based executors). [About dropped iterations](https://grafana.com/docs/k6/<K6_VERSION>/using-k6/scenarios/concepts/dropped-iterations)|
23
-
| data_received | Counter | The amount of received data. [This example covers how to track data for an individual URL](https://grafana.com/docs/k6/<K6_VERSION>/examples/tracking-data-per).|
24
-
| data_sent | Counter | The amount of data sent. [Track data for an individual URL](https://grafana.com/docs/k6/<K6_VERSION>/examples/tracking-data-per) to track data for an individual URL. |
25
-
| checks | Rate | The rate of successful checks. |
| vus | Gauge | Current number of active virtual users |
19
+
| vus_max | Gauge | Max possible number of virtual users (VU resources are [pre-allocated](https://grafana.com/docs/k6/<K6_VERSION>/using-k6/scenarios/concepts/arrival-rate-vu-allocation), to avoid affecting performance when scaling up load). |
20
+
| iterations | Counter | The aggregate number of times the VUs execute the JS script (the `default` function). |
21
+
| iteration_duration | Trend | The time to complete one full iteration, including time spent in `setup` and `teardown`. To calculate the duration of the iteration's function for the specific scenario, [try this workaround](https://grafana.com/docs/k6/<K6_VERSION>/using-k6/workaround-iteration-duration). |
22
+
| dropped_iterations | Counter | The number of iterations that weren't started due to lack of VUs (for the arrival-rate executors) or lack of time (expired maxDuration in the iteration-based executors). Refer to [Dropped iterations](https://grafana.com/docs/k6/<K6_VERSION>/using-k6/scenarios/concepts/dropped-iterations) for more details.|
23
+
| data_received | Counter | The amount of received data. [This example covers how to track data for an individual URL](https://grafana.com/docs/k6/<K6_VERSION>/examples/track-transmitted-data-per-url). |
24
+
| data_sent | Counter | The amount of data sent. [Track data for an individual URL](https://grafana.com/docs/k6/<K6_VERSION>/examples/track-transmitted-data-per-url) to track data for an individual URL.|
25
+
| checks | Rate | The rate of successful checks. |
26
26
27
27
## HTTP-specific built-in metrics {#http}
28
28
@@ -33,7 +33,7 @@ These metrics are generated only when the test makes HTTP requests.
33
33
For all `http_req_*` metrics, **the timestamp is emitted the end of the request.**
34
34
In other words, the timestamp happens when k6 receives the end of the response body, or the request times out.
@@ -45,7 +45,7 @@ In other words, the timestamp happens when k6 receives the end of the response b
45
45
| http_req_waiting | Trend | Time spent waiting for response from remote host (a.k.a. “time to first byte”, or “TTFB”). `float`|
46
46
| http_req_receiving | Trend | Time spent receiving response data from the remote host. `float`|
47
47
| http_req_duration | Trend | Total time for the request. It's equal to `http_req_sending + http_req_waiting + http_req_receiving` (i.e. how long did the remote server take to process the request and respond, without the initial DNS lookup/connection times). `float`|
48
-
| http_req_failed | Rate | The rate of failed requests according to [setResponseCallback](https://grafana.com/docs/k6/<K6_VERSION>/javascript-api/k6-http/set-response-callback). |
48
+
| http_req_failed | Rate | The rate of failed requests according to [setResponseCallback](https://grafana.com/docs/k6/<K6_VERSION>/javascript-api/k6-http/set-response-callback). |
49
49
50
50
## Browser metrics {#browser}
51
51
@@ -105,4 +105,4 @@ k6 emits the following metrics when it interacts with a service through the [`gR
105
105
106
106
Steams-related metrics (`grpc_streams*`) are available only when using the `k6/experimental/grpc` module which is available on `k6` version `0.45.0` or higher.
Copy file name to clipboardExpand all lines: docs/sources/next/using-k6/protocols/ssl-tls/ssl-tls-client-certificates.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
@@ -8,7 +8,7 @@ excerpt: 'To use client certificates, you specify global that tell k6 how to map
8
8
Discussion about TLS certificates is usually about how clients authenticate servers.
9
9
However, both TLS and k6 also support the reverse process, in which servers authenticate clients.
10
10
11
-
To use client certificates, specify global [configuration options](https://grafana.com/docs/k6/<K6_VERSION>/using-k6/options) that tell k6 how to map a public certificate and private key to the domains they are valid for.
11
+
To use client certificates, specify global [configuration options](https://grafana.com/docs/k6/<K6_VERSION>/using-k6/k6-options) that tell k6 how to map a public certificate and private key to the domains they are valid for.
12
12
You can load the certificate and key from local files or embed them as strings in the script.
13
13
14
14
## Loading a certificate and a key from local files
0 commit comments