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
Abdisamad Hashi 2016-11-28 10:47:02 +00:00 committed by Edd Robinson
parent 27d157763a
commit 0ea807dce1
2 changed files with 3 additions and 1 deletions

View File

@ -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
}

View File

@ -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) }