Lite: add Latches & Spinlocks viewer tab (Tier-1 parity BUILD)#1504
Merged
Conversation
Port the Darling viewer's consolidated Latches & Spinlocks per-server tab to Lite. Lite already collected latch_stats (sys.dm_os_latch_stats) and spinlock_stats (sys.dm_os_spinlock_stats) but had no viewer surface. New top-level tab (between Daily Summary and Collection Health, index 13): the latch wait-time trend (ms/sec) and spinlock collisions trend (collisions/sec) for the TOP 5 contenders stack vertically, each above a collapsed Expander holding its per-class latest-snapshot grid. - LocalDataService.LatchSpinlock.cs: 4 DuckDB readers (2 trend, 2 snapshot) mirroring the Darling Postgres reads, against the v_latch_stats / v_spinlock_stats archive views. Per-second rates via the per-contender LAG interval (the Wait Stats trend idiom). - ServerTab.LatchSpinlock.cs: tab code-behind mirroring Darling's rendering with Lite's chart idioms (shared ChartStyle/ChartHoverHelper, SeriesColors, Y-floor-at-0, UtcOffsetMinutes display conversion). - Wired into the TabControl + RefreshVisibleTabAsync switch + filter managers. - Coverage pin: remove latch_stats/spinlock_stats from the allow-list (now 5); the ratchet now requires the reader. Lite build clean; Lite.Tests 1135/1135 green. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.
What
Ports the Darling viewer's consolidated Latches & Spinlocks per-server tab to Lite. Lite already collected
latch_stats(sys.dm_os_latch_stats) andspinlock_stats(sys.dm_os_spinlock_stats) but had no viewer surface — the coverage pin from #1499 currently allow-lists them as unbuilt UI. This closes that parity-board Tier-1 gap.Tab
New top-level tab, index 13 (between Daily Summary and Collection Health — mirroring Darling's diagnostics-tail placement). Consolidated layout copied from Darling:
Reader (
LocalDataService.LatchSpinlock.cs)4 DuckDB readers (2 trend, 2 snapshot) mirroring the Darling Postgres reads, run against the
v_latch_stats/v_spinlock_statsarchive views. Per-second rates are computed in SQL from the per-contenderLAGinterval — the samedate_trunc/extract(epoch)/LAGidiom the Wait Stats trend uses (the delta tables carry no storedsample_interval_seconds).Rendering (
ServerTab.LatchSpinlock.cs)Mirrors Darling's rendering using Lite's chart idioms: shared
ChartStyle/ChartHoverHelper, cyclingSeriesColors, Y-floor-at-0 (SetChartYLimitsWithLegendPadding),UtcOffsetMinutesdisplay conversion, zero-line-when-empty — matching Lite's other multi-series trend charts (e.g. Lock Wait Trend). Series ordered by total desc so the heaviest contender takes the first palette colour; long class/spinlock names clipped to 20 chars in the legend.Wiring
TabControl +
RefreshVisibleTabAsyncswitch (case 13, Collection Health shifted tocase 14) +DataGridFilterManagers for both grids (Lite's grid convention: column-filter-button headers).Coverage pin
latch_stats/spinlock_statsremoved fromCollectorViewerCoverageTests.KnownStoreOnlyOrUnbuiltTables(now 5 entries). The ratchet now requires the reader: with the two no longer allow-listed,EveryCollectorTable_HasALiteReader_OrIsAllowListedonly passes because the new reader references thev_views, andAllowList_HasNoEntryThatIsActuallyReadwould go red if the entries were left behind.Validation
dotnet build Lite/PerformanceMonitorLite.csproj -c Debug— Build succeeded, 0 errors.dotnet test Lite.Tests— 1135 passed, 0 failed, 0 skipped, including the 3 coverage-pin tests green with the shrunk allow-list.Visual sign-off (Erik) is the final gate, as with the other viewer tabs.
🤖 Generated with Claude Code