mirror of
https://github.com/Kpa-clawbot/meshcore-analyzer.git
synced 2026-05-14 16:55:34 +00:00
d7172961f4
Implement all analytics endpoints from in-memory PacketStore instead of returning stubs/empty data. Each handler now matches the Node.js response shape field-by-field. Endpoints fixed: - /api/analytics/topology (#135): full hop distribution, top repeaters, top pairs, hops-vs-SNR, per-observer reachability, cross-observer comparison, best path analysis - /api/analytics/distance (#137): haversine distance computation, category stats (R↔R, C↔R, C↔C), distance histogram, top hops/paths, distance over time - /api/analytics/hash-sizes (#136): hash size distribution from raw_hex path byte parsing, hourly breakdown, top hops, multi-byte node tracking - /api/analytics/hash-issues (#138): hash-sizes data now populated so frontend collision tab can compute inconsistent sizes and collision risk - /api/analytics/route-patterns (#134): subpaths and subpath-detail now compute from in-memory store with hop resolution - /api/nodes/bulk-health (#140): switched from N per-node SQL queries to in-memory PacketStore lookups with observer stats - /api/channels (#142): response shape already correct via GetChannels; analytics/channels now returns topSenders, channelTimeline, msgLengths - /api/analytics/channels: full channel analytics with sender tracking, timeline, and message length distribution All handlers fall back to DB/stubs when store is nil (test compat). All 42+ existing Go tests pass. go vet clean. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>