Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(l10n): use UTC time on server and localize time on client
Locust uses server time to store the time of a task in stats history. When fetching the initial stats history for the client (such on on page refresh) it is written by the server using using this stored time. While rendering a chart on the client, locust uses the localized client time for the time the stats history was fetched. This would lead to a jump in the x-axis time series when server and client time zones differed. Stats history (stats.py) now derives time from the time component of the current datetime in UTC instead of server time zone. This aligns it with other time stores used throughout locust - particularly the start_time and end_time of reports - that make use of time.time(), which is in UTC. The client UI report (report.html) now localizes the server-rendered times from history (formerly in server TZ, now in UTC). This aligns it with the client-side report timekeeping of locust.js updateStats() used for the x-axis of charts. Issue: #1835
- Loading branch information