diff --git a/docker-compose.yml b/docker-compose.yml index a5de96d..1cc9f4b 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -236,9 +236,9 @@ services: - NODE_CLEANUP_ENABLED=${NODE_CLEANUP_ENABLED:-true} - NODE_CLEANUP_DAYS=${NODE_CLEANUP_DAYS:-30} # Raw packet capture (derived from FEATURE_PACKETS so one var drives both - # capture and the web Packets page). Retention defaults to 7 days. + # capture and the web Packets page). Retention defaults to 2 days. - RAW_PACKET_CAPTURE_ENABLED=${FEATURE_PACKETS:-true} - - RAW_PACKET_RETENTION_DAYS=${RAW_PACKET_RETENTION_DAYS:-7} + - RAW_PACKET_RETENTION_DAYS=${RAW_PACKET_RETENTION_DAYS:-2} # Observer ingestion filter (allow/deny remote observers by public key/prefix). # Allowlist overrides denylist; both empty accepts all observers (default). - OBSERVER_ALLOWLIST=${OBSERVER_ALLOWLIST:-} diff --git a/docs/configuration.md b/docs/configuration.md index baf580b..e095d72 100644 --- a/docs/configuration.md +++ b/docs/configuration.md @@ -92,7 +92,7 @@ The collector subscribes to MQTT events and persists them to the database. For p | --- | --- | --- | | `CHANNEL_REFRESH_INTERVAL_SECONDS` | `300` | Seconds between channel-key refresh from the database (minimum `10`) | | `ROUTE_EVALUATOR_INTERVAL_SECONDS` | `300` | Seconds between route health evaluations. `0` disables the background evaluator (route cards then stay `unknown`). See [routes.md](routes.md) | -| `ROUTE_HISTORY_BACKFILL_INTERVAL_SECONDS` | `3600` | Seconds between route-health history backfill sweeps (recomputes completed-day buckets for the retention window). `0` disables the backfill; the dashboard strip and `/routes/{id}/history` then only reflect the live 60 s evaluator sweeps. See [routes.md](routes.md) | +| `ROUTE_HISTORY_BACKFILL_INTERVAL_SECONDS` | `3600` | Seconds between route-health history backfill sweeps (recomputes completed-day buckets for the retention window). `0` disables the backfill; the dashboard strip and `/routes/{id}/history` then only reflect the live 300 s evaluator sweeps. See [routes.md](routes.md) | ### Observer Ingestion Filters diff --git a/docs/seeding.md b/docs/seeding.md index 86b4f30..7b306b1 100644 --- a/docs/seeding.md +++ b/docs/seeding.md @@ -126,7 +126,7 @@ routes: description: A140 corridor route visibility: community match_width: 1 - window_hours: 48 + window_hours: 6 packet_count_threshold: 5 # clear_threshold: 15 # optional; omit/null = 3x threshold # max_hop_span: 8 # optional; omit/null = unlimited diff --git a/example/seed/routes.yaml b/example/seed/routes.yaml index b5b7bdc..78b4a08 100644 --- a/example/seed/routes.yaml +++ b/example/seed/routes.yaml @@ -17,7 +17,7 @@ routes: description: A140 corridor route visibility: community match_width: 1 - window_hours: 24 + window_hours: 6 packet_count_threshold: 3 # clear_threshold: 10 # optional; omit/null = 2x threshold # max_hop_span: 8 # optional; omit/null = unlimited diff --git a/src/meshcore_hub/api/routes/routes.py b/src/meshcore_hub/api/routes/routes.py index 1d00564..30ed4e9 100644 --- a/src/meshcore_hub/api/routes/routes.py +++ b/src/meshcore_hub/api/routes/routes.py @@ -426,7 +426,7 @@ def _load_recent_matches( """Return the route's top-3 recent matches in the ``RecentMatchPath`` shape. Reads the normalized ``route_recent_matches`` table (populated by the - background evaluator on every 60s tick), JOINs through ``raw_packets`` + background evaluator on every 300s tick), JOINs through ``raw_packets`` for the packet-level metadata, then fetches the matched hop slice from ``packet_path_hops`` in a second indexed query and slices ``[first_position .. last_position]`` per match in Python. Falls back diff --git a/src/meshcore_hub/collector/subscriber.py b/src/meshcore_hub/collector/subscriber.py index 7560233..222a246 100644 --- a/src/meshcore_hub/collector/subscriber.py +++ b/src/meshcore_hub/collector/subscriber.py @@ -52,7 +52,7 @@ class Subscriber(LetsMeshNormalizer): node_cleanup_days: int = 90, channel_refresh_interval_seconds: int = 300, raw_packet_capture_enabled: bool = False, - raw_packet_retention_days: int = 7, + raw_packet_retention_days: int = 2, observer_filter: Optional[ObserverFilter] = None, ): """Initialize subscriber. @@ -903,7 +903,7 @@ def create_subscriber( node_cleanup_days: int = 90, channel_refresh_interval_seconds: int = 300, raw_packet_capture_enabled: bool = False, - raw_packet_retention_days: int = 7, + raw_packet_retention_days: int = 2, observer_filter: Optional[ObserverFilter] = None, ) -> Subscriber: """Create a configured subscriber instance. @@ -989,7 +989,7 @@ def run_collector( node_cleanup_days: int = 90, channel_refresh_interval_seconds: int = 300, raw_packet_capture_enabled: bool = False, - raw_packet_retention_days: int = 7, + raw_packet_retention_days: int = 2, observer_filter: Optional[ObserverFilter] = None, ) -> None: """Run the collector (blocking).