Optional overrides
OptionalcorpusSize?: numberNumber of procedures to sample (default: CORPUS_SIZE)
Optionaldeadline?: numberOptional wall-clock deadline (epoch ms) for the
underlying fetchEventsBounded loop. When set, the rebuild stops
queueing additional events fetches once the deadline is reached and
builds the model from whatever was gathered (possibly empty). This is
how the request path keeps a cold-cache rebuild from starving its own
rate-limit budget. Concurrent callers that omit deadline still share
the same in-flight build, so the budget set by the first caller wins.
OptionalforceRefresh?: booleanIgnore cached model and rebuild
The lifecycle statistics model (possibly partial when deadline
fires before the full corpus has been fetched)
Build (or return cached) lifecycle statistics for the latest N procedures.
The corpus is cached for CACHE_TTL_MS; subsequent callers within the window receive the same model instance for free. Refreshing is lazy: a stale cache is rebuilt on the next call rather than on a timer, so idle processes pay no background cost. Cache and in-flight builds are keyed by
corpusSizeso distinct sample sizes never share a model.