Keep the useful bits, human.
Beginner field notes
- Latency is elapsed time between stated start and end points. This lesson uses client-send to client-observed-response milliseconds; 1000 ms equals one second.
- A distribution keeps how durations are spread out. Replacing the whole set with one average hides which observations were fast or slow.
- Compare durations measured with the same boundary and unit. A server-only duration and a client-observed duration need not measure the same work.
See a worked example
Read a complete ten-observation paper batch
Sample only. Nothing here runs on your computer.
OFFLINE Lantern Archive observations, not requests to run.
Each duration is client-send to client-observed-response, in ms. All ten invented observations are supplied; no hidden observations or excluded timeouts are modeled.
Observed values: [10, 1000, 10, 10, 10, 10, 10, 10, 10, 10].
Arithmetic mean = sum / count; do not round the mean up.
Chosen percentile rule for 0 < p <= 1: sort ascending, retain ties, choose 1-based rank ceil(p * n). No interpolation; an exact integer rank selects that rank, not an average of two ranks.
Find the sorted values, count, sum, mean, p50, p90 and p99. What share of this batch is the one 1000 ms observation?Sorted values: [10, 10, 10, 10, 10, 10, 10, 10, 10, 1000] ms.
Count n = 10. Sum = 9 * 10 + 1000 = 1090 ms. Mean = 1090 / 10 = 109 ms exactly.
p50: ceil(0.50 * 10) = 5; value at rank 5 = 10 ms.
p90: ceil(0.90 * 10) = 9; value at rank 9 = 10 ms.
p99: ceil(0.99 * 10) = 10; value at rank 10 = 1000 ms.
The 1000 ms observation is 1 / 10 = 10% of this batch, not 1%.
At least 99% at or below the observed p99 means all ten here; it does not mean exactly 99% fall strictly below it.
These are exact arithmetic summaries of supplied synthetic observations, not reliable population p99 or evidence about meeting a performance target.The mean includes the long duration but hides its position. Ordered ranks distinguish the middle values from the upper end. Choosing a convention makes the tiny example reproducible without pretending that ten data points provide a dependable population-tail estimate.
Visual
The reviewed description and complete diagram source are available here.
More of this diagram is available inside its frame. Focus the frame and use the arrow keys to pan.
Read the complete diagram source
This is the source for the reviewed diagram, not a command to run.
flowchart TD
A["10 supplied durations in ms"] --> B["Sort ascending; keep repeated values"]
B --> C["Choose rank ceil(p × 10), starting at 1"]
C --> D["p50: rank 5 → 10 ms"]
C --> E["p90: rank 9 → 10 ms"]
C --> F["p99: rank 10 → 1000 ms"] Sources and full explanation
Notes sources · Beginner
AI source review · 2026-10-17
Reviewed explanation
Latency is an elapsed duration between two stated points. In our fictional Lantern Archive table, it starts when a client, meaning the app making the request, sends a label-read request and ends when that same client observes its response. The unit is milliseconds, abbreviated ms; 1000 ms is one second. Another measurement might use different start and end points, so its number is not automatically comparable. A response time by itself also does not prove that later work or a business change succeeded.
A duration distribution shows how the observations are spread out. Suppose the complete invented batch contains nine responses taking 10 ms each and one taking 1000 ms. Most observations are short, but one is much longer. The arithmetic mean adds all ten durations and divides by ten: 1090 ms / 10 = 109 ms. There is no 109 ms observation in that batch. The mean is useful, but it has not preserved which requests were fast or slow.
To discuss positions in the ordered batch, we must name a percentile convention. Here we use nearest rank: sort the n observations in ascending order, keep ties as separate observations, and choose the 1-based rank ceil(p * n), where 0 < p <= 1. Ceil means the smallest integer not below its input. There is no interpolation and no averaging of neighboring ranks in this rule. Statistical tools can use other methods, so record the convention rather than assuming every p99 label means exactly the same calculation.
For p50 use p = 0.50: ceil(0.50 * 10) = 5, whose observed value is 10 ms. For p90, rank 9 also contains 10 ms. For p99, ceil(0.99 * 10) = 10, whose value is 1000 ms. These are value thresholds for this batch under our rule. At least the named fraction of observations is at or below the selected value; ties and small counts may put more there. At p99 all ten observations are at or below 1000 ms. This is not a claim that exactly 99% are below it or exactly 1% are slow.
The paper example contains all ten supplied observations, not a live measurement or a reliable estimate of a larger population’s 99th percentile. One long observation is one out of ten, or 10% of this batch. In a real measurement you would need its scope, collection window, included outcomes and sufficient relevant observations before drawing conclusions. Begin by keeping the durations and stating the calculation; do not turn a small illustrative p99 into a user-facing guarantee.
- NIST / SEMATECH e-Handbook: 7.2.6.2 Percentiles
Explains sorted observations, ranks and the existence of different sample-percentile estimation / interpolation methods. Our explicitly defined ceil(p * n) nearest-rank rule is a chosen no-interpolation convention, not the NIST default or a claim that all tools use it.
- Prometheus documentation: Histograms and summaries
Distinguishes count / sum averages from quantiles of observed durations, with measurement-window, histogram / summary estimation and aggregation qualifications. The paper exercise uses all supplied individual observations, not a PromQL query or bucket-based estimate.
AI source comparison recorded 2026-10-17. Human learner validation is pending.
Quick quiz · one question
Read the supplied duration distribution
Sample scenario. Complete synthetic observations in integer milliseconds from client send to client-observed response. No real collection, requests, timeouts, rounding of the mean or hidden observations. Sort ascending with duplicates retained; choose one-based rank ceil((percent/100) × count), no interpolation. This is our stated convention, not a universal or NIST-default method.
- Observed measurement boundary
All listed values are supplied fictional integer milliseconds from client send to client-observed response. No requests, collection, hidden observations, timeout policy, causal model, population estimate or SLO evidence.- Chosen percentile convention
Sort ascending with ties retained. For a requested percentage, round up (percentage / 100) × observation count, then select that one-based position. No interpolation or averaging of adjacent positions. Other conventions, including a default median, can differ.- Requested percentages
p50, p90, p99- Observed batch A
10, 1000, 10, 10, 10, 10, 10, 10, 10, 10 ms. Arithmetic mean is the sum divided by count, without rounding it upward.
For these ten observed durations, compute the mean and the explicitly chosen nearest-rank p50, p90 and p99. Keep the observed batch separate from claims about future traffic.
Why this answer?
Answers stay on this device.
Sources and exercise scope
- NIST / SEMATECH e-Handbook: 7.2.6.2 Percentiles
Explains sorted observations, ranks and the existence of different sample-percentile estimation / interpolation methods. Our explicitly defined ceil(p * n) nearest-rank rule is a chosen no-interpolation convention, not the NIST default or a claim that all tools use it.
- Prometheus documentation: Histograms and summaries
Distinguishes count / sum averages from quantiles of observed durations, with measurement-window, histogram / summary estimation and aggregation qualifications. The paper exercise uses all supplied individual observations, not a PromQL query or bucket-based estimate.
Original synthetic exercise. AI comparison against the reviewed lesson recorded on 2026-10-17; the references above state their scope. Human learner validation has not been run. A result here records this attempt; it does not establish mastery.
Save or adjust this lesson
Make this lesson yours
Save it for later, or tell your robot what would help.
This correction stays on this browser. Browse all concepts if the topic is missing.
Familiarity is your own assessment. To use it in your coding tool, download your updated learning profile.
Choices are saved on this browser. They do not sync to your account or coding tool.