liveBook · Manning

Mean

As explained in Vibe Engineering

Expected value is the probability-weighted average outcome of a decision under uncertain possible results.

A mean can make a performance decision clearer, but only when paired with the frequency of the work it describes. Mean latency estimates the average execution time per request; multiplying it by requests per second estimates total processing time per second. A slow endpoint is not necessarily the best optimization target if it is rarely called. section 7.2

Optimize the frequent path

A process-request endpoint handles 10,000 requests per second at a mean latency of 100 ms. Reducing its mean by 10 ms saves an estimated 100,000 ms of processing time per second. A modify-schema endpoint handles 10 requests per second at a mean of 250 ms; halving that mean saves 1,250 ms per second. The smaller per-request improvement saves 80 times as much overall. section 7.2

Keep the mean alongside tail metrics rather than replacing them. The 99th percentile describes a different responsiveness concern: in the endpoint comparison, the rarer endpoint has the higher p99, even though the frequent endpoint offers greater aggregate savings. Measure traffic and latency before choosing the target, and test again after changing it. section 7.2 section 7.2.3

Expected value applies the same averaging idea to uncertain outcomes: weight each outcome by its probability. For auto-merge, compare expected defect escape costs with avoided review effort. With a $5,000 average cost per escape and $150 per review, an escape probability above 3% makes expected escape costs exceed avoided review costs under those assumptions. section 10.5.3

Treat avoided review cost as capacity

About 3,700 auto-merged changes produced 11 escapes: roughly $55,000 in escape costs against approximately $550,000 in avoided review time. The latter was not cash saved; it was senior capacity released. Measure what that capacity produces rather than treating its estimated value as a realized outcome. section 10.5.3

How Vibe Engineering covers it

How deep it goes
Works through traffic-weighted latency savings and an escape-cost threshold, without deriving mean or expected value formally.
Examples
Compares two endpoints at different request rates and estimates the costs and released review capacity of auto-merging changes.
What you can do after
Evaluate optimization opportunities and auto-merge thresholds using measured or assumed frequencies, averages, and costs.
How it connects
Connects mean latency with throughput, hot paths, and the 99th percentile, and expected value with defect escape costs.

Also explained in

Compare how 35 books explain mean →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Vibe Engineering. The section links point to the parts of the book it draws on.