Skip to content

Commit

Permalink
rename field isEnabled to enabled
Browse files Browse the repository at this point in the history
  • Loading branch information
mjeri authored and traefiker committed Aug 23, 2017
1 parent 9ee02d6 commit 6a4221b
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion metrics/datadog.go
Expand Up @@ -31,7 +31,7 @@ func RegisterDatadog(config *types.Datadog) Registry {
}

registry := &standardRegistry{
isEnabled: true,
enabled: true,
reqsCounter: datadogClient.NewCounter(ddMetricsReqsName, 1.0),
reqDurationHistogram: datadogClient.NewHistogram(ddMetricsLatencyName, 1.0),
retriesCounter: datadogClient.NewCounter(ddRetriesTotalName, 1.0),
Expand Down
8 changes: 4 additions & 4 deletions metrics/metrics.go
Expand Up @@ -27,22 +27,22 @@ func NewMultiRegistry(registries []Registry) Registry {
}

return &standardRegistry{
isEnabled: true,
enabled: true,
reqsCounter: multi.NewCounter(reqsCounters...),
reqDurationHistogram: multi.NewHistogram(reqDurationHistograms...),
retriesCounter: multi.NewCounter(retriesCounters...),
}
}

type standardRegistry struct {
isEnabled bool
enabled bool
reqsCounter metrics.Counter
reqDurationHistogram metrics.Histogram
retriesCounter metrics.Counter
}

func (r *standardRegistry) IsEnabled() bool {
return r.isEnabled
return r.enabled
}

func (r *standardRegistry) ReqsCounter() metrics.Counter {
Expand All @@ -61,7 +61,7 @@ func (r *standardRegistry) RetriesCounter() metrics.Counter {
// It is used to avoid nil checking in components that do metric collections.
func NewVoidRegistry() Registry {
return &standardRegistry{
isEnabled: false,
enabled: false,
reqsCounter: &voidCounter{},
reqDurationHistogram: &voidHistogram{},
retriesCounter: &voidCounter{},
Expand Down
2 changes: 1 addition & 1 deletion metrics/prometheus.go
Expand Up @@ -37,7 +37,7 @@ func RegisterPrometheus(config *types.Prometheus) Registry {
}, []string{"service"})

return &standardRegistry{
isEnabled: true,
enabled: true,
reqsCounter: reqCounter,
reqDurationHistogram: reqDurationHistogram,
retriesCounter: retryCounter,
Expand Down
2 changes: 1 addition & 1 deletion metrics/statsd.go
Expand Up @@ -24,7 +24,7 @@ func RegisterStatsd(config *types.Statsd) Registry {
}

return &standardRegistry{
isEnabled: true,
enabled: true,
reqsCounter: statsdClient.NewCounter(ddMetricsReqsName, 1.0),
reqDurationHistogram: statsdClient.NewTiming(ddMetricsLatencyName, 1.0),
retriesCounter: statsdClient.NewCounter(ddRetriesTotalName, 1.0),
Expand Down

0 comments on commit 6a4221b

Please sign in to comment.