RousselTMLEARNING

TP · Grafana k6: load and performance testing

Lab: Browser test and Core Web Vitals

What you will learn in this TP
  • Write a browser script
  • Read the Web Vitals
  • Combine HTTP load and browser

Introduction #

What you will learn in this section
  • Write a browser script
  • Read the Web Vitals
  • Combine HTTP load and browser

Context. Users complain about a slow page even though the API responds quickly. You measure what the browser actually sees.

Prerequisites: Docker  ·  Estimated time: 35 min

Measure the user experience the way a browser does.

Hands-on #

Guided steps, with their solutions.

  1. 1. Write the script

    Why? The browser module drives a real Chromium: JavaScript, CSS and images are loaded just as they are for the user.

    Create ui.js that opens http://httpbin/, checks the title and sets a threshold on the LCP.
  2. 2. Run with the browser image

    Why? The -with-browser image includes Chromium.

    Run the test and look for the browser_web_vital_* metrics.
  3. 3. Combine with an HTTP load

    Why? The perceived experience degrades when the backend is under load: that is what we want to measure.

    Add a constant-arrival-rate scenario at 300 requests/s on /get and compare the LCP with and without load.
  4. 4. Interpret

    Why? To link a perceived indicator to a server-side cause.

    Do the LCP and TTFB increase under load? How much of it comes from the server?

Difficulty level : ●●●○○ (3/5)

My progress

  • ⏱ Estimated time : ≈ 35 min

Sign in to track your progress and take notes. Sign in

💬 Questions about this lesson

No questions yet: be the first to ask for help or share your configuration.

Ask a question about this lesson →

Recommended Articles

Browser testing and synthetic monitoring with k6

Test a web application in a real browser with the k6 browser module, measure Core Web Vitals, and...

Real User Monitoring (RUM) and Core Web Vitals: measuring what users experience

Why observe the front end, what RUM measures, Core Web Vitals (LCP, INP, CLS) and their threshold...

Apdex vs Core Web Vitals

Discover the differences between Apdex and Core Web Vitals, two essential performance indicators ...

Observing a k6 test: Prometheus, Grafana and correlation with the system under test

Send k6 results to Prometheus (remote write) or via OpenTelemetry, visualize them in Grafana and ...

Case study: this site's minimal RUM, cookie-free, exposed to Prometheus

How this site measures its Core Web Vitals with about forty lines of JavaScript, an anonymous bea...

Thresholds, metrics and results of a k6 test

Read the summary of a k6 test, understand the built-in metrics (http_req_duration, http_req_faile...

Website monitoring: availability, HTTPS monitoring, certificates and performance

Set up website monitoring: availability and HTTPS checks, certificate expiry, response time, Core...

Dynatrace Real User Monitoring: injection, web applications and verification

Set up real user monitoring in Dynatrace: automatic injection by OneAgent, agentless monitoring, ...

Performance testing best practices with k6

Checklist for useful load tests: objectives, realistic scenarios, environment, thresholds, observ...

Support us

♥ SUPPORT US

Support RousselTM Learning

Courses, articles, labs and certificates stay free with no intrusive ads. A voluntary contribution, of any amount you choose, pays for hosting, lab environments and new content.

Contribute with PayPal Any amount · card or PayPal accountLearn more
QR code PayPal
Or scan this QR code with your phone

Thank you, every contribution counts!