Skip to content

Commit

Permalink
Add series averaging support to influxdb connector
Browse files Browse the repository at this point in the history
  • Loading branch information
falzm committed Jul 28, 2014
1 parent 7dbca17 commit 428c786
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions pkg/connector/influxdb.go
Original file line number Diff line number Diff line change
Expand Up @@ -127,10 +127,11 @@ func (connector *InfluxDBConnector) GetPlots(query *plot.Query) ([]plot.Series,
}
return []plot.Series{sumSeries}, nil
} else if query.Group.Type == OperGroupTypeAvg {
return nil, fmt.Errorf(
"influxdb[%s]: average series grouping not supported by influxdb connector",
connector.name,
)
avgSeries, err := plot.AvgSeries(resultSeries)
if err != nil {
return nil, fmt.Errorf("influxdb[%s]: unable to average series: %s", connector.name, err)
}
return []plot.Series{avgSeries}, nil
} else {
return resultSeries, nil
}
Expand Down

0 comments on commit 428c786

Please sign in to comment.