1.4 KiB
1.4 KiB
Iteration Log - 2026-07-22-1905-adhoc
Request & Scope
- Request: Resolve telemetry bandwidth mismatch between main dashboard and detail modals by implementing time range-based summation.
- Affected Components: Proxy Collector, Backend routes (
/summary,/app-details,/device-details).
Steps Taken
- Analysis: Verified that MongoDB stored 24h cumulative snapshots periodically, which the backend then incorrectly
$summed across multiple periods, causing Terabyte multiplication. - Proxy Redesign: Changed the collection interval parameter from
1440(24h) to5(5m) in allnetifyqueries insideproxy/collector.js,proxy/collectorHelper.js, andproxy/collectorHelperDpi2.js. - Backend Refactoring:
/summary: Grouped and summedbandwidth_downandbandwidth_upover the timeRange filter./app-detailsand/device-details: Rewrote manual latest-timestamp deduplication logic into standard dynamic aggregation summation.
- Cleanup & Verification:
- Cleared existing contaminated data using
wipe_telemetry_collections.js. - Executed a fresh collector run with
clean_and_recollect.js. - Successfully verified endpoints with signed mock JWT credentials.
- Cleared existing contaminated data using
Outcome
- Real-time data is now stored in clean 5-minute delta slices.
- Dashboard queries dynamically scale their sums to the active
timeRangefilter, outputting realistic MB/GB scales instead of erroneous TB values.