mirror of
https://github.com/Kpa-clawbot/meshcore-analyzer.git
synced 2026-10-22 22:41:26 +00:00
Observability: - Add DBStats struct with atomic counters for tx_inserted, tx_dupes, obs_inserted, node_upserts, observer_upserts, write_errors - Log SQLite config on startup (busy_timeout, max_open_conns, journal) - Periodic stats logging every 5 minutes + final stats on shutdown - Instrument all write paths with counter increments Tests: - TestConcurrentWrites: 20 goroutines × 50 writes (1000 total) with interleaved InsertTransmission + UpsertNode + UpsertObserver calls. Verifies zero errors and data integrity under concurrent load. - TestDBStats: verifies counter accuracy for inserts, duplicates, upserts, and that LogStats does not panic