Skip to content

Add per-tab time range slicers to Dashboard query tabs#662

Merged
erikdarlingdata merged 1 commit intodevfrom
feature/dashboard-query-slicers
Mar 20, 2026
Merged

Add per-tab time range slicers to Dashboard query tabs#662
erikdarlingdata merged 1 commit intodevfrom
feature/dashboard-query-slicers

Conversation

@erikdarlingdata
Copy link
Copy Markdown
Owner

Summary

Interactive time range slicers on all four Dashboard query sub-tabs:

  • Active Queries: Sessions/CPU/Reads/Writes per hour (WAITFOR excluded)
  • Query Stats: Total/Avg CPU, Duration, Reads, Writes with fromSlicer collection_time filtering
  • Procedure Stats: Same metrics with fromSlicer pattern
  • Query Store: Same metrics with fromSlicer pattern

Key implementation details:

  • fromSlicer parameter on GetQueryStatsAsync, GetProcedureStatsAsync, GetQueryStoreDataAsync — switches WHERE clause to filter by collection_time instead of execution/creation time
  • Selection preserved on auto-refresh (slicer maps previous timestamps to new data range)
  • Grid uses slicer dates during auto-refresh when HasNarrowedSelection is true
  • Proportional time positioning (data points placed by actual time, not array index)
  • Evenly-spaced time labels with minimum 90px spacing and edge clipping protection
  • TRY_CAST to money for sp_WhoIsActive varchar metric columns

Also includes Lite slicer improvements:

  • Height bumped to 130px (Dashboard 150px)
  • Proportional time positioning fix
  • Label spacing fix
  • Metric label font bumped to 13pt with foreground brush

Test plan

  • Build: 0 errors (Dashboard + Lite)
  • All four Dashboard slicers render and load data
  • Slider drag filters grid by collection_time
  • Sort column changes slicer metric
  • Auto-refresh preserves slicer selection and grid filter
  • Time display mode updates slicer labels
  • Proportional positioning shows data gaps accurately
  • Labels don't overlap or clip edges

🤖 Generated with Claude Code

Active Queries, Query Stats, Procedure Stats, Query Store each get their own slicer:
- Slicer data aggregated by hourly collection_time buckets
- fromSlicer parameter filters by collection_time (not execution time) when slicer is active
- Metric label updates on grid sort (total/avg CPU, duration, reads, writes)
- Selection preserved on auto-refresh
- Grid respects slicer dates during auto-refresh (HasNarrowedSelection check)
- Time display mode (Local/UTC/Server) updates slicer labels
- Proportional time positioning for accurate data-gap representation
- Hour-boundary snapping for accurate filtering
- WAITFOR queries excluded from Active Queries slicer
- TRY_CAST to money for sp_WhoIsActive varchar metric columns

Also bumps Lite slicer height to 130px, Dashboard to 150px.
Fixes proportional time positioning and label spacing in both Lite and Dashboard slicers.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@erikdarlingdata erikdarlingdata merged commit 79b0868 into dev Mar 20, 2026
3 checks passed
@erikdarlingdata erikdarlingdata deleted the feature/dashboard-query-slicers branch April 10, 2026 19:00
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