Commit 68ed4d45 by coral

change pdiff to percent_diff for conditions

parent 9e48d544
......@@ -117,7 +117,7 @@ func (s *SimpleReducer) Reduce(series *tsdb.TimeSeries) null.Float {
break
}
}
case "pdiff":
case "percent_diff":
var (
points = series.Points
first float64
......
......@@ -86,8 +86,8 @@ func TestSimpleReducer(t *testing.T) {
So(result, ShouldEqual, float64(10))
})
Convey("pdiff", func() {
result := testReducer("pdiff", 30, 40)
Convey("percent_diff", func() {
result := testReducer("percent_diff", 30, 40)
So(result, ShouldEqual, float64(33.33333333333333))
})
......
......@@ -50,7 +50,7 @@ var reducerTypes = [
{text: 'last()', value: 'last'},
{text: 'median()', value: 'median'},
{text: 'diff()', value: 'diff'},
{text: 'pdiff()', value: 'pdiff'},
{text: 'percent_diff()', value: 'percent_diff'},
];
var noDataModes = [
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment