Skip to content

Commit d45a6a6

Browse files
Wire wait stats config as single source of truth (#215 part 2)
- Trim WaitStats.json from 52 to 44 entries — drop server-level / instance- level waits (THREADPOOL, BACKUPIO, BACKUPBUFFER, HADR_SYNC_COMMIT, DBMIRROR_DBM_EVENT, SQLTRACE_BUFFER_FLUSH) and connection-setup waits (PREEMPTIVE_OS_AUTHENTICATIONOPS, PREEMPTIVE_OS_LOOKUPACCOUNTSID) that don't appear in plan XML's <WaitStats> element. - Populate attributes 6-8 (showWaitCount, showAverageWaitTime, timeCalculationModel) from existing tool behavior. Attributes 9-12 (applicable operators, descriptions, URLs, internal comment) remain null — those need domain expertise. - Add WaitStatsConfig loader (PlanViewer.Core.Services.WaitStatsConfig) that reads the JSON from an embedded resource at first access and caches by name (case-insensitive). Resource lookup is suffix-based so the file works whether embedded under PlanViewer.Core.* or PlanViewer.Web.* manifest prefixes. - BenefitScorer.IsExternalWait now delegates to WaitStatsConfig.IsExternal. Lookup misses fall back to false, preserving prior default for unknown waits. EmitWaitStatWarnings drops the WaitStatsKnowledge dependency entirely. - Delete WaitStatsKnowledge.cs — its ShowEffectiveLatency flag was the only structural data and is now sourced from WaitStatsConfig.ShowAverageWaitTime. Description/HowToFix were intentionally empty since #215 D3, so nothing of substance is lost. - Wire embedded resource into PlanViewer.Core.csproj and link it + WaitStatsConfig.cs into PlanViewer.Web.csproj (which links Core source files rather than referencing the project). All 75 Core tests pass; Core, App, and Web all build clean. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent e9729ea commit d45a6a6

6 files changed

Lines changed: 260 additions & 333 deletions

File tree

src/PlanViewer.Core/PlanViewer.Core.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121

2222
<ItemGroup>
2323
<EmbeddedResource Include="Resources\PlanIcons\*.png" />
24+
<EmbeddedResource Include="Resources\WaitStats.json" />
2425
</ItemGroup>
2526

2627
</Project>

0 commit comments

Comments
 (0)