github.com/Jeffail/benthos/v3@v3.65.0/lib/metrics/vector_util.go (about) 1 package metrics 2 3 //------------------------------------------------------------------------------ 4 5 type fCounterVec struct { 6 f func([]string) StatCounter 7 } 8 9 func (f *fCounterVec) With(labels ...string) StatCounter { 10 return f.f(labels) 11 } 12 13 func fakeCounterVec(f func([]string) StatCounter) StatCounterVec { 14 return &fCounterVec{ 15 f: f, 16 } 17 } 18 19 //------------------------------------------------------------------------------ 20 21 type fTimerVec struct { 22 f func([]string) StatTimer 23 } 24 25 func (f *fTimerVec) With(labels ...string) StatTimer { 26 return f.f(labels) 27 } 28 29 func fakeTimerVec(f func([]string) StatTimer) StatTimerVec { 30 return &fTimerVec{ 31 f: f, 32 } 33 } 34 35 //------------------------------------------------------------------------------ 36 37 type fGaugeVec struct { 38 f func([]string) StatGauge 39 } 40 41 func (f *fGaugeVec) With(labels ...string) StatGauge { 42 return f.f(labels) 43 } 44 45 func fakeGaugeVec(f func([]string) StatGauge) StatGaugeVec { 46 return &fGaugeVec{ 47 f: f, 48 } 49 } 50 51 //------------------------------------------------------------------------------