Make call-with-duration-metric more precise

This commit is contained in:
Christopher Baines 2020-12-10 09:23:12 +00:00
parent 68820efcbd
commit f661edf72d

View file

@ -379,12 +379,13 @@ The metric with the name @var{metric-name} is fetched from the
#:docstring docstring #:docstring docstring
#:labels labels #:labels labels
#:label-preset-values label-preset-values))) #:label-preset-values label-preset-values)))
(start-time (current-time))) (start-time (get-internal-real-time)))
(call-with-values (call-with-values
thunk thunk
(lambda results (lambda results
(metric-observe metric (metric-observe metric
(- (current-time) start-time) (/ (- (get-internal-real-time) start-time)
internal-time-units-per-second)
#:label-values label-values) #:label-values label-values)
(apply values results))))) (apply values results)))))