Allow passing label-values to call-with-duration-metric

This commit is contained in:
Christopher Baines 2020-12-10 09:21:43 +00:00
parent 875d9994b0
commit 68820efcbd

View file

@ -361,6 +361,7 @@ values are the values."
(buckets %default-histogram-buckets) (buckets %default-histogram-buckets)
docstring docstring
(labels '()) (labels '())
(label-values '())
(label-preset-values '())) (label-preset-values '()))
"Call @var{thunk} while recording the duration in seconds between "Call @var{thunk} while recording the duration in seconds between
calling @var{thunk} and the procedure ending using a metric by the calling @var{thunk} and the procedure ending using a metric by the
@ -382,7 +383,9 @@ The metric with the name @var{metric-name} is fetched from the
(call-with-values (call-with-values
thunk thunk
(lambda results (lambda results
(metric-observe metric (- (current-time) start-time)) (metric-observe metric
(- (current-time) start-time)
#:label-values label-values)
(apply values results))))) (apply values results)))))