From 4ee8f167178818f8d4fa72267c18a93df99bd5cd Mon Sep 17 00:00:00 2001 From: Janez Urevc Date: Thu, 15 Sep 2022 20:20:35 +0200 Subject: [PATCH] Display times on the report in local time. --- CHANGELOG.md | 1 + src/metrics.rs | 8 ++++++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c9d80fd9..16f7fbca 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,7 @@ - [#514](https://github.com/tag1consulting/goose/pull/514) fix panic when an empty wait time interval is set - [#516](https://github.com/tag1consulting/goose/pull/516) fix unescaped inner quotes in csv logs - [#519](https://github.com/tag1consulting/goose/pull/519) implement `Default` for `GooseConfiguration` + - [#522](https://github.com/tag1consulting/goose/pull/522) display times on the report in local time (instead of UTC) ## 0.16.3 July 17, 2022 - [#498](https://github.com/tag1consulting/goose/issues/498) ignore `GooseDefault::Host` if set to an empty string diff --git a/src/metrics.rs b/src/metrics.rs index 157c1877..82c38d94 100644 --- a/src/metrics.rs +++ b/src/metrics.rs @@ -3020,8 +3020,12 @@ impl GooseAttack { let (seconds, minutes, hours) = self .metrics .get_seconds_minutes_hours(&step[0].timestamp, &step[1].timestamp); - let started = step[0].timestamp.format("%y-%m-%d %H:%M:%S"); - let stopped = step[1].timestamp.format("%y-%m-%d %H:%M:%S"); + let started = Local + .timestamp(step[0].timestamp.timestamp(), 0) + .format("%y-%m-%d %H:%M:%S"); + let stopped = Local + .timestamp(step[1].timestamp.timestamp(), 0) + .format("%y-%m-%d %H:%M:%S"); match &step[0].action { // For maintaining just show the current number of users. TestPlanStepAction::Maintaining => {