influxdb/tests/create_write_multiple_query.sh

15 lines
1.4 KiB
Bash
Raw Normal View History

2015-01-23 16:14:02 +00:00
echo "creating database"
2015-01-22 17:26:08 +00:00
curl -G http://localhost:8086/query --data-urlencode "q=CREATE DATABASE foo"
echo "creating retention policy"
2015-01-28 07:53:16 +00:00
curl -G http://localhost:8086/query --data-urlencode "q=CREATE RETENTION POLICY bar ON foo DURATION 1h REPLICATION 3 DEFAULT"
2015-01-22 17:26:08 +00:00
echo "inserting data"
curl -d '{"database" : "foo", "retentionPolicy" : "bar", "points": [{"measurement": "cpu", "tags": {"host": "server01"},"time": "2015-01-26T22:01:11.703Z","fields": {"value": 100}}]}' -H "Content-Type: application/json" http://localhost:8086/write
curl -d '{"database" : "foo", "retentionPolicy" : "bar", "points": [{"measurement": "cpu", "tags": {"host": "server01"},"time": "2015-01-27T22:01:11.703Z","fields": {"value": 100}}]}' -H "Content-Type: application/json" http://localhost:8086/write
curl -d '{"database" : "foo", "retentionPolicy" : "bar", "points": [{"measurement": "cpu", "tags": {"host": "server01"},"time": "2015-01-28T22:01:11.703Z","fields": {"value": 100}}]}' -H "Content-Type: application/json" http://localhost:8086/write
curl -d '{"database" : "foo", "retentionPolicy" : "bar", "points": [{"measurement": "mem", "tags": {"host": "server01"},"time": "2015-01-29T22:01:11.703Z","fields": {"value": 100}}]}' -H "Content-Type: application/json" http://localhost:8086/write
2015-01-22 17:26:08 +00:00
echo "querying data"
2015-01-28 07:53:16 +00:00
curl -G http://localhost:8086/query --data-urlencode "db=foo" --data-urlencode "q=SELECT sum(value) FROM \"foo\".\"bar\".cpu GROUP BY time(1h)"