Debian Codegraph @

memmetrics/options.go

raw
1 package memmetrics
2
3 // RTOption represents an option you can pass to NewRTMetrics.
4 type RTOption func(r *RTMetrics) error
5
6 // RTCounter set a builder function for Counter.
7 func RTCounter(fn NewCounterFn) RTOption {
8 return func(r *RTMetrics) error {
9 r.newCounter = fn
10 return nil
11 }
12 }
13
14 // RTHistogram set a builder function for RollingHDRHistogram.
15 func RTHistogram(fn NewRollingHistogramFn) RTOption {
16 return func(r *RTMetrics) error {
17 r.newHist = fn
18 return nil
19 }
20 }
21
22 // RatioOption represents an option you can pass to NewRatioCounter.
23 type RatioOption func(r *RatioCounter) error