Allow passing more options to call-with-duration-metric
This commit is contained in:
parent
6d9f8c57eb
commit
7868c83840
1 changed files with 11 additions and 2 deletions
|
|
@ -341,7 +341,12 @@ values are the values."
|
|||
0))))))
|
||||
buckets)))))
|
||||
|
||||
(define (call-with-duration-metric registry metric-name thunk)
|
||||
(define* (call-with-duration-metric registry metric-name thunk
|
||||
#:key
|
||||
(buckets %default-histogram-buckets)
|
||||
docstring
|
||||
(labels '())
|
||||
(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
|
||||
name of @var{metric-name}.
|
||||
|
|
@ -353,7 +358,11 @@ The metric with the name @var{metric-name} is fetched from the
|
|||
(or (metrics-registry-fetch-metric registry metric-name)
|
||||
(make-histogram-metric
|
||||
registry
|
||||
metric-name)))
|
||||
metric-name
|
||||
#:buckets buckets
|
||||
#:docstring docstring
|
||||
#:labels labels
|
||||
#:label-preset-values label-preset-values)))
|
||||
(start-time (current-time)))
|
||||
(call-with-values
|
||||
thunk
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue