Skip to content

Add persistent daily stats with weekly/monthly breakdowns#6

Merged
schlunsen merged 1 commit into
mainfrom
feat/persistent-daily-stats
Apr 3, 2026
Merged

Add persistent daily stats with weekly/monthly breakdowns#6
schlunsen merged 1 commit into
mainfrom
feat/persistent-daily-stats

Conversation

@schlunsen

Copy link
Copy Markdown
Owner

Summary

  • StatsStore: New SQLite daily_stats table that accumulates connection stats every 5s poll cycle — daily totals, unique IPs, peak connections, new IPs, top country, top process
  • StatsView: New stats panel with summary cards (days monitored, unique IPs, total connections, peak, current streak), a 30-day bar chart, and weekly/monthly period breakdowns
  • Globe window: New "Stats" tab (4th tab) with expandable details panel
  • Menu bar popover: New "This week: X IPs, Y connections" summary line
  • Mac app now also writes to the Rust CLI's connections/seen_ports/seen_processes tables, so history grows even when only the mac app is running

Storage impact

~22 KB/year for the daily_stats table — negligible.

Test plan

  • Build the mac app and verify it compiles cleanly
  • Launch the app and let it run for a few poll cycles
  • Open the globe window, click "Stats" tab, click "Details" to expand the stats panel
  • Verify the menu bar popover shows the "This week" summary after data accumulates
  • Check ~/Library/Application Support/maperick/history.db contains a daily_stats table with today's row

🤖 Generated with Claude Code

The mac app now accumulates connection stats over time so users can see
interesting trends weekly, monthly, and all-time. Stats are written to
the shared history.db on every poll cycle (~5s).

New:
- StatsStore: SQLite daily_stats table + per-IP history writer
- StatsView: bar chart (30-day), summary cards, weekly/monthly periods
- Stats tab in globe window with expandable details panel
- "This week" summary line in menu bar popover

The mac app also writes to the Rust CLI's connections/seen_ports/
seen_processes tables, so history grows even when only the mac app runs.

Storage: ~22 KB/year for daily_stats — negligible.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@schlunsen schlunsen merged commit 48e8a79 into main Apr 3, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant