merics: add Init func to interface
Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
This commit is contained in:
		| @@ -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: | // Count implements the Reporter interface Count method: | ||||||
| func (r *noopReporter) Count(metricName string, value int64, tags Tags) error { | func (r *noopReporter) Count(metricName string, value int64, tags Tags) error { | ||||||
| 	return nil | 	return nil | ||||||
|   | |||||||
| @@ -12,6 +12,7 @@ var ( | |||||||
|  |  | ||||||
| // Reporter is an interface for collecting and instrumenting metrics | // Reporter is an interface for collecting and instrumenting metrics | ||||||
| type Reporter interface { | type Reporter interface { | ||||||
|  | 	Init(...Option) error | ||||||
| 	Count(id string, value int64, tags Tags) error | 	Count(id string, value int64, tags Tags) error | ||||||
| 	Gauge(id string, value float64, tags Tags) error | 	Gauge(id string, value float64, tags Tags) error | ||||||
| 	Timing(id string, value time.Duration, tags Tags) error | 	Timing(id string, value time.Duration, tags Tags) error | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user