Skip to content

DESKTOP: the Blocking Trends and Blocking Stats charts say where their data starts (part of #4966) - #5030

Merged
erikdarlingdata merged 6 commits into
devfrom
feature/4966-desktop-blocking-charts
Oct 3, 2026
Merged

erikdarlingdata merged 6 commits into
devfrom
feature/4966-desktop-blocking-charts

Conversation

@erikdarlingdata

@erikdarlingdata erikdarlingdata commented Oct 3, 2026 •

Copy link
Copy Markdown
Owner

Part of #4966.

Why

The Blocking > Trends and Blocking Stats charts draw zero baselines, PadEnds zero ends or a flat 0 when a read is empty, so a span before the data starts reads as "nothing happened".

What changes

  • One "Showing since" banner (#22FFAA00, Auto row) per floor. Trends: one over each of the three charts. Stats: one over the blocking pair, one over the deadlock pair. The summary strip gets no separate note.
  • Floors: Blocking Trend and the Stats blocking pair use GetBlockedProcessReportsDataStartAsync. Deadlock Trend and the Stats deadlock pair use GetDeadlocksDataStartAsync. Lock Wait Trend uses a new GetLockWaitTrendDataStartAsync over ForCollectorTable("wait_stats") (the name resolves; the live test proves it).
  • Lock Wait Trend draws a flat 0 when its read is empty (RenderLockWaitTrendChart), so it gets a note. Its points are rate buckets clamped to the window start, not events, so its note names the coverage start alone (UpdateTruncationBanner over DataStartOrNullAsync, the Current Waits form).
  • Event-time rule for the count and severity charts: ShowEventDataStartAsync names the earlier of the coverage start and the first drawn point. Count charts use non-zero buckets only (BlockingTrendTimesDrawn).
  • Probes start beside the reads and sit outside the join. Each case awaits its joined reads through AwaitReadWatchingProbeAsync (nested: three probes on Trends, two on Stats), so a read that throws still watches its probes and a late probe failure is a warning, not an unobserved-exception error. A throwing probe costs only its note. Fan-out is Of(6) on Trends and Of(5) on Stats, released right after the watched join so the banner awaits are outside the scope.

Limits

  • Stats treats points with EventCount > 0 (blocking) and every severity point (deadlock) as "drawn".
  • The Lock Wait floor reads wait_stats (what Lock Wait Trend draws from, v_wait_stats). Current Waits uses waiting_tasks because its charts read that table, so the two floors differ on purpose. Both go through DataWindowFloor.GetForServerAsync with ForCollectorTable and CurrentInteractiveReadSeconds.

Test plan

  • The pure helpers moved out of the WPF tab into ViewerBlockingChartsDataStart (internal static, no WPF). ViewerBlockingChartsDataStartTests now has 4 facts that need no STA thread (non-zero buckets only, earlier of coverage and first bucket, empty read, throwing probe via ViewerEventDataStart.Of(..., probeFailed: true)).
  • ViewerBlockingChartsDataStartTests: Total 4, Failed 0. ViewerBlockingChartsDataStartPinTests: Total 3, Failed 0. ViewerBlockingChartsDataStartLiveTests (scratch store): Total 1, Failed 0.
  • RED (temporary mutations, reverted): awaiting the Stats reads bare fails the Stats pin and ViewerProbeWatchCensusTests; feeding Lock Wait from its drawn points fails the Trends pin; BlockingTrendTimesDrawn keeping zero buckets fails the unit facts.
  • ViewerEventDataStartTests.EveryTabRead_OfTheTwoGrids_HasItsProbe updated to the new contract: 4 calls each to GetBlockedProcessReportsDataStartAsync and GetDeadlocksDataStartAsync (two grid loads plus the Trends and Stats probes), still exact counts. It is a source-text fact. The class shows Total 29, Failed 12 locally, all 12 on the dev-local list (STA); the fact itself is not among them.
  • Other classes, all Failed 0 where they run: ViewerCommandTimeoutTests 57, ConsumedTimestampFrameDisciplineTests 17, TsqlConventionGuardTests 14, DocCommentHygieneTests 77, RepoFileAdoptionTests 2, CommandDeadlineScannerAdoptionTests 1, FleetIdentifierScrubTests 3, CommentFilterAdoptionTests 4, McpPayloadContractCensusTests 68, StorageCommandTimeoutTests 24, StartupCommandTimeoutTests 15, McpReadCommandTimeoutTests 43, DarlingBlockingTrendEmptyTests 4, DarlingLockWaitTrendTests 2, DarlingBlockingStatsReadTests 1, DatabaseFilterTests 29, EventTimeWindow*/EventWindowedReads* 36, TrendPayloadBudgetLiveTests 1, McpFilterSemanticsLivePostgresTests 4. The remaining classes in the grep (ViewerDataStartBannerTests, ViewerShortWindowDataStartTests, ViewerEventDataStartLiveTests, ViewerBlockedProcessReportsCoverageLiveTests) fail locally on the dev-local list (STA/WPF).
  • Full suite at the code before the last dev merge: failures compared against the known local-only list; the remaining names are classes new on dev (not touched here). CI runs the full suite at the head. ViewerProbeWatchCensusTests (3) and ViewerCommandTimeoutTests (58) pass at the head.
  • --no-incremental build: 0 errors, 0 warnings.
  • CI-only: none of the new facts need STA now. The four STA facts of the earlier version were replaced by the pure ones. Nothing new is left to CI beyond the already-STA classes above.

CHANGELOG

SECTION: Fixed
ENTRY: - The desktop viewer's Blocking Trends and Blocking Stats charts say where their data starts ([#5030]) - the Lock Wait, Blocking and Deadlock trend charts and the Blocking Stats charts now show "Showing since " when the range reaches before their data does, so an empty stretch no longer reads as no blocking. Each chart names its own source's start.
REF: [#5030]: #5030

@erikdarlingdata
erikdarlingdata marked this pull request as ready for review October 3, 2026 19:49
@erikdarlingdata
erikdarlingdata merged commit 2d95542 into dev Oct 3, 2026
20 of 22 checks passed
@erikdarlingdata
erikdarlingdata deleted the feature/4966-desktop-blocking-charts branch October 3, 2026 19:54
erikdarlingdata added a commit that referenced this pull request Oct 4, 2026
…say where their data starts (part of #4966) (#5096)

Lite's Blocking tab charts now show "Showing since <time>" when the chosen window starts before the store's data for that chart. Before, they drew zeros across the gap, as if nothing had happened. The five charts are the Lock Wait, Blocking and Deadlock trends on the Trends sub-tab, and the blocking and deadlock pairs on Blocking Stats. The wording and placement match the desktop viewer's #5030.

Each note probes its own source: Lock Wait Trend probes the wait_stats collector (a new WaitStats window relation); the Blocking trend and the blocking pair probe the blocked process reports, which also count the DMV blocking snapshots; the Deadlock trend and the deadlock pair probe deadlocks. The notes run after the charts draw, over the same UTC window the reads took, through the shared banner step, so the 90-minute rule, the chart's time zone and the failed-probe rule match every other Lite note. The event charts name the earlier of the coverage start and the first event drawn (a zero bucket is not an event); the Lock Wait Trend, a rate series, names its coverage alone.

Tests: 19 in BlockingChartsDataStartTests. Each chart has a notice test and a quiet-start test, and the zero-bucket and earliest-point helpers are covered. A pin checks that each note step calls its banner with its relation; it fails 5 of 5 with the notes turned off. Full Lite.Tests on Windows: 8,025 passed, 0 failed.

Part of #4966
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