feat(stats): 24-hour hourly traffic histogram with duty-cycle estimate#69
Open
iceice400 wants to merge 1 commit into
Open
feat(stats): 24-hour hourly traffic histogram with duty-cycle estimate#69iceice400 wants to merge 1 commit into
iceice400 wants to merge 1 commit into
Conversation
Add SQL-backed GET /api/stats/hourly with Meshtastic/MeshCore hourly buckets and estimated duty cycle from per-modem ToA math. Stats tab shows a stacked 24h chart with EU868 1% reference line when applicable.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
GET /api/stats/hourly?hours=24— SQL-backed hourly Meshtastic/MeshCore packet counts with estimated time-on-air and duty-cycle %src/analytics/toa_estimate.pyhelper (shared with future PR 7 duty-cycle work)Why
The existing 60-minute timeline scans only the last 2000 in-memory packets. Backbone nodes need accurate 24h history from SQLite (
idx_packets_timestamp).Type
Testing
Manual checklist (on gateway):
radio.region: EU_868→ dashed 1% limit line;US→ no limit linepacketstableHardware: RAK7248 or Pi + HAT · US915 / EU868
Impact
Risks: Low — read-only SQL aggregation; ToA is an estimate only (does not drive TX throttle). No schema migration.
AI-assisted?