diff options
author | Bjørn Erik Pedersen <[email protected]> | 2022-05-09 10:05:19 +0200 |
---|---|---|
committer | Bjørn Erik Pedersen <[email protected]> | 2022-05-09 14:18:40 +0200 |
commit | 51f08b0b6aae175299b4e73d521343a4386a9cf7 (patch) | |
tree | 6966bc277671a1f62e9363a2a16fa7a2d6ccacd1 /metrics/metrics.go | |
parent | 860c51c314e1f2b06b1424a3b277a2db96fc1f04 (diff) | |
download | hugo-51f08b0b6aae175299b4e73d521343a4386a9cf7.tar.gz hugo-51f08b0b6aae175299b4e73d521343a4386a9cf7.zip |
Revise the use of htime.Since/htime.Now
We cannot (also, it doesn't add any value) use that when the `clock` is set,
* To measure time (before that global is set)
* To compare file timestamps re cache eviction
Fixes #9868
Diffstat (limited to 'metrics/metrics.go')
-rw-r--r-- | metrics/metrics.go | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/metrics/metrics.go b/metrics/metrics.go index 471f48a04..9c46fdf7e 100644 --- a/metrics/metrics.go +++ b/metrics/metrics.go @@ -25,7 +25,6 @@ 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" @@ -130,7 +129,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], htime.Since(start)) + s.metrics[key] = append(s.metrics[key], time.Since(start)) s.mu.Unlock() } |