Repository navigation
B2.2: Add /insights/trends aggregation pipeline and index support for… - #1056
mansipatel765-sk wants to merge 3 commits into
Conversation
… insights queries
Maneesh-Kumar-Maddini
left a comment
There was a problem hiding this comment.
o timestamp defect was identified during review. Please provide a focused check showing correct daily totals for the supported timestamp formats, along with execution-plan evidence for the actual aggregation queries. Approval is pending that verificatio
|
Hi @Maneesh-Kumar-Maddini, thanks for the review. Your comment looks cut off on my side (it starts with "o timestamp defect..." and ends at "verificatio"), so I've read it as asking me to prove the daily totals and plans. Let me know if I got it wrong. I've updated the writeup with two things:
|
|
Thanks, Mansi. You interpreted my truncated comment correctly: it should have started with “No timestamp defect was identified during review.” I was requesting evidence of correct daily totals across supported timestamp formats and execution plans for the actual pipelines. The updated evidence addresses that request and correctly explains the remaining collection scans. Please resolve the conflict in |
Signed-off-by: nandu1231239 <83577828+nandu1231239@users.noreply.github.com>
Task
B2.2 (Shared, under B2 – Detection Insights and Analytics Extension)
Summary
Added a new /insights/trends aggregation pipeline (detections grouped by day, reusing existing filter/normalization helpers) and a new compound index on the events collection (species, sensorId, timestamp). Species/sensorId filtered queries now use the index (IXSCAN) instead of a full collection scan. Date-range-only and unfiltered queries still do a COLLSCAN because the date filter runs on the computed _normalizedTs field. Also verified daily totals across the supported timestamp formats (Date and ISO strings, grouped by UTC day).
Evidence
See src/production/backend/docs/sprint2/B2.2-insights-aggregation-index-support.md for the timestamp format check, explain() results from the actual endpoint pipelines, and full test steps.
Reviewer
As per Sprint 2 allocation (B2, Shared) — no reviewer added per team instruction.