Browser Web Vitals

Capture browser Web Vitals through your chosen browser tool and let LoadStrike enforce the metric budgets as a normal run result.

Use this page when

Visual guide

Sequence diagram showing how a LoadStrike workflow moves from setup to report output.
This page fits into the same setup, run, correlate, and report flow as the rest of the public LoadStrike runtime.

Guide

Metrics

The helper accepts Largest Contentful Paint (LCP), Interaction to Next Paint (INP), Cumulative Layout Shift (CLS), First Contentful Paint (FCP), and Time to First Byte (TTFB) values when your browser collector provides them.

Budgets

Configure only the maximum values that matter for the page or journey. Any returned metric that exceeds its configured maximum fails the scenario. Metrics without a configured maximum are recorded by your callback but do not fail the LoadStrike scenario.

Browser Collection

Use the browser tool that best matches your application. Playwright, Selenium, Lighthouse, browser performance APIs, and real-user-style collectors can all feed LoadStrikeBrowserWebVitalsResult as long as the callback returns the measured values.

When To Add Load

Run Web Vitals as a single standalone scenario when you want a page-quality gate. Add WithLoadSimulations only when you intentionally want repeated browser checks during a performance test.

Reports And Comparison

The scenario outcome is visible in the same reports and portal views as other LoadStrike runs, which lets teams keep page-quality gates beside load, stress, and transaction tests.

Feature usage samples

Use this helper when your browser tooling measures page quality and LoadStrike should enforce the budgets beside your load and transaction tests.

If you run these examples locally, add a valid runner key before execution starts. Set it with WithRunnerKey("...") or the config key LoadStrike:RunnerKey.

Browser Web Vitals

using LoadStrike;

var scenario = LoadStrikeBrowserWebVitals.CreateScenario(
    "homepage-web-vitals",
    new LoadStrikeBrowserWebVitalsOptions
    {
        Url = "https://example.com",
        MaxLargestContentfulPaintMs = 2500,
        MaxInteractionToNextPaintMs = 200,
        MaxCumulativeLayoutShift = 0.1,
        MaxFirstContentfulPaintMs = 1800,
        MaxTimeToFirstByteMs = 800
    },
    _ => new LoadStrikeBrowserWebVitalsResult
    {
        Url = "https://example.com",
        LargestContentfulPaintMs = 1800,
        InteractionToNextPaintMs = 120,
        CumulativeLayoutShift = 0.03,
        FirstContentfulPaintMs = 1100,
        TimeToFirstByteMs = 220
    });

_ = scenario;

Web Vitals budgets

Url

The page or browser journey target. It must be an absolute URL.

LargestContentfulPaintMs

Largest Contentful Paint budget. Use it to catch slow rendering of the main content.

InteractionToNextPaintMs

Interaction to Next Paint budget. Use it to catch slow interaction response on the tested journey.

CumulativeLayoutShift

Cumulative Layout Shift budget. Use it to catch visual instability.

FirstContentfulPaintMs

First Contentful Paint budget. Use it to catch slow initial rendering.

TimeToFirstByteMs

Time to First Byte budget. Use it to catch slow server or edge response before rendering begins.

Metric limits

Only configured maximums are enforced. A returned metric fails the scenario when it is higher than its configured maximum.

The browser collector is intentionally yours. Use Playwright, Selenium, Lighthouse, browser performance entries, or an internal collector, then return the measured values in LoadStrikeBrowserWebVitalsResult.