Skip to content

fix(dashboard): wire live metrics, breakdowns, and session history#19

Open
aliatx2017 wants to merge 1 commit into
ojuschugh1:mainfrom
aliatx2017:fix/dashboard-live-metrics
Open

fix(dashboard): wire live metrics, breakdowns, and session history#19
aliatx2017 wants to merge 1 commit into
ojuschugh1:mainfrom
aliatx2017:fix/dashboard-live-metrics

Conversation

@aliatx2017
Copy link
Copy Markdown

Dashboard always showed zero — cmd_dashboard never connected to session store. Metrics struct wired, SSE serving, no writer ever connected.

Added background thread polling ~/.sqz/sessions.db every 5s:

  • Top KPIs: tokens_saved, compression_ratio from compression_stats()
  • Per-Tool Breakdown: GROUP BY stages_applied, comma-split into individual tools
  • Per-Command Breakdown: GROUP BY mode from compression_log
  • Session History: list_sessions() from sessions table
  • Auto-creates synthetic dashboard session when compression data exists

New SessionStore methods:

  • list_sessions(limit) — direct SQL, no FTS5 dependency
  • save_dashboard_session(id, summary) — lightweight upsert
  • per_tool_breakdown() — GROUP BY stages_applied, split on comma
  • per_command_breakdown() — GROUP BY mode

Also ran cargo fmt across entire codebase.

Zero new dependencies.

Dashboard always showed zero — cmd_dashboard never connected
to session store. Metrics struct scaffolded, SSE serving,
no data writer ever connected.

Added background thread polling ~/.sqz/sessions.db every 5s:
- Top KPIs: tokens_saved, compression_ratio from compression_stats()
- Per-Tool: stages_applied GROUP BY, comma-split into individual tools
- Per-Command: mode GROUP BY from compression_log
- Sessions: list_sessions() from sessions table
- Auto-creates synthetic dashboard session when data exists

New SessionStore methods:
- list_sessions(limit) — direct SQL, no FTS5 dependency
- save_dashboard_session(id, summary) — lightweight upsert
- per_tool_breakdown() — GROUP BY stages_applied, split on comma
- per_command_breakdown() — GROUP BY mode

Zero new dependencies.
@aliatx2017 aliatx2017 force-pushed the fix/dashboard-live-metrics branch from a89853c to 98b5342 Compare May 28, 2026 04:24
@aliatx2017
Copy link
Copy Markdown
Author

Screenshot 2026-05-27 at 11 28 51 PM

@ojuschugh1
Copy link
Copy Markdown
Owner

Thank you for this PR, will take a look. Please feel free to contribute more , open PRs and Issues. Thanks again, really appreciate it !!!

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.

2 participants