Detection Latency Has a Missing Denominator
Evaluate detection releases with paired replays, explicit deadline coverage, rules for crediting alerts, and coverage bounds when follow-up is incomplete.
A detection release can look faster on the dashboard while leaving more activity unreported. The median time to alert can fall simply because some of the slowest alerts have disappeared.
In a fictional release evaluation, incumbent A and candidate B each face the same 100 scenarios that should trigger an alert. Each scenario gets 20 minutes of follow-up. Among scenarios that receive a qualifying alert in that window, B's median is 2 minutes and A's is 5. By the end of follow-up B has alerted on 70 scenarios and A on 90. The median on the dashboard gives each version a different denominator.
The operational requirement in this replay is a qualifying alert on at least 80 of the 100 expected positives within 10 minutes. The rest of the observation window shows how much coverage the team would recover by waiting, even though late alerts arrive after the response deadline. Both cutoffs are inclusive.
What earns credit for a detection?
The unit is a reviewed scenario instance with an expected outcome, an activity timestamp, and evidence that identifies a qualifying alert. For a sequence, anchoring at the first action measures how long the activity can go unreported. Anchoring at the action that completes the required evidence measures how long the system takes once the underlying activity can support a decision. A release comparison needs the same anchor on both sides. Switching anchors can manufacture a speedup even if the alert timestamps stay put.
A shared account and a broad time window make a particularly generous join. One account-level alert can appear to cover several concurrent scenarios even though its payload identifies only one of them. A source event ID or similarly specific evidence should tie each credited scenario to the delivered alert. Preserve the alert ID with each match so reviewers can tell where several successes depended on one notification. If analysts act on a bundle as one incident, define and review the incident as the evaluation unit before replay. Only the first qualifying alert earns coverage credit. Further deliveries for the same scenario contribute to repeat-alert load.
Pair outcomes by scenario ID and inspect coverage by source, event order, and arrival delay. A gain on a common endpoint scenario can offset a loss on a protected administrative workflow in the aggregate while leaving a serious gap. Critical scenarios can have prespecified vetoes. Any weighted coverage rollup needs the same weights for both builds. A suite enriched for rare timing failures can expose release regressions without estimating how frequent they will be in production.
In an illustrative stratum of 20 distinct scenarios, one missed detection moves observed coverage by five percentage points. That is the resolution of the count. Even if those scenarios were independently sampled, 16 detections out of 20 would give a 95% Wilson interval of roughly 58% to 92%, about 34 percentage points wide. If the gate is meant to support an inference about production coverage, size the sample for the precision that decision requires. Running a trace repeatedly can expose timing variability while leaving the number of distinct scenarios unchanged.
Where the detection curves cross
With complete follow-up, divide the number of scenarios alerted by any elapsed time by the original positive cohort to get cumulative coverage. In the fictional replay, both versions start at zero detections. All first qualifying alerts arrive at the plotted cutoffs. A has detected 20, 50, 80, and 90 scenarios at minutes 2, 5, 10, and 20. B has detected 40, 65, 70, and 70 at those same times. A reaches the floor with a batch at the deadline. Its final batch arrives at the observation cutoff.
Figure 1 — At minute 5, B has 65 detections to A's 50. At the minute-10 response deadline, A leads 80 to 70. Illustrative release replay, not measured data.
The conditional medians come from the middle two detections for each version. A's 45th and 46th land at minute 5. B's 35th and 36th land at minute 2. Both versions reach half the original cohort at minute 5, their full-cohort median. The final paired counts below show only five B-only detections, so at least 35 of B's 40 detections by minute 2 also alert under A by minute 20. A detects only 20 scenarios by minute 2, which means B alerts earlier on at least 15 scenarios that both versions detect. Compare paired alert times across the entire shared set to see where that speed gain holds.
When the observer goes quiet
A scenario with no alert through the deadline is a known miss when the delivery record is complete. If the collector that records deliveries goes offline before the deadline and no other record can fill the gap, a scenario still awaiting an alert has an unknown deadline outcome. For a time-to-detection analysis with uninterrupted observation up to the outage, right-censor that scenario at the last reliable observation time. An observed, irreversible suppression of every qualifying delivery for an as-yet undetected scenario is a competing event. It establishes a deadline miss even if observation later stops. The liveness checks in Measure Silence Before Trusting Detection help distinguish a quiet stream from a collection failure.
With independent censoring and detection as the sole terminal outcome, one minus Kaplan–Meier estimates the cumulative probability of detection. With independent censoring and competing events, Aalen–Johansen weights the detection increments by the estimated probability of reaching each step free of any terminal event. Treating a permanent suppression as censoring would instead redistribute its probability among scenarios that can still alert.
If the collector tends to lose visibility on busy runs, an estimator that assumes independent censoring can overstate on-time coverage. Bound coverage by dividing known on-time detections by the original cohort, then adding every unresolved deadline outcome to the numerator for the upper bound. In a separate fictional run with 100 positives, 76 known on-time detections and six unknown outcomes put coverage between 76% and 82%. Against an 80% floor, four confirmed successes among the six would establish a pass. Three confirmed misses would establish a fail. If an estimated cumulative curve stays below half throughout supported follow-up, the full-cohort median remains unestimated.
Why a two-minute delay can move an alert by five
Keep occurrence time, collection time, and processing time separate, and account for clock uncertainty when subtracting timestamps across hosts. In an isolated delay test, measure across the affected stage and verify that its elapsed time increases by the injected amount within clock and timestamp uncertainty. Arrival at the collector can precede queryability, which is the timestamp that matters for a scheduled rule.
With fixed evaluation interval T, suppose each run sees records queryable by its scheduled start, the record stays in scope, and time from run start to delivery stays fixed. The delay shifts the first eligible run by either ⌊d / T⌋ or ⌈d / T⌉ intervals, depending on where queryability falls in the schedule. The added end-to-end latency is at most ⌈d / T⌉ × T, always strictly less than d + T. The affected stage should show the full injected delay either way.
Figure 2 uses fictional runs at minutes 5, 10, and 15 with a two-minute delay at the queryability stage. That stage takes two extra minutes at every point. Records originally queryable at minutes 1, 2, 6, and 7 still make their original run, adding zero minutes to delivery. The records at minutes 4 and 9 slip to the next run, adding five minutes, the maximum under this schedule.
Figure 2 — Only the records originally queryable at minutes 4 and 9 miss their scheduled run. Each slips five minutes after a two-minute stage delay. Illustrative scheduling example, not measured data.
A narrow lookback can turn the same timing effect into a miss. In a separate illustrative replay, a rule runs every five minutes and scans the previous five minutes of event time. A record stamped at minute 0 becomes queryable at minute 7. It is unavailable at the minute-5 run and out of scope at the minute-10 run. The queryability timestamp and the actual query windows distinguish this failure from a record lost in collection. A wider lookback can recover the event, at the cost of more scanning and the risk of repeat delivery across overlapping runs. Test both sides of a run boundary at representative concurrency. Accelerated replay can change backlog and the alignment between arrivals and scheduled evaluations.
Release decision
The two matrices show how the same expected-positive scenarios fared in the illustrative replay. Gains are B-only detections and losses are A-only detections.
| By minute 10 | B detects | B misses |
|---|---|---|
| A detects | 65 | 15 |
| A misses | 5 | 15 |
| By minute 20 | B detects | B misses |
|---|---|---|
| A detects | 65 | 25 |
| A misses | 5 | 5 |
With independently sampled pairs, an exact two-sided McNemar test would ask how often equal deadline coverage produces an imbalance at least this large among 20 discordant pairs. Five gains versus 15 losses gives p ≈ 0.041, below an illustrative 0.05 significance threshold under that sampling model. This replay is a fixed, curated suite, so the discordant counts are descriptive and the prespecified coverage floor drives the gate. When scenarios share a source run in a sampled study, any resampling for uncertainty should preserve both the run clusters and the version pairs.
The fictional decision record includes 100 reviewed negatives per version. Count each negative once if an adjudicated trigger arrives by minute 10. A separate 20-hour background run per version uses identical traffic and no injected scenarios. Divide the deliveries reviewers flag as nonactionable in that run by its 20 monitored hours.
For the positive replay, count qualifying deliveries after the first one for each scenario through its inclusive minute-20 cutoff. Divide those repeats by the number of positives detected by minute 20. B's lower repeat count partly reflects its 20 fewer detected positives. The normalized burden still falls, from 18/90 = 0.20 for A to 10/70 ≈ 0.14 for B. To assess suppression itself, use shared detections and equal follow-up after each first alert. With a cutoff measured from scenario start, an early first alert leaves more time for repeats than one delivered at the cutoff. The enriched test mix cannot establish production precision.
| Release measure | Requirement | A | B |
|---|---|---|---|
| Positives alerted by minute 10 | At least 80/100 | 80/100 | 70/100 |
| Negatives triggering by minute 10 | At most 5/100 | 4/100 | 3/100 |
| Nonactionable background alerts per monitored hour | At most 0.75 | 0.60 (12 alerts) | 0.40 (8 alerts) |
| Repeat deliveries per detected positive through minute 20 | At most 0.25 | 0.20 (18/90) | ≈0.14 (10/70) |
Both versions meet the review limits. Keep A in production because it meets the deadline coverage floor. To clear that floor, B's successor needs at least ten net additional on-time detections on this suite while staying within the review limits. Compare its paired alert times against A on shared detections to see whether the earlier deliveries survive the recovery in coverage.