perf(statistics): batch per-cycle peak and average occupancy Riemann integration #203

Open
opened 2026-10-02 15:00:47 +00:00 by gabogg · 0 comments
Owner

Follow-up from #96 and PR #167: batch per-cycle peak and average occupancy integration across multi-day ranges.

Context

In get_statistics_daily_series_async, per-cycle peak occupancy (get_cycle_peak_occupancy_async) and Little's Law average integration (get_cycle_average_occupancy_async) still run per active day containing event data. While quality, flow, calibration logs, schedule calendar, and open-window counts are batched, a 62-day daily series query with data on all days still executes ~120 individual queries for peak and average Riemann sums.

Acceptance Criteria

  • Batch the Riemann integration or cumulative step calculation for peak and average occupancy over multi-day periods, reducing per-day roundtrips.
  • Preserve parity with get_cycle_peak_occupancy_async and get_cycle_average_occupancy_async results, including exit multiplier handling and open window boundaries.
  • Reduce 62-day daily series query count to O(1) batched queries.
Follow-up from #96 and PR #167: batch per-cycle peak and average occupancy integration across multi-day ranges. ## Context In `get_statistics_daily_series_async`, per-cycle peak occupancy (`get_cycle_peak_occupancy_async`) and Little's Law average integration (`get_cycle_average_occupancy_async`) still run per active day containing event data. While quality, flow, calibration logs, schedule calendar, and open-window counts are batched, a 62-day daily series query with data on all days still executes ~120 individual queries for peak and average Riemann sums. ## Acceptance Criteria - Batch the Riemann integration or cumulative step calculation for peak and average occupancy over multi-day periods, reducing per-day roundtrips. - Preserve parity with `get_cycle_peak_occupancy_async` and `get_cycle_average_occupancy_async` results, including exit multiplier handling and open window boundaries. - Reduce 62-day daily series query count to O(1) batched queries.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
gabogg/hikcentral#203
No description provided.