Skip to content

Split QueryStoreService.cs into partial classes#332

Merged
erikdarlingdata merged 1 commit into
devfrom
feature/split-querystoreservice
May 13, 2026
Merged

Split QueryStoreService.cs into partial classes#332
erikdarlingdata merged 1 commit into
devfrom
feature/split-querystoreservice

Conversation

@erikdarlingdata
Copy link
Copy Markdown
Owner

Summary

Move-only refactor of PlanViewer.Core/Services/QueryStoreService.cs (1,541 lines) into 3 partial-class files.

File sizes

File Lines Contents
QueryStoreService.cs (main) 841 Top-of-pipe fetches: CheckEnabledAsync, FetchTopPlansAsync, FetchAggregateHistoryAsync, FetchTimeSliceDataAsync
.Grouped.cs 542 FetchGroupedByQueryHashAsync, FetchGroupedByModuleAsync
.WaitStats.cs 157 IsWaitStatsCaptureEnabledAsync, FetchGlobalWaitStatsAsync, FetchGlobalWaitStatsRibbonAsync, BuildWaitProfile

Behavior

  • Move-only. No method bodies were modified.
  • Class made partial (was public static class).
  • Not linked in PlanViewer.Web (Microsoft.Data.SqlClient is WASM-incompatible) — no csproj update needed.

Test plan

  • dotnet build PlanViewer.sln — 0 errors, 0 warnings
  • dotnet test tests/PlanViewer.Core.Tests — passes
  • Open Query Store dialog against a live server, fetch top plans (flat + grouped)
  • Group by query hash and module — both return data
  • Wait stats panel populates from FetchGlobalWaitStatsAsync

🤖 Generated with Claude Code

@erikdarlingdata erikdarlingdata changed the base branch from main to dev May 13, 2026 03:17
Move-only refactor; no behavior changes. QueryStoreService.cs (1,403
lines) split into 3 partials:

  Grouped    (584) - FetchGroupedByQueryHashAsync +
                     FetchGroupedByModuleAsync
  WaitStats  (232) - IsWaitStatsCaptureEnabledAsync +
                     FetchGlobalWaitStatsAsync +
                     FetchPlanWaitStatsAsync +
                     FetchGlobalWaitStatsRibbonAsync +
                     BuildWaitProfile

Main file now 584 lines — top-of-pipe fetches: CheckEnabledAsync,
FetchTopPlansAsync, FetchAggregateHistoryAsync, FetchTimeSliceDataAsync.

Class made `static partial`.

Build clean: 0 errors, 0 warnings on PlanViewer.Core.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@erikdarlingdata erikdarlingdata force-pushed the feature/split-querystoreservice branch from 7bd102c to bc44255 Compare May 13, 2026 03:23
@erikdarlingdata erikdarlingdata merged commit 5262721 into dev May 13, 2026
2 checks passed
@erikdarlingdata erikdarlingdata deleted the feature/split-querystoreservice branch May 13, 2026 03:31
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