aboutsummaryrefslogtreecommitdiffhomepage
path: root/metrics
diff options
context:
space:
mode:
authorsatotake <[email protected]>2022-04-27 02:57:04 +0900
committerBjørn Erik Pedersen <[email protected]>2022-05-08 16:56:26 +0200
commite77ca3c105bd64c5077d823d2127f6f812a4f681 (patch)
treeebbe9c310bfab1e34f9fd2e36b738fd2a37d6f11 /metrics
parentf2946da9e806c2bafbdd26707fe339db79bd980b (diff)
downloadhugo-e77ca3c105bd64c5077d823d2127f6f812a4f681.tar.gz
hugo-e77ca3c105bd64c5077d823d2127f6f812a4f681.zip
Add `clock` cli flag
Close #8787
Diffstat (limited to 'metrics')
-rw-r--r--metrics/metrics.go3
1 files changed, 2 insertions, 1 deletions
diff --git a/metrics/metrics.go b/metrics/metrics.go
index 9c46fdf7e..471f48a04 100644
--- a/metrics/metrics.go
+++ b/metrics/metrics.go
@@ -25,6 +25,7 @@ import (
"sync"
"time"
+ "github.com/gohugoio/hugo/common/htime"
"github.com/gohugoio/hugo/common/types"
"github.com/gohugoio/hugo/compare"
"github.com/gohugoio/hugo/helpers"
@@ -129,7 +130,7 @@ func (s *Store) TrackValue(key string, value any, cached bool) {
// MeasureSince adds a measurement for key to the metric store.
func (s *Store) MeasureSince(key string, start time.Time) {
s.mu.Lock()
- s.metrics[key] = append(s.metrics[key], time.Since(start))
+ s.metrics[key] = append(s.metrics[key], htime.Since(start))
s.mu.Unlock()
}