liveBook · Manning

Percentile

As explained in Crack Any Codebase with AI

p99 latency is the response time below which 99 percent of measured operations complete.

P99 latency is the response time below which 99 percent of measured operations complete. Use it to set a performance budget for each layer, not just an average for the whole request. section 9.5

Booking request

A booking request waits for synchronous calendar and video-provider calls before returning 201. The local Postgres write takes milliseconds, but Google Calendar at EventManager.ts:873 and Zoom at videoClient.ts:82 delay the response. Because a fan-out waits for its slowest branch, the slowest provider dominates the request's latency and threatens the p99 budget. section 9.5

Diagnose percentile latency by asking:

  • Which hop is most likely to exceed its layer budget? section 9.5
  • Which synchronous calls block the response, and which can run asynchronously? section 9.5
  • Which branch controls the tail when requests fan out? section 9.5
Figure 9.8 A request trace before and after the 200 OK response. The left side shows the synchronous work the user waits for: web server calls to the cache, database, and external APIs. The right side shows the asynchronous work that runs after the response is sent: a queue fans out jobs to workers that send email, fire webhooks, and update the search index.

Compare the work users wait for before 200 OK with queued work that runs afterward. section 9.5

How Crack Any Codebase with AI covers it

How deep it goes
Defines p99 and applies it to traces, budgets, synchronous calls, and fan-out, stopping short of statistical calculation details.
Examples
Uses a booking flow where Google Calendar and Zoom calls dominate the response while Postgres remains fast.
What you can do after
Diagnose/debug with request traces by locating blocking hops and the slowest fan-out branch.
How it connects
Connects performance budgets with request traces, synchronous calls, fan-out, and tail latency.

Also explained in

Compare how 13 books explain percentile →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Crack Any Codebase with AI. The section links point to the parts of the book it draws on.