Skip to content
All work

Case study 18 / 25React Front-End

Performance instrumentation and budgets built into a web client

The app went from 9 of 15 KPIs red or amber at rest to 0 of 27, judged by one status engine instead of seven; 0 bytes reach production.

My roleDesigned it and led a team of up to 3: set its standards, mentored it, agreed the roadmap with operations and the client, presented to leadership.

Stack

  • React
  • Next.js
  • TypeScript
  • Node.js
  • Web Performance APIs
  • Server-Timing
  • IndexedDB
  • Puppeteer

01 · How it works

  • TodaytoChanged in this work
  • Data flow

What it does

A development-only monitor inside the monitoring platform's web client: over the running application it shows whether each part is within budget, where the time goes and whether a change made it worse.

Read more

Every new feature is measured with it before and after, and a build check proves none of its code reaches production. I designed and built it, then used it to bring the application back within its own budgets.

6 connections· select a part to trace it
  1. Page, API and map probes to Single status judge: current values, up to 4 Hz
  2. KPI-to-file map to Single status judge: file and hint per KPI
  3. Single status judge to Status badge: red and amber counts
  4. Single status judge to Status tab: rows by severity, with file
  5. Single status judge to Console table: prints the same rows
  6. Single status judge to Per-minute session log: saves culprit each minute

02Results

  • R01Higher is better

    API routes with a server-timing breakdown

    Before 34%, after 100%, 2.9× higher. Higher is better.
    Before
    After
  • R02Lower is better

    Places that compute a KPI's status

    Before 7, after 1, 7× lower. Lower is better.
    Before
    After
  • R03Lower is better

    KPIs in red or sustained amber at rest

    Before 60%, after 0%, eliminated. Lower is better.
    Before
    After

What it achieved

  • The app's health at rest, as the team sees it: 9 of 15 KPIs red or amber → 0 of 27, all within budget
  • Status logic: seven independent calculations → one status engine, 0 mismatches between badge, header and tab
Read more
  • Tracing: 34% of API routes with a server-timing breakdown → 100%, and a dedicated probe on every page
  • Chart coverage: 2 of 17 charts with a render probe → 14 of 17

03Decisions and trade-offs

  1. Constraint

    Seven modules judged KPIs with their own thresholds, so badge, header and tab disagreed.

    Decision

    One status engine that judges each KPI once, for every view.

    What it cost

    No module keeps its own thresholds; every rule lives in one place.

  2. Constraint

    An amber that never clears warns nobody.

    Decision

    Count amber only after five sustained minutes.

    What it cost

    Short spikes no longer turn a KPI amber.

  3. Constraint

    Batch writes looked like a cost worth halving.

    Decision

    Slow the flush, then let the monitor judge the change.

    What it cost

    It had no effect, so I reverted it: the monitor overruled me.

The challenge

The first version collected the right data but could not be trusted to judge it. Eighteen KPIs were spread across ten tabs, and seven modules each computed a status with their own thresholds, so the badge, the header and a tab could disagree about what was red. An instrument that contradicts itself stops being used.

Read more

Coverage was also thinner than its own checks reported: two in three API routes had no server-timing breakdown, most charts had no render probe, and the coverage check passed every page on generic probes. Once the monitor judged consistently, it showed the application failing its own budgets at rest.

What I learned

Treat what the code suggests as a hypothesis and make the instrument prove it; the session log now records the culprit behind every value. Where a fix would have changed what users see, I kept the visuals and adjusted the budget instead, and halving the map tiles' heartbeat cut long tasks from 25 to 5 per minute.

Read more

An instrument that contradicts itself stops being used.

Stack

  • React
  • Next.js
  • TypeScript
  • Node.js
  • Web Performance APIs
  • Server-Timing
  • IndexedDB
  • Puppeteer

Skills

  • Developer tooling
  • Observability design
  • Instrumentation
  • Performance budgets
  • Front-end architecture
Cover picture for Performance instrumentation and budgets built into a web clientCover picture for Performance instrumentation and budgets built into a web client