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)
docstring
(labels '())
(label-values '())
(label-preset-values '()))
"Call @var{thunk} while recording the duration in seconds between
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
thunk
(lambda results
(metric-observe metric (- (current-time) start-time))
(metric-observe metric
(- (current-time) start-time)
#:label-values label-values)
(apply values results)))))