diff --git a/monitor/service.go b/monitor/service.go index d5859f2e57..c62b2c42b1 100644 --- a/monitor/service.go +++ b/monitor/service.go @@ -171,8 +171,8 @@ func (m *Monitor) DeregisterDiagnosticsClient(name string) { // Statistics returns the combined statistics for all expvar data. The given // tags are added to each of the returned statistics. -func (m *Monitor) Statistics(tags map[string]string) ([]*statistic, error) { - statistics := make([]*statistic, 0) +func (m *Monitor) Statistics(tags map[string]string) ([]*Statistic, error) { + statistics := make([]*Statistic, 0) expvar.Do(func(kv expvar.KeyValue) { // Skip built-in expvar stats. @@ -180,7 +180,7 @@ func (m *Monitor) Statistics(tags map[string]string) ([]*statistic, error) { return } - statistic := &statistic{ + statistic := &Statistic{ Tags: make(map[string]string), Values: make(map[string]interface{}), } @@ -246,7 +246,7 @@ func (m *Monitor) Statistics(tags map[string]string) ([]*statistic, error) { }) // Add Go memstats. - statistic := &statistic{ + statistic := &Statistic{ Name: "runtime", Tags: make(map[string]string), Values: make(map[string]interface{}), @@ -388,16 +388,16 @@ func (m *Monitor) storeStatistics() { } } -// statistic represents the information returned by a single monitor client. -type statistic struct { +// Statistic represents the information returned by a single monitor client. +type Statistic struct { Name string Tags map[string]string Values map[string]interface{} } // newStatistic returns a new statistic object. -func newStatistic(name string, tags map[string]string, values map[string]interface{}) *statistic { - return &statistic{ +func newStatistic(name string, tags map[string]string, values map[string]interface{}) *Statistic { + return &Statistic{ Name: name, Tags: tags, Values: values, @@ -405,7 +405,7 @@ func newStatistic(name string, tags map[string]string, values map[string]interfa } // valueNames returns a sorted list of the value names, if any. -func (s *statistic) valueNames() []string { +func (s *Statistic) valueNames() []string { a := make([]string, 0, len(s.Values)) for k, _ := range s.Values { a = append(a, k) diff --git a/monitor/statement_executor.go b/monitor/statement_executor.go index acfff7bea6..450fc4894b 100644 --- a/monitor/statement_executor.go +++ b/monitor/statement_executor.go @@ -11,7 +11,7 @@ import ( // StatementExecutor translates InfluxQL queries to Monitor methods. type StatementExecutor struct { Monitor interface { - Statistics(map[string]string) ([]*statistic, error) + Statistics(map[string]string) ([]*Statistic, error) Diagnostics() (map[string]*Diagnostic, error) } }