Fix assorted spelling mistakes (#7507)

This commit is contained in:
Josh Soref
2020-05-15 18:43:32 -04:00
committed by GitHub
parent f74824eecb
commit bf1eb291f2
41 changed files with 79 additions and 79 deletions

View File

@@ -17,7 +17,7 @@ import (
)
var (
registry *rgstry
registry *Registry
)
// Stat is an interface for dealing with telegraf statistics collected
@@ -109,12 +109,12 @@ func Metrics() []telegraf.Metric {
return metrics
}
type rgstry struct {
type Registry struct {
stats map[uint64]map[string]Stat
mu sync.Mutex
}
func (r *rgstry) register(measurement, field string, tags map[string]string) Stat {
func (r *Registry) register(measurement, field string, tags map[string]string) Stat {
r.mu.Lock()
defer r.mu.Unlock()
@@ -137,7 +137,7 @@ func (r *rgstry) register(measurement, field string, tags map[string]string) Sta
return s
}
func (r *rgstry) registerTiming(measurement, field string, tags map[string]string) Stat {
func (r *Registry) registerTiming(measurement, field string, tags map[string]string) Stat {
r.mu.Lock()
defer r.mu.Unlock()
@@ -160,7 +160,7 @@ func (r *rgstry) registerTiming(measurement, field string, tags map[string]strin
return s
}
func (r *rgstry) get(key uint64, field string) (Stat, bool) {
func (r *Registry) get(key uint64, field string) (Stat, bool) {
if _, ok := r.stats[key]; !ok {
return nil, false
}
@@ -172,7 +172,7 @@ func (r *rgstry) get(key uint64, field string) (Stat, bool) {
return nil, false
}
func (r *rgstry) set(key uint64, s Stat) {
func (r *Registry) set(key uint64, s Stat) {
if _, ok := r.stats[key]; !ok {
r.stats[key] = make(map[string]Stat)
}
@@ -201,7 +201,7 @@ func key(measurement string, tags map[string]string) uint64 {
}
func init() {
registry = &rgstry{
registry = &Registry{
stats: make(map[uint64]map[string]Stat),
}
}

View File

@@ -18,7 +18,7 @@ var (
// testCleanup resets the global registry for test cleanup & unlocks the test lock
func testCleanup() {
registry = &rgstry{
registry = &Registry{
stats: make(map[uint64]map[string]Stat),
}
testLock.Unlock()