Skip to main content
JUMP TO:Quick StartCLI CommandsConfigurationPlaywright APIMCP ServerGitHub Actions
Guides / Performance Budgets(15 of 37)

Performance Budgets

EXPERIMENTAL. The plugin can collect and report selected metrics, but its failOnBudgetExceeded path is not a verified standalone CI gate in the current release.

Report navigation timing, estimated LCP/CLS, resource transfer weight and request counts from captured routes. FCP is not a supported budget.

9-Hook Plugin Architecture and Performance Budgets
FIG 01 · UNIFIED RENDER AUDITS — CORE WEB VITALS (LCP, CLS, TTFB) IN THE SAME RENDER PASS

Experimental status

Because Frontguard already boots Chromium and waits for network and frame convergence on every route, the performance budget plugin reads browser performance entries in the afterRender hook without launching a separate Lighthouse process.

Collecting Web Vitals in afterRender

frontguard.config.ts: collecting route performance metrics
import { createPerfBudgetPlugin } from '@frontguard/cli/plugins'

export default {
  version: 1,
  baseUrl: 'http://localhost:3000',
  routes: ['/', '/pricing', '/dashboard'],
  plugins: [
    createPerfBudgetPlugin({
      budgets: {
        lcp: 2500,
        cls: 0.1,
        ttfb: 600,
        maxPageWeight: 1500, // KB
      },
    }),
  ],
}
MetricBudget KeyWhat It Measures
Largest Contentful PaintlcpEstimated largest-content paint time in milliseconds.
Cumulative Layout ShiftclsUnitless layout instability score accumulated during page load.
Time to First BytettfbResponse latency in ms for the document navigation request.
Total Transfer WeightmaxPageWeightMaximum total resource transfer weight in KB (1024 bytes).
Request CountmaxRequestsMaximum number of resource requests.

Current limit

Use the plugin output as supplemental evidence. Keep an independently verified performance gate for release decisions until the plugin exit-code path has a failing-first acceptance test.