Repository navigation
Lite group B: the Blocked Process Reports and Deadlocks grids say where their data starts (#4966) - #4990
Merged
Conversation
…starts when a range reaches before it (#4966)
# Conflicts: # Lite.Tests/QueryWindowTruncationTests.cs
…st event, judge their caps, and the Blocked Process Reports notice covers both collectors (#4966)
…e chart draws (#4966) The heatmap draws one column per 5-minute bucket, from the bucket that holds the first stored row. When the first row sat inside that bucket (10:07 inside the 10:05 column), the "Showing since" notice named the row's time, up to one column after the column on screen. The notice now names the earlier of the coverage start and the first column drawn, through the same rule the event grids use, and the Darling viewer's heatmap already follows it. The 90-minute slack and the skipped probe for a short range are unchanged. The columns now judge a first row on the start of its column, the time the notice names, so the chart and the notice agree for a first row just past the slack: it neither trims the chart nor shows a notice, instead of trimming it with none. Also repoints the slicer-handler pin at the Blocked Process Reports read the handler now makes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Part of #4966.
Why
When a time range starts before a server's data coverage, Lite's Blocking tab drew the shorter Blocked Process Reports and Deadlocks grids with no notice, and a reader could take the missing span for a quiet period. Coverage starts at the later of the collector's first run and the retention edge. This covers the Lite surfaces of one slice of #4966 (the Running Jobs, Daily Summary, Latches and Spinlocks, CPU Scheduler, Plan Cache, Session Stats, Blocking and Configuration tabs). Each surface was checked against its read first.
What changes
Two surfaces get the notice. Each gets one
QueryWindowRelationmember, its view, its coverage collector, a banner next to the grid, and the probe call at every read path of the grid: the sub-tab switch, the full refresh, the slicer handler and the chart drill-down.BlockedProcessReportsrelation, viewv_blocked_process_reports, coverage from theblocked_process_reportcollector's runs. BannerBlockedProcessReportsWindowTruncatedBanner. Read paths: sub-tab switch, full refresh,OnBlockingSlicerChanged,OnBlockingDrillDown.Deadlocksrelation, viewv_deadlocks, coverage from thedeadlockscollector's runs. BannerDeadlocksWindowTruncatedBanner. Read paths: sub-tab switch, full refresh,OnDeadlockSlicerChanged,OnDeadlockDrillDown.GetRunningJobsAsynctakes no window).GroupedTrendChartRenderer), and the two grids read the newest snapshot inside the range.CpuSchedulerChartRenderer); the metric grid is the newest snapshot.SetLimitsX); the summary strip and grid read the newest snapshot in the range.SessionStatsChartRenderer); the summary strip reads the latest point.SetLimitsXon the asked range.StatsChartRangeplusSetLimitsX); the summary strip aggregates the same range beside charts that show the empty span.GetLatest*keyed onMAX(capture_time)orMAX(collection_time)) and takes no window.Choices to check:
event_time,deadlock_time) while the probe windows oncollection_time. The notice keys on coverage (collector runs and retention), not on row times, and the existing 90-minute slack inIsWindowTruncatedabsorbs the collection lag.StackPanelwith the existing separately-monitored note.QueryWindowTruncationTests.WindowTruncatedBannerCallSites_TakeUtcBounds_NotServerLocalOnespins exact call counts. It moves from 4 to 6 slicer calls, from 10 to 14 refresh calls, and from 10 to 13GetQueriesTabWindowUtcdeclarations. Any other change that adds banner calls moves the same three numbers, so a merge of such changes needs their sum.event_time,deadlock_time; both are the XE timestamp, UTC, so neither is a server-clock relation), but the notice's probe measuredcollection_time, so a first collection that stored older history made the note name a time later than rows the grid shows.QueryWindowRelationTimeColumnnow maps the two relations to those columns, as it does for System Events and Default Trace. The probe file is listed for both views in the stored-event-copies sweep (a MIN cannot change with duplicate copies).RefreshCappedGridBannerAsyncwith each row's event time, and one constant per grid (BlockedProcessReportGridCap,DeadlockGridCap) is both the read's limit and the notice's cap. A full page names its oldest row with no slack, even on a one-hour range; a page under the cap keeps the coverage rule. No literal LIMIT changed (the limit was already a parameter), so the MCP payload census roster is unchanged.DmvBlockingSnapshotsrelation (its event time is its collection time) is probed beside the XE one, and the shared probe answers the earlier of the two coverages for this grid: with XE collection off, a range the DMV collector covers shows no notice, and one that starts before it names the DMV collector's coverage. A full read can merge to fewer rows than its cap (the DMV read fetches the cap plus the XE rows in hand, and the merge keeps one DMV row per blocked/blocking pair per minute), soReadRecentBlockedProcessReportsAsyncalso returns the oldest event time of the read that filled its own page (the later of the two when both did), and the notice names it even when the merged list is under the cap.GetQueriesTabWindowUtcpair inServerTab.Refresh.csstay at 14 probe-or-cap-aware calls once the Collection Log's cap-aware call is counted: the pattern now counts both steps, 14 -> 15 (four of the 14 moved from the probe-only step to the cap-aware one; the Collection Log's call is the one more). Slicer banner calls 6 -> 6 (4 probe-only, 2 cap-aware).GetQueriesTabWindowUtc(occurrences inServerTab.Refresh.cs: 13 on this branch and 11 on dev before the merge, 14 after it.EarlierOfFloorAndRowShown, the rule the event grids use and the Darling viewer's heatmap already follows.RefreshQueryHeatmapBannerAsynctakes the drawn result at all three read paths (sub-tab switch, full refresh, metric picker) and hands the shared step its first column (FirstColumnDrawn). The 90-minute slack and the skipped probe for a range of 90 minutes or less are unchanged.SecondOccurrenceReadTeststhat still named the earlier Blocked Process Reports read in the slicer handler now namesReadRecentBlockedProcessReportsAsync, the read the handler makes.Test plan
DataStartBannerBlockingEventsTests: 14 tests pass. For each of the two relations: rows starting inside the range read the notice back; the notice names the first collection, not the first row; a quiet start (collector ran over the whole range, first event 5 hours in) shows no notice; a quiet start with an older row shows no notice; a range with no event and no run shows no notice. Plus the relation maps, the two XAML banners, and a wiring pin per relation over every read path (sub-tab switch, full refresh, slicer, drill-down), checked to run after the rows are bound.OnBlockingSlicerChanged must refresh the BlockedProcessReports banner exactly once over e.StartUtc, e.EndUtc; found 0) while the 12 probe tests passed. After the calls were added all 14 pass.DataStartBannerTests,DataStartBannerProbeFailureTests,QueryWindowTruncationTests,ComparisonWindowUtcTests,DisplayZoneTextFrameTests,RepoFileAdoptionTestsandSeparatelyMonitoredListNoteTeststogether with the new class: 71 passed, 0 failed, after mergingorigin/dev.ServerTab.Refresh.cs,ServerTab.Slicers.cs,ServerTab.DrillDown.cs,ServerTab.xaml, the floor file): 344 passed, 0 failed.Lite.Testsbuilds with 0 warnings and 0 errors.get_blocked_process_reports,get_deadlocksand the rest) are not covered here.QueryWindowTruncationTests.cs(theGetQueriesTabWindowUtc(count), resolved to 14, the sum of both sides' calls.DataStartBannerSurfaceTestsfail (the first-run-history theory and the reaches-back theory for both relations, the DMV-coverage test, the DMV-read-fills-its-cap test, and the map rows for both relations). Green restored.DataStartBanner*,QueryWindowTruncationTests,StoredEventCopies*,DisplayZoneTextFrameTests,BlockedProcess*,Deadlock*,McpPayloadContractCensusTests,McpPageContractTests): 548 pass, 0 fail; 0 warnings.DataStartBannerBlockingEventsTests,DataStartBannerSurfaceTests,QueryWindowTruncationTests,DataStartBannerQueriesTabTests,DataStartBannerProbeFailureTests,DataStartBannerTests,StoredEventCopiesSweepTestsandDisplayZoneTextFrameTestsfail: both rows ofDataStartBannerBlockingEventsTests.EveryReadPath_RefreshesTheBanner_OverTheWindowItRead_AfterTheRowsAreBound(BlockedProcessReports and Deadlocks). The other classes pass on either shape. The calls were restored and all pass.McpPayloadContractCensusTests,RepoFileAdoptionTests,DocCommentHygieneTests,CommentFilterAdoptionTests,TsqlConventionGuardTests,ScopedLoadOrderingTests, the Viewer drill-down, memory and blocking-depth classes and the rest): 321 tests, 0 failed, 21 skipped (the live classes that need a store). Darling.Tests builds with 0 warnings.DataStartBannerQueriesTabTests: a first stored row inside the first column names that column's start (10:07 names 10:05, 10:05:00 names 10:05, 10:09:59 names 10:05, 10:04:59 names 10:00; the probe is called once); a range the coverage covers shows no notice even when its start sits inside a column; a range of 60 or 90 minutes shows no notice and makes no probe call; a first row 37 minutes into a six-hour range keeps the slack and shows no notice; a first row 91 minutes in, whose column starts at the slack, neither trims the chart nor shows a notice;FirstColumnDrawnanswers the first drawn column, and null for a chart that drew none. The existing trim test now expects the notice to name 10:15:00 for a first row at 10:17:40.DataStartBannerQueriesTabTestsfail. Three coverage rows name the row's time ("Showing since 2026-06-01 10:07:00" where 10:05:00 is expected, and the same for 10:09:59 and 10:04:59); the signature pin and the three-read-path pin fail; theFirstColumnDrawntest fails; the 91-minute test fails; the trim test names 10:17:40 where 10:15:00 is expected. After the change all 70 pass. The 91-minute test also failed with the wiring in place and the trim unchanged, and passed once the trim judged the column's start.SecondOccurrenceReadTests.EverySlicerHandler_PassesTheEventsUtcBoundsToItsReadfor the Blocked Process Reports slicer, whose pin still named the earlier read; repointed, and that class withDataStartBannerQueriesTabTests,QueryHeatmapBudgetTests,QueryHeatmapToolTestsandStoredEventCopiesSweepTestsre-run: 88 passed, 0 failed. Lite.Tests builds with 0 warnings.origin/devagain (to the MCP data-start change): no conflicts.CHANGELOG
No entry in this PR; the release owner adds it under [Unreleased].
Proposed entry: