Skip to content

Commit

Permalink
add test for stddev
Browse files Browse the repository at this point in the history
  • Loading branch information
neonstalwart committed Apr 22, 2015
1 parent a86897d commit 2127f22
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions cmd/influxd/server_integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -590,6 +590,23 @@ func runTestsData(t *testing.T, testName string, nodes Cluster, database, retent
queryDb: "%DB%",
expected: `{"results":[{"series":[{"name":"cpu","columns":["time","mean"],"values":[["1970-01-01T00:00:00Z",` + string(maxFloat64) + `]]}]}]}`,
},
{
reset: true,
name: "mean and stddev",
write: `{"database" : "%DB%", "retentionPolicy" : "%RP%", "points": [
{"name": "cpu", "timestamp": "2000-01-01T00:00:00Z", "fields": {"value": 2}},
{"name": "cpu", "timestamp": "2000-01-01T00:00:10Z", "fields": {"value": 4}},
{"name": "cpu", "timestamp": "2000-01-01T00:00:20Z", "fields": {"value": 4}},
{"name": "cpu", "timestamp": "2000-01-01T00:00:30Z", "fields": {"value": 4}},
{"name": "cpu", "timestamp": "2000-01-01T00:00:40Z", "fields": {"value": 5}},
{"name": "cpu", "timestamp": "2000-01-01T00:00:50Z", "fields": {"value": 5}},
{"name": "cpu", "timestamp": "2000-01-01T00:01:00Z", "fields": {"value": 7}},
{"name": "cpu", "timestamp": "2000-01-01T00:01:10Z", "fields": {"value": 9}}
]}`,
query: `SELECT mean(value), stddev(value) FROM cpu WHERE time >= '2000-01-01' AND time < '2000-01-01T00:02:00Z' GROUP BY time(10m)`,
queryDb: "%DB%",
expected: `{"results":[{"series":[{"name":"cpu","columns":["time","mean","stddev"],"values":[["2000-01-01T00:00:00Z",5,2.138089935299395]]}]}]}`,
},
{
reset: true,
name: "aggregations",
Expand Down

0 comments on commit 2127f22

Please sign in to comment.