Skip to content

Instantly share code, notes, and snippets.

View dgnorton's full-sized avatar

David Norton dgnorton

  • InfluxDB
  • Mooresville, NC
View GitHub Profile
/home/dgnorton/.config/sublime-text-3/Packages/User/Go.sublime-build
{
"shell_cmd": "/home/dgnorton/src/go/bin/go build && /home/dgnorton/src/go/bin/go vet",
"file_regex": "^(.*):([0-9]+):"
}
{
"rows": [
{
"name": "cpu"
},
{
"name": "temp",
"columns": ["field1", "field2"]
}
]
[data]
retention-check-period = "10s"
[data]
retention-check-period = "10s"
printf "creating database\n"
curl -G http://localhost:8086/query --data-urlencode "q=CREATE DATABASE foo"
printf "creating retention policy\n"
curl -G http://localhost:8086/query --data-urlencode "q=CREATE RETENTION POLICY bar ON foo DURATION 5s REPLICATION 3 DEFAULT"
printf "inserting data\n"
curl -d '{"database" : "foo", "retentionPolicy" : "bar", "points": [{"name": "cpu", "tags": {"host": "server01"},"timestamp": "2015-01-26T22:01:11.703Z","values": {"value": 100}}]}' -H "Content-Type: application/json" http://localhost:8086/write
printf "querying data\n"
dgnorton@maple:~/go/src/github.com/influxdb/influxdb/tests$ cat create_write_single_query.sh
echo "creating database"
curl -G http://localhost:8086/query --data-urlencode "q=CREATE DATABASE foo"
echo "creating retention policy"
curl -G http://localhost:8086/query --data-urlencode "q=CREATE RETENTION POLICY bar ON foo DURATION 1h REPLICATION 3 DEFAULT"
echo "inserting data"
curl -d '{"database" : "foo", "retentionPolicy" : "bar", "points": [{"name": "cpu", "tags": {"host": "server01"},"timestamp": "2015-01-26T22:01:11.703Z","values": {"value": 100}}]}' -H "Content-Type: application/json" http://localhost:8086/write
package main
import (
"encoding/json"
"flag"
"fmt"
"time"
)
func main() {
#!/bin/sh
set -e
if [ -z "$1" ]; then
printf "\nusage: branch-cleanup.sh <git username>\n\n"
printf "Deletes all merged branches and branches with no unmerged commits by the specified user.\n\n"
exit 1
fi
{
"shell_cmd": "/home/dgnorton/src/go/bin/go build && /home/dgnorton/src/go/bin/go vet",
"file_regex": "^(.*):([0-9]+):",
"env": {"GOPATH": "/home/dgnorton/go"}
}
> select value from cpu where region = 'seast' and server = 'server00007' and country ='DEU'
name: cpu
---------
time value
2015-04-13T09:14:35.337553693Z 1
2015-04-13T09:14:35.339713339Z 1
2015-04-13T09:14:35.339837701Z 1
2015-04-13T09:14:37.970437712Z 2
2015-04-13T09:14:37.970868321Z 2
2015-04-13T09:14:37.972944286Z 2