forked from go-kit/kit
-
Notifications
You must be signed in to change notification settings - Fork 0
/
expvar.go
31 lines (24 loc) · 776 Bytes
/
expvar.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
package provider
import (
"github.com/go-kit/kit/metrics"
"github.com/go-kit/kit/metrics/expvar"
)
type expvarProvider struct{}
// NewExpvarProvider returns a Provider that produces expvar metrics.
func NewExpvarProvider() Provider {
return expvarProvider{}
}
// NewCounter implements Provider.
func (p expvarProvider) NewCounter(name string) metrics.Counter {
return expvar.NewCounter(name)
}
// NewGauge implements Provider.
func (p expvarProvider) NewGauge(name string) metrics.Gauge {
return expvar.NewGauge(name)
}
// NewHistogram implements Provider.
func (p expvarProvider) NewHistogram(name string, buckets int) metrics.Histogram {
return expvar.NewHistogram(name, buckets)
}
// Stop implements Provider, but is a no-op.
func (p expvarProvider) Stop() {}