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
| K6_BROWSER_ARGS | Extra command line arguments to include when launching browser process. See [this link](https://peter.sh/experiments/chromium-command-line-switches/) for a list of Chromium arguments. Note that arguments should not start with `--` (see the command example below). |
8
+
| K6_BROWSER_DEBUG | All CDP messages and internal fine grained logs will be logged if set to `true`. |
9
+
| K6_BROWSER_EXECUTABLE_PATH | Override search for browser executable in favor of specified absolute path. |
10
+
| K6_BROWSER_HEADLESS | Show browser GUI or not. `true` by default. |
11
+
| K6_BROWSER_IGNORE_DEFAULT_ARGS | Ignore any of the [default arguments](https://grafana.com/docs/k6/<K6_VERSION>/using-k6-browser/options/#default-arguments) included when launching a browser process. |
12
+
| K6_BROWSER_TIMEOUT | Default timeout for initializing the connection to the browser instance. `'30s'` if not set. |
13
+
| K6_BROWSER_TRACES_METADATA | Sets additional _key-value_ metadata that is included as attributes in every span generated from browser module traces. Example: `K6_BROWSER_TRACES_METADATA=attr1=val1,attr2=val2`. This only applies if traces generation is enabled, refer to [Traces output](https://grafana.com/docs/k6/<K6_VERSION>/using-k6/k6-options/reference#traces-output) for more details. |
14
+
15
+
The following command passes the browser options as environment variables to launch a headful browser with custom arguments.
16
+
17
+
{{< code >}}
18
+
19
+
```bash
20
+
$ K6_BROWSER_HEADLESS=false K6_BROWSER_ARGS='show-property-changed-rects' k6 run script.js
21
+
```
22
+
23
+
```docker
24
+
# WARNING!
25
+
# The grafana/k6:master-with-browser image launches a Chrome browser by setting the
26
+
# 'no-sandbox' argument. Only use it with trustworthy websites.
27
+
#
28
+
# As an alternative, you can use a Docker SECCOMP profile instead, and overwrite the
29
+
# Chrome arguments to not use 'no-sandbox' such as:
30
+
# docker container run --rm -i -e K6_BROWSER_ARGS='' --security-opt seccomp=$(pwd)/chrome.json grafana/k6:master-with-browser run - <script.js
31
+
#
32
+
# You can find an example of a hardened SECCOMP profile in:
| browser_web_vital_cls | Measures the visual stability on a webpage by quantifying the amount of unexpected layout shift of visible page content. Refer to [Cumulative Layout Shift](https://web.dev/cls/) for more information. |
10
+
| browser_web_vital_fid | Measures the responsiveness of a web page by quantifying the delay between a user’s first interaction, such as clicking a button, and the browser’s response. Refer to [First Input Delay](https://web.dev/fid/) for more information. |
11
+
| browser_web_vital_lcp | Measures the time it takes for the largest content element on a page to become visible. Refer to [Largest Contentful Paint](https://web.dev/lcp/) for more information. |
| browser_web_vital_fcp | Measures the time it takes for the browser to render the first DOM element on the page, whether that's a text, image or header. Refer to [First Contentful Paint](https://web.dev/fcp/) for more information. |
10
+
| browser_web_vital_inp | An experimental metric that measures a page's responsiveness. Refer to [Interaction to Next Paint](https://web.dev/inp/) for more information. |
11
+
| browser_web_vital_ttfb | Measures the time it takes between the browser request and the start of the response from a server. Refer to [Time to First Byte](https://web.dev/ttfb/) for more information. |
Copy file name to clipboardExpand all lines: docs/sources/next/using-k6-browser/metrics.md
+21-17Lines changed: 21 additions & 17 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -11,12 +11,11 @@ Follow along to learn about:
11
11
- Google's Core Web Vitals and why they are important
12
12
- How to analyze the browser metrics output
13
13
- How to set thresholds for your browser metrics
14
+
- How to use the Performance API to measure web performance.
14
15
15
16
## Google's Core Web Vitals
16
17
17
18
The k6 browser module emits metrics based on the [Core Web Vitals](https://web.dev/vitals/#core-web-vitals).
18
-
This section provides some conceptual background about the core vitals.
19
-
To review the complete list of browser metrics, refer to the section in the [Metrics reference](https://grafana.com/docs/k6/<K6_VERSION>/using-k6/metrics/reference#browser).
20
19
21
20
Google introduced these metrics to provided unified signals to assess user experience on the web.
22
21
The vitals are composed of three important metrics to help user experience when using your web application.
@@ -32,6 +31,18 @@ The Core Web Vitals are one of [Google's Page Experience Signals](https://develo
32
31
Existing browser measures, such as `Load` and `DOMContentLoaded` times, no longer accurately reflect user experience very well.
33
32
Relying on these load events does not give the correct metric to analyze critical performance bottlenecks that your page might have. Google's Web Vitals is a better measure of your page performance and its user experience.
34
33
34
+
## Browser metrics
35
+
36
+
The following Core Web Vital metrics are collected when using the k6 browser module.
0 commit comments