Fix call-with-duration-metric to work with multiple values

This commit is contained in:
Christopher Baines 2020-12-05 17:49:07 +00:00
parent 12d3d9de67
commit fba2005362

View file

@ -355,9 +355,12 @@ The metric with the name @var{metric-name} is fetched from the
registry registry
metric-name))) metric-name)))
(start-time (current-time))) (start-time (current-time)))
(let ((result (thunk))) (call-with-values
thunk
(lambda results
(metric-observe metric (- (current-time) start-time)) (metric-observe metric (- (current-time) start-time))
result)))
(apply values results)))))
(define (write-metrics registry port) (define (write-metrics registry port)
"Write all metrics from the given @var{registry} to @var{port} in "Write all metrics from the given @var{registry} to @var{port} in