Found while fixing the same bug in #4279's new "Showing since" banner.
Lite stores collection_time in UTC. The Queries tab's comparison reads compare their start and end times straight against it, with no offset conversion. They are GetQueryStatsComparisonAsync and its procedure-stats and Query Store twins in Lite/Services/LocalDataService.*.cs. But two callers pass them server-local times:
- A slicer drag. Each
On...SlicerChanged handler in Lite/Controls/ServerTab.Slicers.cs converts e.StartUtc and e.EndUtc to server time (fromServer, toServer). It passes those to Refresh...ComparisonAsync. The grid read beside it converts them back to UTC through GetTimeRange. The comparison does not.
- A custom range.
Lite/Controls/ServerTab.Refresh.cs builds cStart and cEnd from the date pickers in server time and passes them to the same three comparison calls. GetComparisonRange() (Lite/Controls/ServerTab.Comparison.cs:59) builds the baseline the same way (lines 66-77).
So on any server not on UTC, the comparison reads a window shifted by the server's UTC offset. After a slicer drag, the current window is shifted but the baseline, from a preset range, is not. With the default "Last N hours" range and no slicer drag, both windows are UTC and correct.
Fix: give the comparison calls the UTC window the grid read. #4279 added LocalDataService.GetQueriesTabWindowUtc for the banner, and the slicer's own e.StartUtc and e.EndUtc are already UTC. Move GetComparisonRange() onto UTC at the same time, so the current and baseline windows stay on one basis. Check the comparison banner's displayed times after the change. ServerTimeHelper.FormatServerTime expects UTC.
The Darling viewer's Queries tab passes UTC windows to its comparisons.
Found while fixing the same bug in #4279's new "Showing since" banner.
Lite stores
collection_timein UTC. The Queries tab's comparison reads compare their start and end times straight against it, with no offset conversion. They areGetQueryStatsComparisonAsyncand its procedure-stats and Query Store twins inLite/Services/LocalDataService.*.cs. But two callers pass them server-local times:On...SlicerChangedhandler inLite/Controls/ServerTab.Slicers.csconvertse.StartUtcande.EndUtcto server time (fromServer,toServer). It passes those toRefresh...ComparisonAsync. The grid read beside it converts them back to UTC throughGetTimeRange. The comparison does not.Lite/Controls/ServerTab.Refresh.csbuildscStartandcEndfrom the date pickers in server time and passes them to the same three comparison calls.GetComparisonRange()(Lite/Controls/ServerTab.Comparison.cs:59) builds the baseline the same way (lines 66-77).So on any server not on UTC, the comparison reads a window shifted by the server's UTC offset. After a slicer drag, the current window is shifted but the baseline, from a preset range, is not. With the default "Last N hours" range and no slicer drag, both windows are UTC and correct.
Fix: give the comparison calls the UTC window the grid read. #4279 added
LocalDataService.GetQueriesTabWindowUtcfor the banner, and the slicer's owne.StartUtcande.EndUtcare already UTC. MoveGetComparisonRange()onto UTC at the same time, so the current and baseline windows stay on one basis. Check the comparison banner's displayed times after the change.ServerTimeHelper.FormatServerTimeexpects UTC.The Darling viewer's Queries tab passes UTC windows to its comparisons.