Skip to content

Read blocking-chain typed columns instead of re-parsing XML#998

Merged
erikdarlingdata merged 1 commit into
devfrom
feature/dashboard-blocking-chain-typed-columns
May 27, 2026
Merged

Read blocking-chain typed columns instead of re-parsing XML#998
erikdarlingdata merged 1 commit into
devfrom
feature/dashboard-blocking-chain-typed-columns

Conversation

@erikdarlingdata
Copy link
Copy Markdown
Owner

Summary

  • Dashboard fact collector + drill-down collector now read the typed blocker-side columns from collect.blocking_BlockedProcessReport (added in Add typed blocker-side columns to blocking_BlockedProcessReport #996) instead of re-parsing blocked_process_report_xml on every analysis cycle — eliminates up to 5000 XElement.Parse calls per BLOCKING_CHAIN fact collection.
  • Dashboard/Analysis/BlockedProcessXmlParser.cs deleted; no callers remain.
  • Both SELECTs filter AND blocking_spid IS NOT NULL, dropping rows whose source XML had an empty <blocking-process><process/></blocking-process> (system tasks / torn-down sessions). Those rows can't contribute to a reconstructed chain — the old parser silently produced BlockingSpid = 0 for them, which the reconstructor rejected as a self-edge anyway.
  • Lite is unchanged. It has no SQL-side staging table and continues to parse once at collect time in RemoteCollectorService.BlockedProcessReport.

This is PR (b) of the SQL-side blocked-process-pair workstream. PR (a) was #996.

Test plan

  • dotnet build Dashboard/Dashboard.csproj -c Debug — clean, 0 warnings, 0 errors
  • dotnet test Lite.Tests/Lite.Tests.csproj — 260/260 passing (Lite untouched; cross-check)
  • git grep -n BlockedProcessXmlParser -- 'Dashboard/**' 'Lite/**' returns zero hits
  • Code-reviewer agent — clean (column-to-ordinal-to-BlockingPairRow mapping verified across all 11 columns; types align with schema; NULL fallbacks match field defaults)
  • Sync-checker agent — BlockingChainReconstructor.cs not touched on this branch
  • Manual: deploy to a SQL Server with stored blocking events, run analysis, confirm BLOCKING_CHAIN finding still produces the expected apex/depth/victims

🤖 Generated with Claude Code

The Dashboard fact collector and drill-down collector now read the
typed blocker-side columns added in #996 (blocking_spid,
blocking_last_tran_started, blocking_status, blocked_sql_text,
blocking_sql_text) directly from collect.blocking_BlockedProcessReport
instead of re-parsing blocked_process_report_xml on every analysis
cycle — up to 5000 XElement.Parse calls per BLOCKING_CHAIN fact
collection are eliminated.

BlockedProcessXmlParser is deleted; no callers remain. Lite is
unchanged — it has no SQL-side staging table and continues to parse
once at collect time inside RemoteCollectorService.BlockedProcessReport.

Both SELECTs add `AND blocking_spid IS NOT NULL` so rows whose source
XML carried an empty <blocking-process><process/></blocking-process>
(system tasks, torn-down sessions) are filtered out — they can't
contribute to a reconstructed chain. The old parser silently produced
BlockingSpid = 0 for those rows, which the reconstructor's self-edge
check then rejected anyway.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@erikdarlingdata erikdarlingdata merged commit 5526c99 into dev May 27, 2026
2 checks passed
@erikdarlingdata erikdarlingdata deleted the feature/dashboard-blocking-chain-typed-columns branch May 27, 2026 00:23
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