Repository navigation
v1.0.18 — expose per-task queue and run timings
Adds a queue-wait / run-time split that a producer can actually read.
Why: a generation API answered a request in 37.7s while the only timer in its response read generationTime: 5.55. That timer starts after enqueue, so it hid the handler's work and merged queue wait into the run. ModelQ already recorded the timestamps but never surfaced them.
Changes
- The task decorator now mirrors
created_at/queued_atonto theTaskobject it returns (previously written only into the Redis blob, sotask.queued_atwas alwaysNone). Task.get_result()absorbsqueued_at/started_at/finished_atfrom the terminal blob, before it can raise — so a failed or cancelled task still reports where its time went.- New
Task.stage_timings()→{queue_time, run_time, total_time}. Stages that cannot be measured are omitted, never reported as0.0.
Compatibility: fully additive. Result blobs from older workers leave existing timestamps untouched and stage_timings() returns {}.
PR: #20