merics: add Init func to interface
Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
This commit is contained in:
parent
f6c914c1e4
commit
e0ef8b2953
@ -16,6 +16,14 @@ func NewReporter(opts ...Option) Reporter {
|
||||
}
|
||||
}
|
||||
|
||||
// Init initialize options
|
||||
func (r *noopReporter) Init(opts ...Option) error {
|
||||
for _, o := range opts {
|
||||
o(&r.opts)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// Count implements the Reporter interface Count method:
|
||||
func (r *noopReporter) Count(metricName string, value int64, tags Tags) error {
|
||||
return nil
|
||||
|
@ -12,6 +12,7 @@ var (
|
||||
|
||||
// Reporter is an interface for collecting and instrumenting metrics
|
||||
type Reporter interface {
|
||||
Init(...Option) error
|
||||
Count(id string, value int64, tags Tags) error
|
||||
Gauge(id string, value float64, tags Tags) error
|
||||
Timing(id string, value time.Duration, tags Tags) error
|
||||
|
Loading…
Reference in New Issue
Block a user