Fix call-with-duration-metric to work with multiple values
This commit is contained in:
parent
12d3d9de67
commit
fba2005362
1 changed files with 6 additions and 3 deletions
|
|
@ -355,9 +355,12 @@ The metric with the name @var{metric-name} is fetched from the
|
|||
registry
|
||||
metric-name)))
|
||||
(start-time (current-time)))
|
||||
(let ((result (thunk)))
|
||||
(metric-observe metric (- (current-time) start-time))
|
||||
result)))
|
||||
(call-with-values
|
||||
thunk
|
||||
(lambda results
|
||||
(metric-observe metric (- (current-time) start-time))
|
||||
|
||||
(apply values results)))))
|
||||
|
||||
(define (write-metrics registry port)
|
||||
"Write all metrics from the given @var{registry} to @var{port} in
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue