Skip to content

Lite: Queries-tab comparisons read a window shifted by the server's UTC offset #4284

Description

@erikdarlingdata

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions