Skip to content

DESKTOP: CPU Scheduler, Latch, Spinlock and Running Jobs grids show when their snapshot was collected; latch and spinlock trends say where their data starts (part of #4966) - #5029

Merged
erikdarlingdata merged 8 commits into
devfrom
feature/4966-desktop-snapshot-times
Oct 3, 2026
Merged

erikdarlingdata merged 8 commits into
devfrom
feature/4966-desktop-snapshot-times

Conversation

@erikdarlingdata

@erikdarlingdata erikdarlingdata commented Oct 3, 2026 •

Copy link
Copy Markdown
Owner

Part of #4966.

Why

A newest-snapshot grid shows one collection, so it should name that collection. The viewer's other grids already do this with a last Collected column (bare time in the display zone, to the second, sorted on the stored DateTime), and the Lite twin uses the same form. The Latch and Spinlock trend charts draw a flat zero over an empty stretch, so they also need a data-start note.

What changes

  • CPU Scheduler, Latch, Spinlock and Running Jobs grids each end in a Collected column bound to CollectionTimeLocal (display zone, to the second, in the viewer's current-culture display format) with SortMemberPath="CollectionTime".
  • CPU Scheduler rows are now CpuSchedulerGridRow: the shared metric row plus the snapshot's CollectionTime on every row. It lives in the viewer, so the shared PerformanceMonitor.Common type that Lite also uses is unchanged.
  • Latch and Spinlock snapshot SQL and records carry collection_time (a new last column and record field). RunningJobRow gains CollectionTimeLocal over its existing CollectionTime.
  • Latch and Spinlock trends get a "Showing since" banner from ForCollectorTable("latch_stats") / ("spinlock_stats"). The load holds ViewerReadFanOut.Of(4) for the join, releases it, and runs the two probes under their own Of(2), outside the join, so a probe that throws costs only the note.

Limits

  • The strips and the Configuration grids are in other PRs.
  • No test builds the grids on a real STA thread; the column pins read the xaml and the row types.

Test plan

  • RED (temporary mutation, reverted): binding the Spinlock Collected column to CollectionTime instead of CollectionTimeLocal failed ViewerSnapshotCollectedColumnTests 1 of 7 and ViewerGridTimeColumnSortMemberTests 3 of 95. GREEN after revert.
  • New pins: each of the four grids' last column is Collected, bound to CollectionTimeLocal, sorted on CollectionTime; the CPU Scheduler load calls CpuSchedulerGridRow.Build; TheDisplayText_IsTheDisplayZonesWallTime_ToTheSecond pins the literal 2026-10-03 14:05:09 for a known UTC instant in UTC display mode, run under the invariant culture, for all four row types (it makes no claim about other cultures); every CPU Scheduler row carries the snapshot's time; the old label is gone from the xaml. ViewerGridTimeColumnSortMemberTests has four new rows. ViewerSnapshotTimeLiveTests is kept for the SQL time.
  • Full Darling.Tests suite (once, final code): Total 21259, Failed 481, Skipped 244. 310 unique failing names; comm -23 against dev-local-failing-tests.txt is empty.
  • --no-incremental build: 0 errors, 0 warnings.
  • scrubcheck --diff exit 0; the public-text grep prints nothing.
  • CI-only (STA/WPF): none of the new pins needs STA.

CHANGELOG

SECTION: Fixed
ENTRY: - Snapshot grids show when they were collected ([#5029]) - The desktop viewer's CPU Scheduler, Latch, Spinlock and Running Jobs grids now end in a Collected column that shows when the snapshot was collected, and the Latch and Spinlock trend charts say where their data starts when it begins after the chosen range.
REF: [#5029]: #5029

…rids show their snapshot time, and the latch and spinlock trends say where their data starts (part of #4966)
…wn scope, and declare the snapshot label wrapper (#4966)
…d Running Jobs grids instead of a Snapshot at label (#4966)
@erikdarlingdata erikdarlingdata changed the title DESKTOP: CPU Scheduler, Latch, Spinlock and Running Jobs grids show their snapshot time; latch and spinlock trends say where their data starts (part of #4966) DESKTOP: CPU Scheduler, Latch, Spinlock and Running Jobs grids show when their snapshot was collected; latch and spinlock trends say where their data starts (part of #4966) Oct 3, 2026
@erikdarlingdata
erikdarlingdata marked this pull request as ready for review October 3, 2026 19:55
@erikdarlingdata
erikdarlingdata merged commit 67a9551 into dev Oct 3, 2026
19 of 20 checks passed
@erikdarlingdata
erikdarlingdata deleted the feature/4966-desktop-snapshot-times branch October 3, 2026 20:12
erikdarlingdata added a commit that referenced this pull request Oct 4, 2026
… (part of #4966) (#5086)

Lite's Latches & Spinlocks tab now says where the data starts on its two trend charts. Both charts draw a flat zero over an empty stretch, so a window that starts before the store's coverage looked like a quiet server. Two window relations, LatchStats and SpinlockStats, take their coverage from the latch_stats and spinlock_stats collectors' runs (the first sample of a class has no delta, so the oldest row would understate coverage). RefreshLatchSpinlockAsync then shows a "Showing since" note above each chart through the shared stored-window banner, as the Darling viewer does since #5029.

For each chart, a test shows the note when coverage starts inside the window, and a quiet-start test shows no note when the window was covered but the first point comes late.

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