Duration Calculation Engine
Bell Canada
A Python routine that measures how long each stage of an agent work cycle takes, across events that do not always arrive in order.
The old numbers were wrong whenever events landed out of sequence, and duration was a metric leadership actually watched.
- 01Events out of order
- Broke
- Durations came out wrong — sometimes negative — whenever an event log arrived out of sequence.
- Why
- The first version walked the events in a single pass and assumed they were already sorted in time. Real data is not that polite.
- Fix
- Rebuilt it as a two-pass group-by: anchor each cycle first, then propagate and backfill durations. Deterministic, and QA defects went to zero.
3duration metrics
Evidence before confidence.