diff --git a/monitor/reporter.go b/monitor/reporter.go index 4a10fbad14..2ae36efb66 100644 --- a/monitor/reporter.go +++ b/monitor/reporter.go @@ -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 } diff --git a/monitor/service.go b/monitor/service.go index a047790c96..3868b77b54 100644 --- a/monitor/service.go +++ b/monitor/service.go @@ -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) }