Repository navigation
LITE: the Collection Log drill window says where its data starts (#4966) - #5031
Merged
Merged
Conversation
The per-collector run-history window listed a week of one collector's runs and said nothing when the server's collection log started after that week began. It now shows the same "Showing since" note as the Collection Log grid, worded from the SERVER's log through the shared probe guard and banner rule, in the zone the window's rows print their times in. The week is worked out once and handed to both the read and the probe: GetCollectionLogByCollectorAsync takes (startUtc, endUtc) instead of hoursBack and is bounded on both ends like the probe. A probe that throws shows no note and the rows still load.
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.
The Collection Log grid on a server's tab already says where its data starts when the range reaches before it. The per-collector run-history window (opened from a Collection Health row) read a week of one collector's runs and said nothing. It now says it, the way the Darling viewer's drill window already does (#5010).
What changes
GetQueryWindowFloorAsyncwithQueryWindowRelation.CollectionLog), never from the collector's own first run. A collector that started late in a week the server's log covers says nothing. The read has no row cap, so the capped grids' oldest-row rule does not apply, and the window uses the shared guard (ServerTab.ProbeWindowFloorOrNullAsync) and banner rule (ServerTab.ApplyWindowFloorToBanner) as they are, with no copy.CollectionLogWindow.ReadDrillAsynctakes one end (now, or a pinned instant for tests), puts the start 168 hours before it, and hands that same pair to the read and to the probe.GetCollectionLogByCollectorAsyncnow takes(startUtc, endUtc)instead ofhoursBack, so the read can no longer read a clock of its own. It is bounded on both ends, both inclusive, as the probe is, which means a run stamped after the moment the window opened is no longer listed.CollectionHealthTime.Format. That choice (the display mode's zone for the window's server clock, else the active tab's) now lives in oneCollectionHealthTime.Zone, whichFormatand the note both call: Server time uses the window's server clock, Local time this machine's zone, UTC is UTC.ReadDrillAsync, no controls touched) and a note step (ShowDrillDataStart, run on the UI thread after the rows are bound), so a test can drive the read and the note without opening the window. The read itself still starts on the UI thread's context, as it did before this PR.Files:
Lite/Windows/CollectionLogWindow.xamland.xaml.cs,Lite/Services/LocalDataService.CollectionHealth.cs, and the newLite.Tests/CollectionLogDrillDataStartTests.cs.Test plan
New class
CollectionLogDrillDataStartTests(10 tests: a real DuckDB store for the coverage cases, passed-in steps for the probe that throws and the recorded window). Nothing in it depends on today's date: the window's end is pinned.RED first. The window as shipped has no seam to call, so the new tests do not compile against it. To see each one fail by assertion I put the old behavior behind the new members and ran the class twice:
TheReadAndTheProbe_AreGivenTheSameWindow: expected the window (2026-09-13 12:00Z, 2026-09-20 12:00Z), actual (2026-09-26 16:38Z, 2026-10-03 16:38Z), the read's own clock.ACollectorThatStartedLateInACoveredWeek_ShowsNoNoteRED: expected floor 2026-09-13T12:00Z (the server's log covers the week), actual null. A no-note case can only go red through what it asks of the probe: nothing asks.AServerWhoseFirstCollectionFallsInsideTheWeek_NamesItRED: expected floor 2026-09-15T09:30Z, actual null.TheReadAndTheProbe_AreGivenTheSameWindowRED:Assert.Singleon the probe's recorded windows, which is empty.AProbeThatThrows_ShowsNoNote_AndTheRowsStillLoadRED: expected 1 probe call, actual 0.TheNote_IsWordedInTheZoneTheGridPrintsItsTimesInRED: expected floor 2026-09-15T13:30Z, actual null.TheRows_AreTheCollectorsRunsInsideTheWindow_BothEndsInclusiveRED: expected floor 2026-09-13T12:00Z, actual null (under stub A the same test failed on its row count: expected 15, actual 0).AFirstCollectionJustInsideTheSlack_ShowsNoNoteRED: expected floor 2026-09-13T12:45Z, actual null.TheWindow_LoadsAndWordsItsNoteThroughTheSharedSteps(source scan of the window's wiring and its banner) RED: expected oneShowDrillDataStart(CollectionLogDrillTruncatedBanner ...call, found 0.TheReadTakesTheWindow_NotAnHoursBack(a reflection pin that the read has one overload, takingstartUtcandendUtc; the stub already carried the data-service change, and against the shipped file it fails by construction because that overload takeshoursBack, which I did not run), andAWeekWithNoRunAtAll_ShowsNoNote_AndNoRows(a guard that a week with nothing in it shows no note; no window that never shows a note can fail it).GREEN with the real change:
CollectionLogDrillDataStartTests: Total 10, Failed 0.DataStartBanner*,QueryWindowTruncationTests,DisplayZoneTextFrameTests,DisplayZone*,ServerTimeHelper*,CollectionLog*,CollectionHealth*,GridTimeColumnSortMemberTests, and every class that namesCollectionLogWindow,GetCollectionLogByCollectorAsyncorCollectionHealthTime(CollectionOutputBesideCostTests,CollectorHealthClassifierTests,DuckDbSentinelConnectionTests,EmptyEnumerationNoteTests,EngineGapNoteTests,LastErrorCurrencyTests,RegressedFromProductiveTests,SwallowedItemFailureTests): Total 551, Failed 0.RepoFileAdoptionTests,DocCommentHygieneTests,CommentFilterAdoptionTests(Darling.Tests): Total 83, Failed 0.Lite.TestsandDarling.Testsbuild with 0 Warning(s), 0 Error(s).Notes
CollectionHealthTime.Zone(_serverClock): the window's server clock in Server time, else the active tab's clock, this machine's zone in Local time, UTC in UTC. That is exactly the zone the window's rows print theirs in, and the one the server tab's picker uses for the Collection Log grid's own note, since the window is opened from that tab with that tab's clock.GetCollectionLogByCollectorAsync(serverId, collectorName, hoursBack = 168)is gone. The window was its only caller (searched the whole repository), and an overload that reads its own clock is the way the read and the probe came apart. The reflection pin keeps it that way.CHANGELOG
No entry in this PR. The release owner adds it under [Unreleased].
Proposed entry: