Make monitor golintable (#7652)
* added comment on top of the Reporter interface * fixed a capitalisation typo which threw a linting error * added comment on top of type Statistics * Added a proper comment to Reporter interface * Added a proper comment to type Statistics * Update service.go Changed wording 'list' to 'slice'.pull/7620/merge
parent
27d157763a
commit
0ea807dce1
|
@ -2,6 +2,7 @@ package monitor
|
|||
|
||||
import "github.com/influxdata/influxdb/models"
|
||||
|
||||
// Reporter is an interface for gathering internal statistics
|
||||
type Reporter interface {
|
||||
Statistics(tags map[string]string) []models.Statistic
|
||||
}
|
||||
|
|
|
@ -441,7 +441,7 @@ type Statistic struct {
|
|||
models.Statistic
|
||||
}
|
||||
|
||||
// valueNames returns a sorted list of the value names, if any.
|
||||
// ValueNames returns a sorted list of the value names, if any.
|
||||
func (s *Statistic) ValueNames() []string {
|
||||
a := make([]string, 0, len(s.Values))
|
||||
for k := range s.Values {
|
||||
|
@ -451,6 +451,7 @@ func (s *Statistic) ValueNames() []string {
|
|||
return a
|
||||
}
|
||||
|
||||
// Statistics is a slice of sortable statistics
|
||||
type Statistics []*Statistic
|
||||
|
||||
func (a Statistics) Len() int { return len(a) }
|
||||
|
|
Loading…
Reference in New Issue