Skip to content

Commit 1b60e56

Browse files
[fix]; refactor browser metrics to reference page
1 parent 5724748 commit 1b60e56

File tree

2 files changed

+41
-35
lines changed

2 files changed

+41
-35
lines changed

src/data/markdown/translated-guides/en/02 Using k6/02 Metrics/000-reference.md

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,47 @@ In other words, the timestamp happens when k6 receives the end of the response b
4545
| 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` |
4646
| http_req_failed | Rate | The rate of failed requests according to [setResponseCallback](/javascript-api/k6-http/setresponsecallback). |
4747

48+
## Browser metrics {#browser}
49+
50+
The [k6 browser module](/using-k6-browser) emits its own metrics based on the [Core Web Vitals](https://web.dev/vitals/#core-web-vitals).
51+
52+
53+
These core metrics will evolve over time when technology changes, but for now, k6 tracks the following core web vitals:
54+
55+
| Core Web Vital | Description |
56+
|-------------------------------- |--------------------------------------------------------------------------------------------------------------|
57+
| webvital_largest_content_paint | Measures a page's loading performance. Please refer to [Largest Contentful Paint](https://web.dev/lcp/) for more information. |
58+
| webvital_first_input_delay | Measures a page's interactivity. Please refer to [First Input Delay](https://web.dev/fid/) for more information. |
59+
| webvital_cumulative_layout_shift | Measures a page's visual stability. Please refer to [Cumulative Layout Shift](https://web.dev/cls/) for more information. |
60+
61+
### Other Web Vitals
62+
63+
Apart from the Core Web Vitals, the browser module also reports [Other Web Vitals](https://web.dev/vitals/#other-web-vitals).
64+
65+
66+
| Other Web Vital | Description |
67+
|-------------------------------- |--------------------------------------------------------------------------------------------------------------|
68+
| webvital_time_to_first_byte | Measures the time it takes between the browser request and the start of the response from a server. Please refer to [Time to First Byte](https://web.dev/ttfb/) for more information.|
69+
| webvital_first_contentful_paint | 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. Please refer to [First Contentful Paint](https://web.dev/fcp/) for more information. |
70+
| webvital_interaction_to_next_paint | An experimental metric that measures a page's responsiveness. Please refer to [Interaction to Next Paint](https://web.dev/inp/) for more information. |
71+
72+
### Legacy browser metrics
73+
74+
<Blockquote mod="note" title="">
75+
76+
As of [k6 version 0.44.0](https://github.com/grafana/k6/releases/tag/v0.44.0), k6 now natively supports [Google's Core Web Vitals](https://web.dev/vitals/#core-web-vitals). In future releases, to align with recommended practices, we will remove the following browser metrics to focus on the web vital metrics. Please refer to [#831](https://github.com/grafana/xk6-browser/issues/831) for more information.
77+
78+
</Blockquote>
79+
80+
Apart from the usual HTTP specific metrics that k6 already tracks, the browser module tracks the following browser specific performance metrics on top:
81+
82+
| Metric Name | Description |
83+
|--------------------------------|--------------------------------------------------------------------------------------------------------------|
84+
| browser_dom_content_loaded | Emitted when the page is loaded but scripts have just started to be executed. |
85+
| browser_first_paint | Emitted when the browser renders the first pixel on the page. |
86+
| browser_loaded | Emitted when the page is fully loaded. |
87+
88+
4889
## Built-in WebSocket metrics
4990

5091
`k6` emits the following metrics when interacting with a WebSocket service through the [`experimental`](/javascript-api/k6-experimental/websockets) or legacy websockets API.

src/data/markdown/translated-guides/en/03 Using k6 browser/03 Metrics.md

Lines changed: 0 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -18,47 +18,12 @@ To provide users with the best user experience, Google introduced [Core Web Vita
1818
2. interactivity,
1919
3. and visual stability.
2020

21-
These core metrics will evolve over time when technology changes, but for now, k6 tracks the following core web vitals:
22-
23-
| Core Web Vital | Description |
24-
|-------------------------------- |--------------------------------------------------------------------------------------------------------------|
25-
| webvital_largest_content_paint | Measures a page's loading performance. Please refer to [Largest Contentful Paint](https://web.dev/lcp/) for more information. |
26-
| webvital_first_input_delay | Measures a page's interactivity. Please refer to [First Input Delay](https://web.dev/fid/) for more information. |
27-
| webvital_cumulative_layout_shift | Measures a page's visual stability. Please refer to [Cumulative Layout Shift](https://web.dev/cls/) for more information. |
28-
29-
### Other Web Vitals
30-
31-
Apart from the Core Web Vitals, the browser module also reports [Other Web Vitals](https://web.dev/vitals/#other-web-vitals).
32-
33-
34-
| Other Web Vital | Description |
35-
|-------------------------------- |--------------------------------------------------------------------------------------------------------------|
36-
| webvital_time_to_first_byte | Measures the time it takes between the browser request and the start of the response from a server. Please refer to [Time to First Byte](https://web.dev/ttfb/) for more information.|
37-
| webvital_first_contentful_paint | 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. Please refer to [First Contentful Paint](https://web.dev/fcp/) for more information. |
38-
| webvital_interaction_to_next_paint | An experimental metric that measures a page's responsiveness. Please refer to [Interaction to Next Paint](https://web.dev/inp/) for more information. |
39-
4021
### Why are they important?
4122

4223
The Core Web Vitals comprise one of [Google's Page Experience Signals](https://developers.google.com/search/docs/appearance/page-experience). A positive page experience naturally leads to better quality and better search engine rankings. These golden metrics help you understand which areas of your frontend application need optimization so your pages can rank higher than similar content.
4324

4425
Existing browser measures such as the `Load` and `DOMContentLoaded` time do not accurately reflect the user's experience very well as they used to. 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's performance as well as your page's user experience.
4526

46-
## Existing browser metrics
47-
48-
<Blockquote mod="note" title="">
49-
50-
As of [k6 version 0.44.0](https://github.com/grafana/k6/releases/tag/v0.44.0), k6 now natively supports [Google's Core Web Vitals](https://web.dev/vitals/#core-web-vitals). In future releases, to align with recommended practices, we will remove the following browser metrics to focus on the web vital metrics. Please refer to [#831](https://github.com/grafana/xk6-browser/issues/831) for more information.
51-
52-
</Blockquote>
53-
54-
Apart from the usual HTTP specific metrics that k6 already tracks, the browser module tracks the following browser specific performance metrics on top:
55-
56-
| Metric Name | Description |
57-
|--------------------------------|--------------------------------------------------------------------------------------------------------------|
58-
| browser_dom_content_loaded | Emitted when the page is loaded but scripts have just started to be executed. |
59-
| browser_first_paint | Emitted when the browser renders the first pixel on the page. |
60-
| browser_loaded | Emitted when the page is fully loaded. |
61-
6227
## Understanding the browser metrics output
6328

6429
When a browser test is finished, k6 reports a top-level overview of the aggregated browser metrics output. A sample of which you can see below.

0 commit comments

Comments
 (0)