Skip to content

Add query execution statistics dashboard#52

Open
muk2 wants to merge 2 commits intomainfrom
feature/issue-38-query-stats
Open

Add query execution statistics dashboard#52
muk2 wants to merge 2 commits intomainfrom
feature/issue-38-query-stats

Conversation

@muk2
Copy link
Owner

@muk2 muk2 commented Feb 20, 2026

Summary

  • Adds a Query Statistics panel accessible via Ctrl+Shift+S showing session and all-time query execution metrics
  • Tracks total queries, successful/failed counts, success rate, min/max/avg execution times
  • Status bar shows live session query count and average execution time after the first query
  • Panel supports scrolling with Up/Down arrows and closes with Esc/q

Implementation Details

src/ui/app.rs

  • Added StatsPanel variant to the Focus enum
  • Added QueryStats struct with record_query(), avg_time_ms(), success_rate(), and session_avg_time_ms() methods
  • Added query_stats and stats_scroll fields to App
  • Added handle_stats_input() for panel navigation
  • Integrated stats recording into execute_query() flow
  • Added Ctrl+Shift+S keyboard shortcut to open stats panel
  • 3 unit tests for QueryStats struct

src/ui/components.rs

  • Added draw_stats_panel() function rendering a centered overlay with session and all-time statistics
  • Updated draw() to render stats panel when focused
  • Updated draw_status_bar() to show session query count and average time
  • Added Ctrl+Shift+S to help overlay

Test plan

  • cargo build compiles without errors
  • cargo test - all 228 tests pass
  • Manual: Execute queries and verify stats update in status bar
  • Manual: Press Ctrl+Shift+S to open stats panel and verify metrics
  • Manual: Verify Up/Down scrolling and Esc/q close behavior

Closes #38

🤖 Generated with Claude Code

muk2 and others added 2 commits February 20, 2026 15:05
…trics

Adds a stats panel (Ctrl+Shift+S) showing session and all-time query
statistics including total queries, success rate, min/max/avg execution
times. The status bar also shows live session query count and average
time after the first query is executed.

Closes #38

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Run cargo fmt for consistent code formatting.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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.

Feature: Query execution statistics and dashboard

1 participant