feat(query/querytest): first batch of tests ready for review (#56)

* feat(query/querytest): first batch of tests ready for review

added helper executables for generating output, comparing specs.  Also updated several tests and added code to skip red tests with a clear reason in the message
pull/10616/head
Adam 2018-05-31 16:45:44 -04:00 committed by GitHub
parent 6b2cf4e666
commit 070649527c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
36 changed files with 387 additions and 81 deletions

View File

@ -506,7 +506,7 @@ func TestResultDecoder(t *testing.T) {
func TestResultEncoder(t *testing.T) {
testCases := []TestCase{
// Add tests cases specific to encoding here
// Add tests cases specific to encoding here
}
testCases = append(testCases, symetricalTestCases...)
for _, tc := range testCases {

View File

@ -0,0 +1,86 @@
package main
import (
"context"
"fmt"
"io/ioutil"
"os"
"path/filepath"
"regexp"
"strings"
"github.com/google/go-cmp/cmp/cmpopts"
"github.com/influxdata/platform/query"
"github.com/influxdata/platform/query/influxql"
"github.com/influxdata/platform/query/semantic/semantictest"
"github.com/google/go-cmp/cmp"
"golang.org/x/text/unicode/norm"
)
func normalizeString(s string) []byte {
result := norm.NFC.String(strings.TrimSpace(s))
re := regexp.MustCompile(`\r?\n`)
return []byte(re.ReplaceAllString(result, "\r\n"))
}
func printUsage() {
fmt.Println("usage: prepcsvtests /path/to/testfiles [testname]")
}
func main() {
fnames := make([]string, 0)
path := ""
var err error
if len(os.Args) == 3 {
path = os.Args[1]
fnames = append(fnames, filepath.Join(path, os.Args[2])+".ifql")
} else if len(os.Args) == 2 {
path = os.Args[1]
fnames, err = filepath.Glob(filepath.Join(path, "*.ifql"))
if err != nil {
return
}
} else {
printUsage()
return
}
for _, fname := range fnames {
ext := ".ifql"
testName := fname[0 : len(fname)-len(ext)]
ifqltext, err := ioutil.ReadFile(fname)
if err != nil {
fmt.Printf("error reading ifq l query text: %s", err)
return
}
influxqltext, err := ioutil.ReadFile(testName + ".influxql")
if err != nil {
fmt.Printf("error reading influxql query text: %s", err)
return
}
ifqlspec, err := query.Compile(context.Background(), string(ifqltext))
if err != nil {
fmt.Printf("error compiling. \n query: \n %s \n err: %s", string(ifqltext), err)
return
}
transpiler := influxql.NewTranspiler()
influxqlspec, err := transpiler.Transpile(context.Background(), string(influxqltext))
if err != nil {
fmt.Printf("error transpiling. \n query: \n %s \n err: %s", string(influxqltext), err)
return
}
var opts = append(
semantictest.CmpOptions,
cmp.AllowUnexported(query.Spec{}),
cmpopts.IgnoreUnexported(query.Spec{}))
difference := cmp.Diff(ifqlspec, influxqlspec, opts...)
fmt.Printf("compiled vs transpiled diff: \n%s", difference)
}
}

View File

@ -58,20 +58,12 @@ func GetQueryEncodedResults(qs query.QueryService, spec *query.Spec, inputFile s
if err != nil {
return "", err
}
enc := csv.NewResultEncoder(csv.DefaultEncoderConfig())
enc := csv.NewMultiResultEncoder(csv.DefaultEncoderConfig())
buf := new(bytes.Buffer)
// we are only expecting one result, for now
for results.More() {
res := results.Next()
err := enc.Encode(buf, res)
if err != nil {
results.Cancel()
return "", err
}
if err := enc.Encode(buf, results); err != nil {
return "", err
}
return buf.String(), nil
return buf.String(), results.Err()
}
func GetTestData(prefix, suffix string) (string, error) {

View File

@ -14,6 +14,14 @@ import (
"github.com/andreyvit/diff"
)
var skipTests = map[string]string{
"derivative": "derivative not supported by influxql (https://github.com/influxdata/platform/issues/93)",
"filter_by_tags": "arbitrary filtering not supported by influxql (https://github.com/influxdata/platform/issues/94)",
"group_ungroup": "influxql/ifql disagreement on keycols (https://github.com/influxdata/platform/issues/95)",
"window": "ordering of results differs between queries (https://github.com/influxdata/platform/issues/96)",
"window_group_mean_ungroup": "error in influxql: failed to run query: timeValue column \"_start\" does not exist (https://github.com/influxdata/platform/issues/97)",
}
func Test_QueryEndToEnd(t *testing.T) {
qs := GetQueryServiceBridge()
@ -36,20 +44,27 @@ func Test_QueryEndToEnd(t *testing.T) {
for _, ifqlFile := range ifqlFiles {
ext := filepath.Ext(ifqlFile)
prefix := ifqlFile[0 : len(ifqlFile)-len(ext)]
_, caseName := filepath.Split(prefix)
if reason, ok := skipTests[caseName]; ok {
t.Run(caseName, func(t *testing.T) {
t.Skip(reason)
})
continue
}
ifqlName := caseName + ".ifql"
influxqlName := caseName + ".influxql"
t.Run(ifqlName, func(t *testing.T) {
queryTester(t, qs, ifqlName, prefix, ".ifql")
queryTester(t, qs, prefix, ".ifql")
})
t.Run(influxqlName, func(t *testing.T) {
queryTranspileTester(t, influxqlTranspiler, qs, influxqlName, prefix, ".influxql")
queryTranspileTester(t, influxqlTranspiler, qs, prefix, ".influxql")
})
}
}
func queryTester(t *testing.T, qs query.QueryService, name, prefix, queryExt string) {
func queryTester(t *testing.T, qs query.QueryService, prefix, queryExt string) {
q, err := GetTestData(prefix, queryExt)
if err != nil {
t.Fatal(err)
@ -57,19 +72,19 @@ func queryTester(t *testing.T, qs query.QueryService, name, prefix, queryExt str
csvOut, err := GetTestData(prefix, ".out.csv")
if err != nil {
t.Fatalf("error in test case %s: %s", prefix, err)
t.Fatal(err)
}
spec, err := query.Compile(context.Background(), q)
if err != nil {
t.Fatalf("error in test case %s: %s", prefix, err)
t.Fatalf("failed to compile: %v", err)
}
csvIn := prefix + ".in.csv"
QueryTestCheckSpec(t, qs, spec, csvIn, csvOut)
}
func queryTranspileTester(t *testing.T, transpiler query.Transpiler, qs query.QueryService, name, prefix, queryExt string) {
func queryTranspileTester(t *testing.T, transpiler query.Transpiler, qs query.QueryService, prefix, queryExt string) {
q, err := GetTestData(prefix, queryExt)
if err != nil {
if os.IsNotExist(err) {
@ -81,12 +96,12 @@ func queryTranspileTester(t *testing.T, transpiler query.Transpiler, qs query.Qu
csvOut, err := GetTestData(prefix, ".out.csv")
if err != nil {
t.Fatalf("error in test case %s: %s", prefix, err)
t.Fatal(err)
}
spec, err := transpiler.Transpile(context.Background(), q)
if err != nil {
t.Fatalf("failed to transpile query to spec error=%s", err)
t.Fatalf("failed to transpile: %v", err)
}
csvIn := prefix + ".in.csv"
@ -99,7 +114,7 @@ func QueryTestCheckSpec(t *testing.T, qs query.QueryService, spec *query.Spec, i
got, err := GetQueryEncodedResults(qs, spec, inputFile)
if err != nil {
t.Fatalf("failed to run query error=%s", err)
t.Fatalf("failed to run query: %v", err)
}
if g, w := strings.TrimSpace(got), strings.TrimSpace(want); g != w {
t.Fatalf("result not as expected want(-) got (+):\n%v", diff.LineDiff(w, g))

View File

@ -0,0 +1,3 @@
from(db:"testdb")
|> range(start: 2018-05-23T13:09:22.885021542Z)
|> derivative(unit:100ms)

View File

@ -0,0 +1,10 @@
#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,dateTime:RFC3339,double,string,string,string,string,string,string
#partition,false,false,false,false,false,false,true,true,true,true,true,true
#default,_result,,,,,,,,,,,
,result,table,_start,_stop,_time,_value,_field,_measurement,device,fstype,host,path
,,96,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:26Z,34.98234271799806,used_percent,disk,disk1s1,apfs,host.local,/
,,96,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:36Z,34.98234941084654,used_percent,disk,disk1s1,apfs,host.local,/
,,96,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:46Z,34.982447293755506,used_percent,disk,disk1s1,apfs,host.local,/
,,96,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:56Z,34.982447293755506,used_percent,disk,disk1s1,apfs,host.local,/
,,96,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:54:06Z,34.98204153981662,used_percent,disk,disk1s1,apfs,host.local,/
,,96,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:54:16Z,34.982252364543626,used_percent,disk,disk1s1,apfs,host.local,/
1 #datatype string long dateTime:RFC3339 dateTime:RFC3339 dateTime:RFC3339 double string string string string string string
2 #partition false false false false false false true true true true true true
3 #default _result
4 result table _start _stop _time _value _field _measurement device fstype host path
5 96 2018-05-22T19:53:24.421470485Z 2018-05-22T19:54:24.421470485Z 2018-05-22T19:53:26Z 34.98234271799806 used_percent disk disk1s1 apfs host.local /
6 96 2018-05-22T19:53:24.421470485Z 2018-05-22T19:54:24.421470485Z 2018-05-22T19:53:36Z 34.98234941084654 used_percent disk disk1s1 apfs host.local /
7 96 2018-05-22T19:53:24.421470485Z 2018-05-22T19:54:24.421470485Z 2018-05-22T19:53:46Z 34.982447293755506 used_percent disk disk1s1 apfs host.local /
8 96 2018-05-22T19:53:24.421470485Z 2018-05-22T19:54:24.421470485Z 2018-05-22T19:53:56Z 34.982447293755506 used_percent disk disk1s1 apfs host.local /
9 96 2018-05-22T19:53:24.421470485Z 2018-05-22T19:54:24.421470485Z 2018-05-22T19:54:06Z 34.98204153981662 used_percent disk disk1s1 apfs host.local /
10 96 2018-05-22T19:53:24.421470485Z 2018-05-22T19:54:24.421470485Z 2018-05-22T19:54:16Z 34.982252364543626 used_percent disk disk1s1 apfs host.local /

View File

@ -0,0 +1 @@
select derivative("used_percent") FROM testdb..disk

View File

@ -0,0 +1,10 @@
#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,dateTime:RFC3339,double,string,string,string,string,string,string
#partition,false,false,false,false,false,false,true,true,true,true,true,true
#default,_result,,,,,,,,,,,
,result,table,_start,_stop,_time,_value,_field,_measurement,device,fstype,host,path
,,0,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:36Z,0.00000006692848479872282,used_percent,disk,disk1s1,apfs,host.local,/
,,0,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:46Z,0.0000009788290896750597,used_percent,disk,disk1s1,apfs,host.local,/
,,0,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:56Z,0,used_percent,disk,disk1s1,apfs,host.local,/
,,0,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:54:06Z,-0.000004057539388853115,used_percent,disk,disk1s1,apfs,host.local,/
,,0,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:54:16Z,0.0000021082472700584276,used_percent,disk,disk1s1,apfs,host.local,/
1 #datatype string long dateTime:RFC3339 dateTime:RFC3339 dateTime:RFC3339 double string string string string string string
2 #partition false false false false false false true true true true true true
3 #default _result
4 result table _start _stop _time _value _field _measurement device fstype host path
5 0 2018-05-22T19:53:24.421470485Z 2018-05-22T19:54:24.421470485Z 2018-05-22T19:53:36Z 0.00000006692848479872282 used_percent disk disk1s1 apfs host.local /
6 0 2018-05-22T19:53:24.421470485Z 2018-05-22T19:54:24.421470485Z 2018-05-22T19:53:46Z 0.0000009788290896750597 used_percent disk disk1s1 apfs host.local /
7 0 2018-05-22T19:53:24.421470485Z 2018-05-22T19:54:24.421470485Z 2018-05-22T19:53:56Z 0 used_percent disk disk1s1 apfs host.local /
8 0 2018-05-22T19:53:24.421470485Z 2018-05-22T19:54:24.421470485Z 2018-05-22T19:54:06Z -0.000004057539388853115 used_percent disk disk1s1 apfs host.local /
9 0 2018-05-22T19:53:24.421470485Z 2018-05-22T19:54:24.421470485Z 2018-05-22T19:54:16Z 0.0000021082472700584276 used_percent disk disk1s1 apfs host.local /

View File

@ -0,0 +1 @@
select io_time from testdb..diskio where "name" = "disk0"

View File

@ -13,3 +13,4 @@
#partition,false,false,false,false,false,false,true,true,true,true
#default,_result,1,,,,,io_time,diskio,host.local,disk2
,result,table,_start,_stop,_time,_value,_field,_measurement,host,name

1 #datatype string long dateTime:RFC3339 dateTime:RFC3339 dateTime:RFC3339 long string string string string
13 #default _result 1 io_time diskio host.local disk2
14 result table _start _stop _time _value _field _measurement host name
15
16

View File

@ -0,0 +1,3 @@
from(db:"testdb")
|> range(start: 2018-05-23T13:09:22.885021542Z)
|> group(by: ["name"])

View File

@ -0,0 +1,16 @@
#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,dateTime:RFC3339,long,string,string,string,string
#partition,false,false,false,false,false,false,true,true,true,true
#default,_result,,,,,,,,,
,result,table,_start,_stop,_time,_value,_field,_measurement,host,name
,,1,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:26Z,15204688,io_time,diskio,host.local,disk0
,,1,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:36Z,15204894,io_time,diskio,host.local,disk0
,,1,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:46Z,15205102,io_time,diskio,host.local,disk0
,,1,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:56Z,15205226,io_time,diskio,host.local,disk0
,,1,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:54:06Z,15205499,io_time,diskio,host.local,disk0
,,1,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:54:16Z,15205755,io_time,diskio,host.local,disk0
,,10,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:26Z,648,io_time,diskio,host.local,disk2
,,10,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:36Z,648,io_time,diskio,host.local,disk2
,,10,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:46Z,648,io_time,diskio,host.local,disk2
,,10,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:56Z,648,io_time,diskio,host.local,disk2
,,10,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:54:06Z,648,io_time,diskio,host.local,disk2
,,10,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:54:16Z,648,io_time,diskio,host.local,disk2
1 #datatype string long dateTime:RFC3339 dateTime:RFC3339 dateTime:RFC3339 long string string string string
2 #partition false false false false false false true true true true
3 #default _result
4 result table _start _stop _time _value _field _measurement host name
5 1 2018-05-22T19:53:24.421470485Z 2018-05-22T19:54:24.421470485Z 2018-05-22T19:53:26Z 15204688 io_time diskio host.local disk0
6 1 2018-05-22T19:53:24.421470485Z 2018-05-22T19:54:24.421470485Z 2018-05-22T19:53:36Z 15204894 io_time diskio host.local disk0
7 1 2018-05-22T19:53:24.421470485Z 2018-05-22T19:54:24.421470485Z 2018-05-22T19:53:46Z 15205102 io_time diskio host.local disk0
8 1 2018-05-22T19:53:24.421470485Z 2018-05-22T19:54:24.421470485Z 2018-05-22T19:53:56Z 15205226 io_time diskio host.local disk0
9 1 2018-05-22T19:53:24.421470485Z 2018-05-22T19:54:24.421470485Z 2018-05-22T19:54:06Z 15205499 io_time diskio host.local disk0
10 1 2018-05-22T19:53:24.421470485Z 2018-05-22T19:54:24.421470485Z 2018-05-22T19:54:16Z 15205755 io_time diskio host.local disk0
11 10 2018-05-22T19:53:24.421470485Z 2018-05-22T19:54:24.421470485Z 2018-05-22T19:53:26Z 648 io_time diskio host.local disk2
12 10 2018-05-22T19:53:24.421470485Z 2018-05-22T19:54:24.421470485Z 2018-05-22T19:53:36Z 648 io_time diskio host.local disk2
13 10 2018-05-22T19:53:24.421470485Z 2018-05-22T19:54:24.421470485Z 2018-05-22T19:53:46Z 648 io_time diskio host.local disk2
14 10 2018-05-22T19:53:24.421470485Z 2018-05-22T19:54:24.421470485Z 2018-05-22T19:53:56Z 648 io_time diskio host.local disk2
15 10 2018-05-22T19:53:24.421470485Z 2018-05-22T19:54:24.421470485Z 2018-05-22T19:54:06Z 648 io_time diskio host.local disk2
16 10 2018-05-22T19:53:24.421470485Z 2018-05-22T19:54:24.421470485Z 2018-05-22T19:54:16Z 648 io_time diskio host.local disk2

View File

@ -0,0 +1,17 @@
#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,dateTime:RFC3339,long,string,string,string,string
#partition,false,false,false,false,false,false,false,false,false,true
#default,_result,,,,,,,,,
,result,table,_start,_stop,_time,_value,_field,_measurement,host,name
,,0,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:26Z,15204688,io_time,diskio,host.local,disk0
,,0,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:36Z,15204894,io_time,diskio,host.local,disk0
,,0,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:46Z,15205102,io_time,diskio,host.local,disk0
,,0,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:56Z,15205226,io_time,diskio,host.local,disk0
,,0,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:54:06Z,15205499,io_time,diskio,host.local,disk0
,,0,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:54:16Z,15205755,io_time,diskio,host.local,disk0
,,1,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:26Z,648,io_time,diskio,host.local,disk2
,,1,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:36Z,648,io_time,diskio,host.local,disk2
,,1,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:46Z,648,io_time,diskio,host.local,disk2
,,1,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:56Z,648,io_time,diskio,host.local,disk2
,,1,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:54:06Z,648,io_time,diskio,host.local,disk2
,,1,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:54:16Z,648,io_time,diskio,host.local,disk2
1 #datatype string long dateTime:RFC3339 dateTime:RFC3339 dateTime:RFC3339 long string string string string
2 #partition false false false false false false false false false true
3 #default _result
4 result table _start _stop _time _value _field _measurement host name
5 0 2018-05-22T19:53:24.421470485Z 2018-05-22T19:54:24.421470485Z 2018-05-22T19:53:26Z 15204688 io_time diskio host.local disk0
6 0 2018-05-22T19:53:24.421470485Z 2018-05-22T19:54:24.421470485Z 2018-05-22T19:53:36Z 15204894 io_time diskio host.local disk0
7 0 2018-05-22T19:53:24.421470485Z 2018-05-22T19:54:24.421470485Z 2018-05-22T19:53:46Z 15205102 io_time diskio host.local disk0
8 0 2018-05-22T19:53:24.421470485Z 2018-05-22T19:54:24.421470485Z 2018-05-22T19:53:56Z 15205226 io_time diskio host.local disk0
9 0 2018-05-22T19:53:24.421470485Z 2018-05-22T19:54:24.421470485Z 2018-05-22T19:54:06Z 15205499 io_time diskio host.local disk0
10 0 2018-05-22T19:53:24.421470485Z 2018-05-22T19:54:24.421470485Z 2018-05-22T19:54:16Z 15205755 io_time diskio host.local disk0
11 1 2018-05-22T19:53:24.421470485Z 2018-05-22T19:54:24.421470485Z 2018-05-22T19:53:26Z 648 io_time diskio host.local disk2
12 1 2018-05-22T19:53:24.421470485Z 2018-05-22T19:54:24.421470485Z 2018-05-22T19:53:36Z 648 io_time diskio host.local disk2
13 1 2018-05-22T19:53:24.421470485Z 2018-05-22T19:54:24.421470485Z 2018-05-22T19:53:46Z 648 io_time diskio host.local disk2
14 1 2018-05-22T19:53:24.421470485Z 2018-05-22T19:54:24.421470485Z 2018-05-22T19:53:56Z 648 io_time diskio host.local disk2
15 1 2018-05-22T19:53:24.421470485Z 2018-05-22T19:54:24.421470485Z 2018-05-22T19:54:06Z 648 io_time diskio host.local disk2
16 1 2018-05-22T19:53:24.421470485Z 2018-05-22T19:54:24.421470485Z 2018-05-22T19:54:16Z 648 io_time diskio host.local disk2

View File

@ -0,0 +1,6 @@
from(db:"testdb")
|> range(start: 2018-05-23T13:09:22.885021542Z)
|> group(by: ["name"])
|> group()
|> map( mergeKey:false, fn: (r) => {_measurement:r._measurement,io_time:r._value,time: r._time})
|> yield(name:"0")

View File

@ -0,0 +1,16 @@
#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,dateTime:RFC3339,long,string,string,string,string
#partition,false,false,false,false,false,false,true,true,true,true
#default,_result,,,,,,,,,
,result,table,_start,_stop,_time,_value,_field,_measurement,host,name
,,1,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:26Z,15204688,io_time,diskio,host.local,disk0
,,1,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:36Z,15204894,io_time,diskio,host.local,disk0
,,1,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:46Z,15205102,io_time,diskio,host.local,disk0
,,1,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:56Z,15205226,io_time,diskio,host.local,disk0
,,1,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:54:06Z,15205499,io_time,diskio,host.local,disk0
,,1,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:54:16Z,15205755,io_time,diskio,host.local,disk0
,,10,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:26Z,648,io_time,diskio,host.local,disk2
,,10,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:36Z,648,io_time,diskio,host.local,disk2
,,10,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:46Z,648,io_time,diskio,host.local,disk2
,,10,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:56Z,648,io_time,diskio,host.local,disk2
,,10,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:54:06Z,648,io_time,diskio,host.local,disk2
,,10,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:54:16Z,648,io_time,diskio,host.local,disk2
1 #datatype string long dateTime:RFC3339 dateTime:RFC3339 dateTime:RFC3339 long string string string string
2 #partition false false false false false false true true true true
3 #default _result
4 result table _start _stop _time _value _field _measurement host name
5 1 2018-05-22T19:53:24.421470485Z 2018-05-22T19:54:24.421470485Z 2018-05-22T19:53:26Z 15204688 io_time diskio host.local disk0
6 1 2018-05-22T19:53:24.421470485Z 2018-05-22T19:54:24.421470485Z 2018-05-22T19:53:36Z 15204894 io_time diskio host.local disk0
7 1 2018-05-22T19:53:24.421470485Z 2018-05-22T19:54:24.421470485Z 2018-05-22T19:53:46Z 15205102 io_time diskio host.local disk0
8 1 2018-05-22T19:53:24.421470485Z 2018-05-22T19:54:24.421470485Z 2018-05-22T19:53:56Z 15205226 io_time diskio host.local disk0
9 1 2018-05-22T19:53:24.421470485Z 2018-05-22T19:54:24.421470485Z 2018-05-22T19:54:06Z 15205499 io_time diskio host.local disk0
10 1 2018-05-22T19:53:24.421470485Z 2018-05-22T19:54:24.421470485Z 2018-05-22T19:54:16Z 15205755 io_time diskio host.local disk0
11 10 2018-05-22T19:53:24.421470485Z 2018-05-22T19:54:24.421470485Z 2018-05-22T19:53:26Z 648 io_time diskio host.local disk2
12 10 2018-05-22T19:53:24.421470485Z 2018-05-22T19:54:24.421470485Z 2018-05-22T19:53:36Z 648 io_time diskio host.local disk2
13 10 2018-05-22T19:53:24.421470485Z 2018-05-22T19:54:24.421470485Z 2018-05-22T19:53:46Z 648 io_time diskio host.local disk2
14 10 2018-05-22T19:53:24.421470485Z 2018-05-22T19:54:24.421470485Z 2018-05-22T19:53:56Z 648 io_time diskio host.local disk2
15 10 2018-05-22T19:53:24.421470485Z 2018-05-22T19:54:24.421470485Z 2018-05-22T19:54:06Z 648 io_time diskio host.local disk2
16 10 2018-05-22T19:53:24.421470485Z 2018-05-22T19:54:24.421470485Z 2018-05-22T19:54:16Z 648 io_time diskio host.local disk2

View File

@ -0,0 +1 @@
select io_time from testdb..diskio group by "name"

View File

@ -0,0 +1,17 @@
#datatype,string,long,string,long,dateTime:RFC3339
#partition,false,false,false,false,false
#default,0,,,,
,result,table,_measurement,io_time,time
,,0,diskio,15204688,2018-05-22T19:53:26Z
,,0,diskio,15204894,2018-05-22T19:53:36Z
,,0,diskio,15205102,2018-05-22T19:53:46Z
,,0,diskio,15205226,2018-05-22T19:53:56Z
,,0,diskio,15205499,2018-05-22T19:54:06Z
,,0,diskio,15205755,2018-05-22T19:54:16Z
,,0,diskio,648,2018-05-22T19:53:26Z
,,0,diskio,648,2018-05-22T19:53:36Z
,,0,diskio,648,2018-05-22T19:53:46Z
,,0,diskio,648,2018-05-22T19:53:56Z
,,0,diskio,648,2018-05-22T19:54:06Z
,,0,diskio,648,2018-05-22T19:54:16Z
1 #datatype string long string long dateTime:RFC3339
2 #partition false false false false false
3 #default 0
4 result table _measurement io_time time
5 0 diskio 15204688 2018-05-22T19:53:26Z
6 0 diskio 15204894 2018-05-22T19:53:36Z
7 0 diskio 15205102 2018-05-22T19:53:46Z
8 0 diskio 15205226 2018-05-22T19:53:56Z
9 0 diskio 15205499 2018-05-22T19:54:06Z
10 0 diskio 15205755 2018-05-22T19:54:16Z
11 0 diskio 648 2018-05-22T19:53:26Z
12 0 diskio 648 2018-05-22T19:53:36Z
13 0 diskio 648 2018-05-22T19:53:46Z
14 0 diskio 648 2018-05-22T19:53:56Z
15 0 diskio 648 2018-05-22T19:54:06Z
16 0 diskio 648 2018-05-22T19:54:16Z

View File

@ -1,3 +1,5 @@
from(db:"testdb")
|> range(start: 2018-05-23T13:09:22.885021542Z)
|> range(start: 2018-05-21T13:09:22.885021542Z)
|> filter(fn: (r) => r._measurement == "swap")
|> map(mergeKey:false, fn: (r) => {_measurement:r._measurement, time: r._time, used_percent:r._value})
|> yield(name:"0")

View File

@ -0,0 +1 @@
select used_percent from testdb..swap

View File

@ -1,32 +1,17 @@
#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,dateTime:RFC3339,double,string,string,string
#partition,false,false,false,false,false,false,true,true,true
#default,_result,0,,,,,load1,system,host.local
,result,table,_start,_stop,_time,_value,_field,_measurement,host
#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,dateTime:RFC3339,double,string,string,string
#partition,false,false,false,false,false,false,true,true,true
#default,_result,1,,,,,load15,system,host.local
,result,table,_start,_stop,_time,_value,_field,_measurement,host
#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,dateTime:RFC3339,double,string,string,string
#partition,false,false,false,false,false,false,true,true,true
#default,_result,2,,,,,load5,system,host.local
,result,table,_start,_stop,_time,_value,_field,_measurement,host
#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,dateTime:RFC3339,double,string,string,string
#partition,false,false,false,false,false,false,true,true,true
#default,_result,,,,,,,,
,result,table,_start,_stop,_time,_value,_field,_measurement,host
,,3,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:26Z,82.9833984375,used_percent,swap,host.local
,,3,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:36Z,82.598876953125,used_percent,swap,host.local
,,3,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:46Z,82.598876953125,used_percent,swap,host.local
,,3,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:56Z,82.598876953125,used_percent,swap,host.local
,,3,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:54:06Z,82.598876953125,used_percent,swap,host.local
,,3,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:54:16Z,82.6416015625,used_percent,swap,host.local
,,3,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:26Z,2.9833984375,used_percent,swap,host1.local
,,3,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:36Z,2.598876953125,used_percent,swap,host1.local
,,3,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:46Z,2.598876953125,used_percent,swap,host1.local
,,3,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:56Z,2.598876953125,used_percent,swap,host1.local
,,3,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:54:06Z,2.598876953125,used_percent,swap,host1.local
,,3,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:54:16Z,2.6416015625,used_percent,swap,host1.local
#datatype,string,long,string,dateTime:RFC3339,double
#partition,false,false,true,false,false
#default,0,,,,
,result,table,_measurement,time,used_percent
,,0,swap,2018-05-22T19:53:26Z,82.9833984375
,,0,swap,2018-05-22T19:53:36Z,82.598876953125
,,0,swap,2018-05-22T19:53:46Z,82.598876953125
,,0,swap,2018-05-22T19:53:56Z,82.598876953125
,,0,swap,2018-05-22T19:54:06Z,82.598876953125
,,0,swap,2018-05-22T19:54:16Z,82.6416015625
,,0,swap,2018-05-22T19:53:26Z,2.9833984375
,,0,swap,2018-05-22T19:53:36Z,2.598876953125
,,0,swap,2018-05-22T19:53:46Z,2.598876953125
,,0,swap,2018-05-22T19:53:56Z,2.598876953125
,,0,swap,2018-05-22T19:54:06Z,2.598876953125
,,0,swap,2018-05-22T19:54:16Z,2.6416015625

1 #datatype string long string dateTime:RFC3339 dateTime:RFC3339 dateTime:RFC3339 double string string
2 #partition false false true false false false false true true
3 #default _result 0 0 load1 system host.local
4 result table _field _measurement _stop _start time _time _value used_percent _measurement host
5 #datatype string long 0 string swap dateTime:RFC3339 dateTime:RFC3339 2018-05-22T19:53:26Z dateTime:RFC3339 double 82.9833984375 string string
6 #partition false false 0 true swap false false 2018-05-22T19:53:36Z false false 82.598876953125 true true
7 #default _result 1 0 load15 swap 2018-05-22T19:53:46Z 82.598876953125 system host.local
8 result table 0 _field swap _stop _start 2018-05-22T19:53:56Z _time _value 82.598876953125 _measurement host
9 #datatype string long 0 string swap dateTime:RFC3339 dateTime:RFC3339 2018-05-22T19:54:06Z dateTime:RFC3339 double 82.598876953125 string string
10 #partition false false 0 true swap false false 2018-05-22T19:54:16Z false false 82.6416015625 true true
11 #default _result 2 0 load5 swap 2018-05-22T19:53:26Z 2.9833984375 system host.local
12 result table 0 _field swap _stop _start 2018-05-22T19:53:36Z _time _value 2.598876953125 _measurement host
13 #datatype string long 0 string swap dateTime:RFC3339 dateTime:RFC3339 2018-05-22T19:53:46Z dateTime:RFC3339 double 2.598876953125 string string
14 #partition false false 0 true swap false false 2018-05-22T19:53:56Z false false 2.598876953125 true true
15 #default _result 0 swap 2018-05-22T19:54:06Z 2.598876953125
16 result table 0 _field swap _stop _start 2018-05-22T19:54:16Z _time _value 2.6416015625 _measurement host
3 used_percent 2018-05-22T19:54:24.421470485Z 2018-05-22T19:53:24.421470485Z 2018-05-22T19:53:26Z 82.9833984375 swap host.local
3 used_percent 2018-05-22T19:54:24.421470485Z 2018-05-22T19:53:24.421470485Z 2018-05-22T19:53:36Z 82.598876953125 swap host.local
3 used_percent 2018-05-22T19:54:24.421470485Z 2018-05-22T19:53:24.421470485Z 2018-05-22T19:53:46Z 82.598876953125 swap host.local
3 used_percent 2018-05-22T19:54:24.421470485Z 2018-05-22T19:53:24.421470485Z 2018-05-22T19:53:56Z 82.598876953125 swap host.local
3 used_percent 2018-05-22T19:54:24.421470485Z 2018-05-22T19:53:24.421470485Z 2018-05-22T19:54:06Z 82.598876953125 swap host.local
3 used_percent 2018-05-22T19:54:24.421470485Z 2018-05-22T19:53:24.421470485Z 2018-05-22T19:54:16Z 82.6416015625 swap host.local
3 used_percent 2018-05-22T19:54:24.421470485Z 2018-05-22T19:53:24.421470485Z 2018-05-22T19:53:26Z 2.9833984375 swap host1.local
3 used_percent 2018-05-22T19:54:24.421470485Z 2018-05-22T19:53:24.421470485Z 2018-05-22T19:53:36Z 2.598876953125 swap host1.local
3 used_percent 2018-05-22T19:54:24.421470485Z 2018-05-22T19:53:24.421470485Z 2018-05-22T19:53:46Z 2.598876953125 swap host1.local
3 used_percent 2018-05-22T19:54:24.421470485Z 2018-05-22T19:53:24.421470485Z 2018-05-22T19:53:56Z 2.598876953125 swap host1.local
3 used_percent 2018-05-22T19:54:24.421470485Z 2018-05-22T19:53:24.421470485Z 2018-05-22T19:54:06Z 2.598876953125 swap host1.local
3 used_percent 2018-05-22T19:54:24.421470485Z 2018-05-22T19:53:24.421470485Z 2018-05-22T19:54:16Z 2.6416015625 swap host1.local
17

View File

@ -1,3 +1,5 @@
from(db:"testdb")
|> range(start: 2018-05-23T13:09:22.885021542Z)
|> filter(fn: (r) => r._measurement == "system" AND r._field == "load1")
|> map(mergeKey:false, fn: (r) => {_measurement:r._measurement, load1:r._value, time: r._time})
|> yield(name:"0")

View File

@ -0,0 +1 @@
select load1 from testdb..system

View File

@ -1,26 +1,11 @@
#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,dateTime:RFC3339,double,string,string,string
#partition,false,false,false,false,false,false,true,true,true
#default,_result,,,,,,,,
,result,table,_start,_stop,_time,_value,_field,_measurement,host
,,0,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:26Z,1.83,load1,system,host.local
,,0,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:36Z,1.7,load1,system,host.local
,,0,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:46Z,1.74,load1,system,host.local
,,0,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:56Z,1.63,load1,system,host.local
,,0,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:54:06Z,1.91,load1,system,host.local
,,0,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:54:16Z,1.84,load1,system,host.local
#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,dateTime:RFC3339,double,string,string,string
#partition,false,false,false,false,false,false,true,true,true
#default,_result,1,,,,,load15,system,host.local
,result,table,_start,_stop,_time,_value,_field,_measurement,host
#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,dateTime:RFC3339,double,string,string,string
#partition,false,false,false,false,false,false,true,true,true
#default,_result,2,,,,,load5,system,host.local
,result,table,_start,_stop,_time,_value,_field,_measurement,host
#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,dateTime:RFC3339,double,string,string,string
#partition,false,false,false,false,false,false,true,true,true
#default,_result,3,,,,,used_percent,swap,host.local
,result,table,_start,_stop,_time,_value,_field,_measurement,host
#datatype,string,long,string,double,dateTime:RFC3339
#partition,false,false,true,false,false
#default,0,,,,
,result,table,_measurement,load1,time
,,0,system,1.83,2018-05-22T19:53:26Z
,,0,system,1.7,2018-05-22T19:53:36Z
,,0,system,1.74,2018-05-22T19:53:46Z
,,0,system,1.63,2018-05-22T19:53:56Z
,,0,system,1.91,2018-05-22T19:54:06Z
,,0,system,1.84,2018-05-22T19:54:16Z

1 #datatype string long string dateTime:RFC3339 double dateTime:RFC3339 dateTime:RFC3339 string string
2 #partition false false true false false false false true true
3 #default _result 0
4 result table _field _measurement _stop _value load1 _time _start time _measurement host
5 0 load1 system 2018-05-22T19:54:24.421470485Z 1.83 2018-05-22T19:53:26Z 2018-05-22T19:53:24.421470485Z 2018-05-22T19:53:26Z system host.local
6 0 load1 system 2018-05-22T19:54:24.421470485Z 1.7 2018-05-22T19:53:36Z 2018-05-22T19:53:24.421470485Z 2018-05-22T19:53:36Z system host.local
7 0 load1 system 2018-05-22T19:54:24.421470485Z 1.74 2018-05-22T19:53:46Z 2018-05-22T19:53:24.421470485Z 2018-05-22T19:53:46Z system host.local
8 0 load1 system 2018-05-22T19:54:24.421470485Z 1.63 2018-05-22T19:53:56Z 2018-05-22T19:53:24.421470485Z 2018-05-22T19:53:56Z system host.local
9 0 load1 system 2018-05-22T19:54:24.421470485Z 1.91 2018-05-22T19:54:06Z 2018-05-22T19:53:24.421470485Z 2018-05-22T19:54:06Z system host.local
10 0 load1 system 2018-05-22T19:54:24.421470485Z 1.84 2018-05-22T19:54:16Z 2018-05-22T19:53:24.421470485Z 2018-05-22T19:54:16Z system host.local
#datatype string long string dateTime:RFC3339 double dateTime:RFC3339 dateTime:RFC3339 string string
#partition false false true false false false false true true
#default _result 1 load15 system host.local
result table _field _stop _value _time _start _measurement host
#datatype string long string dateTime:RFC3339 double dateTime:RFC3339 dateTime:RFC3339 string string
#partition false false true false false false false true true
#default _result 2 load5 system host.local
result table _field _stop _value _time _start _measurement host
#datatype string long string dateTime:RFC3339 double dateTime:RFC3339 dateTime:RFC3339 string string
#partition false false true false false false false true true
#default _result 3 used_percent swap host.local
result table _field _stop _value _time _start _measurement host
11

View File

@ -1,6 +1,5 @@
from(db:"test")
|> range(start:-5m)
|> group(by:["_measurement"])
|> max(column: "_value")
|> map(fn: (r) => {time:r._time, _measurement:r._measurement, max:r._value}, mergeKey:false)
|> yield(name:"0")

View File

@ -3,3 +3,4 @@
#default,0,,,,
,result,table,_measurement,max,time
,,0,m1,43,2018-04-17T00:00:01Z

1 #datatype string long string double dateTime:RFC3339
3 #default 0
4 result table _measurement max time
5 0 m1 43 2018-04-17T00:00:01Z
6

View File

@ -0,0 +1,3 @@
from(db:"testdb")
|> range(start: 2018-05-23T13:09:22.885021542Z)
|> sort(cols:["_value"])

View File

@ -0,0 +1,34 @@
#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,dateTime:RFC3339,double,string,string,string
#partition,false,false,false,false,false,false,true,true,true
#default,_result,,,,,,,,
,result,table,_start,_stop,_time,_value,_field,_measurement,host
,,161,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:26Z,82.9833984375,used_percent,swap,host.local
,,161,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:36Z,82.598876953125,used_percent,swap,host.local
,,161,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:46Z,82.598876953125,used_percent,swap,host.local
,,161,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:56Z,82.598876953125,used_percent,swap,host.local
,,161,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:54:06Z,82.598876953125,used_percent,swap,host.local
,,161,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:54:16Z,82.6416015625,used_percent,swap,host.local
,,161,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:26Z,2.9833984375,used_percent,swap,host1.local
,,161,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:36Z,2.598876953125,used_percent,swap,host1.local
,,161,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:46Z,2.598876953125,used_percent,swap,host1.local
,,161,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:56Z,2.598876953125,used_percent,swap,host1.local
,,161,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:54:06Z,2.598876953125,used_percent,swap,host1.local
,,161,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:54:16Z,2.6416015625,used_percent,swap,host1.local
,,162,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:26Z,1.83,load1,system,host.local
,,162,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:36Z,1.7,load1,system,host.local
,,162,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:46Z,1.74,load1,system,host.local
,,162,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:56Z,1.63,load1,system,host.local
,,162,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:54:06Z,1.91,load1,system,host.local
,,162,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:54:16Z,1.84,load1,system,host.local
,,163,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:26Z,1.98,load15,system,host.local
,,163,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:36Z,1.97,load15,system,host.local
,,163,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:46Z,1.97,load15,system,host.local
,,163,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:56Z,1.96,load15,system,host.local
,,163,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:54:06Z,1.98,load15,system,host.local
,,163,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:54:16Z,1.97,load15,system,host.local
,,164,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:26Z,1.95,load5,system,host.local
,,164,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:36Z,1.92,load5,system,host.local
,,164,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:46Z,1.92,load5,system,host.local
,,164,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:56Z,1.89,load5,system,host.local
,,164,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:54:06Z,1.94,load5,system,host.local
,,164,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:54:16Z,1.93,load5,system,host.local
1 #datatype string long dateTime:RFC3339 dateTime:RFC3339 dateTime:RFC3339 double string string string
2 #partition false false false false false false true true true
3 #default _result
4 result table _start _stop _time _value _field _measurement host
5 161 2018-05-22T19:53:24.421470485Z 2018-05-22T19:54:24.421470485Z 2018-05-22T19:53:26Z 82.9833984375 used_percent swap host.local
6 161 2018-05-22T19:53:24.421470485Z 2018-05-22T19:54:24.421470485Z 2018-05-22T19:53:36Z 82.598876953125 used_percent swap host.local
7 161 2018-05-22T19:53:24.421470485Z 2018-05-22T19:54:24.421470485Z 2018-05-22T19:53:46Z 82.598876953125 used_percent swap host.local
8 161 2018-05-22T19:53:24.421470485Z 2018-05-22T19:54:24.421470485Z 2018-05-22T19:53:56Z 82.598876953125 used_percent swap host.local
9 161 2018-05-22T19:53:24.421470485Z 2018-05-22T19:54:24.421470485Z 2018-05-22T19:54:06Z 82.598876953125 used_percent swap host.local
10 161 2018-05-22T19:53:24.421470485Z 2018-05-22T19:54:24.421470485Z 2018-05-22T19:54:16Z 82.6416015625 used_percent swap host.local
11 161 2018-05-22T19:53:24.421470485Z 2018-05-22T19:54:24.421470485Z 2018-05-22T19:53:26Z 2.9833984375 used_percent swap host1.local
12 161 2018-05-22T19:53:24.421470485Z 2018-05-22T19:54:24.421470485Z 2018-05-22T19:53:36Z 2.598876953125 used_percent swap host1.local
13 161 2018-05-22T19:53:24.421470485Z 2018-05-22T19:54:24.421470485Z 2018-05-22T19:53:46Z 2.598876953125 used_percent swap host1.local
14 161 2018-05-22T19:53:24.421470485Z 2018-05-22T19:54:24.421470485Z 2018-05-22T19:53:56Z 2.598876953125 used_percent swap host1.local
15 161 2018-05-22T19:53:24.421470485Z 2018-05-22T19:54:24.421470485Z 2018-05-22T19:54:06Z 2.598876953125 used_percent swap host1.local
16 161 2018-05-22T19:53:24.421470485Z 2018-05-22T19:54:24.421470485Z 2018-05-22T19:54:16Z 2.6416015625 used_percent swap host1.local
17 162 2018-05-22T19:53:24.421470485Z 2018-05-22T19:54:24.421470485Z 2018-05-22T19:53:26Z 1.83 load1 system host.local
18 162 2018-05-22T19:53:24.421470485Z 2018-05-22T19:54:24.421470485Z 2018-05-22T19:53:36Z 1.7 load1 system host.local
19 162 2018-05-22T19:53:24.421470485Z 2018-05-22T19:54:24.421470485Z 2018-05-22T19:53:46Z 1.74 load1 system host.local
20 162 2018-05-22T19:53:24.421470485Z 2018-05-22T19:54:24.421470485Z 2018-05-22T19:53:56Z 1.63 load1 system host.local
21 162 2018-05-22T19:53:24.421470485Z 2018-05-22T19:54:24.421470485Z 2018-05-22T19:54:06Z 1.91 load1 system host.local
22 162 2018-05-22T19:53:24.421470485Z 2018-05-22T19:54:24.421470485Z 2018-05-22T19:54:16Z 1.84 load1 system host.local
23 163 2018-05-22T19:53:24.421470485Z 2018-05-22T19:54:24.421470485Z 2018-05-22T19:53:26Z 1.98 load15 system host.local
24 163 2018-05-22T19:53:24.421470485Z 2018-05-22T19:54:24.421470485Z 2018-05-22T19:53:36Z 1.97 load15 system host.local
25 163 2018-05-22T19:53:24.421470485Z 2018-05-22T19:54:24.421470485Z 2018-05-22T19:53:46Z 1.97 load15 system host.local
26 163 2018-05-22T19:53:24.421470485Z 2018-05-22T19:54:24.421470485Z 2018-05-22T19:53:56Z 1.96 load15 system host.local
27 163 2018-05-22T19:53:24.421470485Z 2018-05-22T19:54:24.421470485Z 2018-05-22T19:54:06Z 1.98 load15 system host.local
28 163 2018-05-22T19:53:24.421470485Z 2018-05-22T19:54:24.421470485Z 2018-05-22T19:54:16Z 1.97 load15 system host.local
29 164 2018-05-22T19:53:24.421470485Z 2018-05-22T19:54:24.421470485Z 2018-05-22T19:53:26Z 1.95 load5 system host.local
30 164 2018-05-22T19:53:24.421470485Z 2018-05-22T19:54:24.421470485Z 2018-05-22T19:53:36Z 1.92 load5 system host.local
31 164 2018-05-22T19:53:24.421470485Z 2018-05-22T19:54:24.421470485Z 2018-05-22T19:53:46Z 1.92 load5 system host.local
32 164 2018-05-22T19:53:24.421470485Z 2018-05-22T19:54:24.421470485Z 2018-05-22T19:53:56Z 1.89 load5 system host.local
33 164 2018-05-22T19:53:24.421470485Z 2018-05-22T19:54:24.421470485Z 2018-05-22T19:54:06Z 1.94 load5 system host.local
34 164 2018-05-22T19:53:24.421470485Z 2018-05-22T19:54:24.421470485Z 2018-05-22T19:54:16Z 1.93 load5 system host.local

View File

@ -0,0 +1,35 @@
#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,dateTime:RFC3339,double,string,string,string
#partition,false,false,false,false,false,false,true,true,true
#default,_result,,,,,,,,
,result,table,_start,_stop,_time,_value,_field,_measurement,host
,,0,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:56Z,1.63,load1,system,host.local
,,0,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:36Z,1.7,load1,system,host.local
,,0,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:46Z,1.74,load1,system,host.local
,,0,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:26Z,1.83,load1,system,host.local
,,0,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:54:16Z,1.84,load1,system,host.local
,,0,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:54:06Z,1.91,load1,system,host.local
,,1,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:56Z,1.96,load15,system,host.local
,,1,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:36Z,1.97,load15,system,host.local
,,1,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:46Z,1.97,load15,system,host.local
,,1,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:54:16Z,1.97,load15,system,host.local
,,1,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:26Z,1.98,load15,system,host.local
,,1,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:54:06Z,1.98,load15,system,host.local
,,2,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:56Z,1.89,load5,system,host.local
,,2,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:36Z,1.92,load5,system,host.local
,,2,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:46Z,1.92,load5,system,host.local
,,2,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:54:16Z,1.93,load5,system,host.local
,,2,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:54:06Z,1.94,load5,system,host.local
,,2,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:26Z,1.95,load5,system,host.local
,,3,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:36Z,2.598876953125,used_percent,swap,host1.local
,,3,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:46Z,2.598876953125,used_percent,swap,host1.local
,,3,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:56Z,2.598876953125,used_percent,swap,host1.local
,,3,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:54:06Z,2.598876953125,used_percent,swap,host1.local
,,3,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:54:16Z,2.6416015625,used_percent,swap,host1.local
,,3,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:26Z,2.9833984375,used_percent,swap,host1.local
,,3,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:36Z,82.598876953125,used_percent,swap,host.local
,,3,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:46Z,82.598876953125,used_percent,swap,host.local
,,3,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:56Z,82.598876953125,used_percent,swap,host.local
,,3,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:54:06Z,82.598876953125,used_percent,swap,host.local
,,3,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:54:16Z,82.6416015625,used_percent,swap,host.local
,,3,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:26Z,82.9833984375,used_percent,swap,host.local
1 #datatype string long dateTime:RFC3339 dateTime:RFC3339 dateTime:RFC3339 double string string string
2 #partition false false false false false false true true true
3 #default _result
4 result table _start _stop _time _value _field _measurement host
5 0 2018-05-22T19:53:24.421470485Z 2018-05-22T19:54:24.421470485Z 2018-05-22T19:53:56Z 1.63 load1 system host.local
6 0 2018-05-22T19:53:24.421470485Z 2018-05-22T19:54:24.421470485Z 2018-05-22T19:53:36Z 1.7 load1 system host.local
7 0 2018-05-22T19:53:24.421470485Z 2018-05-22T19:54:24.421470485Z 2018-05-22T19:53:46Z 1.74 load1 system host.local
8 0 2018-05-22T19:53:24.421470485Z 2018-05-22T19:54:24.421470485Z 2018-05-22T19:53:26Z 1.83 load1 system host.local
9 0 2018-05-22T19:53:24.421470485Z 2018-05-22T19:54:24.421470485Z 2018-05-22T19:54:16Z 1.84 load1 system host.local
10 0 2018-05-22T19:53:24.421470485Z 2018-05-22T19:54:24.421470485Z 2018-05-22T19:54:06Z 1.91 load1 system host.local
11 1 2018-05-22T19:53:24.421470485Z 2018-05-22T19:54:24.421470485Z 2018-05-22T19:53:56Z 1.96 load15 system host.local
12 1 2018-05-22T19:53:24.421470485Z 2018-05-22T19:54:24.421470485Z 2018-05-22T19:53:36Z 1.97 load15 system host.local
13 1 2018-05-22T19:53:24.421470485Z 2018-05-22T19:54:24.421470485Z 2018-05-22T19:53:46Z 1.97 load15 system host.local
14 1 2018-05-22T19:53:24.421470485Z 2018-05-22T19:54:24.421470485Z 2018-05-22T19:54:16Z 1.97 load15 system host.local
15 1 2018-05-22T19:53:24.421470485Z 2018-05-22T19:54:24.421470485Z 2018-05-22T19:53:26Z 1.98 load15 system host.local
16 1 2018-05-22T19:53:24.421470485Z 2018-05-22T19:54:24.421470485Z 2018-05-22T19:54:06Z 1.98 load15 system host.local
17 2 2018-05-22T19:53:24.421470485Z 2018-05-22T19:54:24.421470485Z 2018-05-22T19:53:56Z 1.89 load5 system host.local
18 2 2018-05-22T19:53:24.421470485Z 2018-05-22T19:54:24.421470485Z 2018-05-22T19:53:36Z 1.92 load5 system host.local
19 2 2018-05-22T19:53:24.421470485Z 2018-05-22T19:54:24.421470485Z 2018-05-22T19:53:46Z 1.92 load5 system host.local
20 2 2018-05-22T19:53:24.421470485Z 2018-05-22T19:54:24.421470485Z 2018-05-22T19:54:16Z 1.93 load5 system host.local
21 2 2018-05-22T19:53:24.421470485Z 2018-05-22T19:54:24.421470485Z 2018-05-22T19:54:06Z 1.94 load5 system host.local
22 2 2018-05-22T19:53:24.421470485Z 2018-05-22T19:54:24.421470485Z 2018-05-22T19:53:26Z 1.95 load5 system host.local
23 3 2018-05-22T19:53:24.421470485Z 2018-05-22T19:54:24.421470485Z 2018-05-22T19:53:36Z 2.598876953125 used_percent swap host1.local
24 3 2018-05-22T19:53:24.421470485Z 2018-05-22T19:54:24.421470485Z 2018-05-22T19:53:46Z 2.598876953125 used_percent swap host1.local
25 3 2018-05-22T19:53:24.421470485Z 2018-05-22T19:54:24.421470485Z 2018-05-22T19:53:56Z 2.598876953125 used_percent swap host1.local
26 3 2018-05-22T19:53:24.421470485Z 2018-05-22T19:54:24.421470485Z 2018-05-22T19:54:06Z 2.598876953125 used_percent swap host1.local
27 3 2018-05-22T19:53:24.421470485Z 2018-05-22T19:54:24.421470485Z 2018-05-22T19:54:16Z 2.6416015625 used_percent swap host1.local
28 3 2018-05-22T19:53:24.421470485Z 2018-05-22T19:54:24.421470485Z 2018-05-22T19:53:26Z 2.9833984375 used_percent swap host1.local
29 3 2018-05-22T19:53:24.421470485Z 2018-05-22T19:54:24.421470485Z 2018-05-22T19:53:36Z 82.598876953125 used_percent swap host.local
30 3 2018-05-22T19:53:24.421470485Z 2018-05-22T19:54:24.421470485Z 2018-05-22T19:53:46Z 82.598876953125 used_percent swap host.local
31 3 2018-05-22T19:53:24.421470485Z 2018-05-22T19:54:24.421470485Z 2018-05-22T19:53:56Z 82.598876953125 used_percent swap host.local
32 3 2018-05-22T19:53:24.421470485Z 2018-05-22T19:54:24.421470485Z 2018-05-22T19:54:06Z 82.598876953125 used_percent swap host.local
33 3 2018-05-22T19:53:24.421470485Z 2018-05-22T19:54:24.421470485Z 2018-05-22T19:54:16Z 82.6416015625 used_percent swap host.local
34 3 2018-05-22T19:53:24.421470485Z 2018-05-22T19:54:24.421470485Z 2018-05-22T19:53:26Z 82.9833984375 used_percent swap host.local

View File

@ -0,0 +1,5 @@
from(db:"testdb")
|> range(start: 2018-05-22T00:00:00Z)
|> window(every:1s)
|> map(mergeKey:false, fn: (r) => {_measurement:r._measurement, io_time:r._value,time: r._time})
|> yield(name:"0")

View File

@ -0,0 +1,16 @@
#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,dateTime:RFC3339,long,string,string,string,string
#partition,false,false,false,false,false,false,true,true,true,true
#default,_result,,,,,,,,,
,result,table,_start,_stop,_time,_value,_field,_measurement,host,name
,,1,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:26Z,15204688,io_time,diskio,host.local,disk0
,,1,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:36Z,15204894,io_time,diskio,host.local,disk0
,,1,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:46Z,15205102,io_time,diskio,host.local,disk0
,,1,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:56Z,15205226,io_time,diskio,host.local,disk0
,,1,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:54:06Z,15205499,io_time,diskio,host.local,disk0
,,1,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:54:16Z,15205755,io_time,diskio,host.local,disk0
,,10,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:26Z,648,io_time,diskio,host.local,disk2
,,10,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:36Z,648,io_time,diskio,host.local,disk2
,,10,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:46Z,648,io_time,diskio,host.local,disk2
,,10,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:56Z,648,io_time,diskio,host.local,disk2
,,10,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:54:06Z,648,io_time,diskio,host.local,disk2
,,10,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:54:16Z,648,io_time,diskio,host.local,disk2
1 #datatype string long dateTime:RFC3339 dateTime:RFC3339 dateTime:RFC3339 long string string string string
2 #partition false false false false false false true true true true
3 #default _result
4 result table _start _stop _time _value _field _measurement host name
5 1 2018-05-22T19:53:24.421470485Z 2018-05-22T19:54:24.421470485Z 2018-05-22T19:53:26Z 15204688 io_time diskio host.local disk0
6 1 2018-05-22T19:53:24.421470485Z 2018-05-22T19:54:24.421470485Z 2018-05-22T19:53:36Z 15204894 io_time diskio host.local disk0
7 1 2018-05-22T19:53:24.421470485Z 2018-05-22T19:54:24.421470485Z 2018-05-22T19:53:46Z 15205102 io_time diskio host.local disk0
8 1 2018-05-22T19:53:24.421470485Z 2018-05-22T19:54:24.421470485Z 2018-05-22T19:53:56Z 15205226 io_time diskio host.local disk0
9 1 2018-05-22T19:53:24.421470485Z 2018-05-22T19:54:24.421470485Z 2018-05-22T19:54:06Z 15205499 io_time diskio host.local disk0
10 1 2018-05-22T19:53:24.421470485Z 2018-05-22T19:54:24.421470485Z 2018-05-22T19:54:16Z 15205755 io_time diskio host.local disk0
11 10 2018-05-22T19:53:24.421470485Z 2018-05-22T19:54:24.421470485Z 2018-05-22T19:53:26Z 648 io_time diskio host.local disk2
12 10 2018-05-22T19:53:24.421470485Z 2018-05-22T19:54:24.421470485Z 2018-05-22T19:53:36Z 648 io_time diskio host.local disk2
13 10 2018-05-22T19:53:24.421470485Z 2018-05-22T19:54:24.421470485Z 2018-05-22T19:53:46Z 648 io_time diskio host.local disk2
14 10 2018-05-22T19:53:24.421470485Z 2018-05-22T19:54:24.421470485Z 2018-05-22T19:53:56Z 648 io_time diskio host.local disk2
15 10 2018-05-22T19:53:24.421470485Z 2018-05-22T19:54:24.421470485Z 2018-05-22T19:54:06Z 648 io_time diskio host.local disk2
16 10 2018-05-22T19:53:24.421470485Z 2018-05-22T19:54:24.421470485Z 2018-05-22T19:54:16Z 648 io_time diskio host.local disk2

View File

@ -0,0 +1 @@
select io_time from testdb..diskio group by time(1s)

View File

@ -0,0 +1,17 @@
#datatype,string,long,string,long,dateTime:RFC3339
#partition,false,false,true,false,false
#default,0,,,,
,result,table,_measurement,io_time,time
,,0,diskio,15204688,2018-05-22T19:53:26Z
,,0,diskio,648,2018-05-22T19:53:26Z
,,0,diskio,15204894,2018-05-22T19:53:36Z
,,0,diskio,648,2018-05-22T19:53:36Z
,,0,diskio,15205102,2018-05-22T19:53:46Z
,,0,diskio,648,2018-05-22T19:53:46Z
,,0,diskio,15205226,2018-05-22T19:53:56Z
,,0,diskio,648,2018-05-22T19:53:56Z
,,0,diskio,15205499,2018-05-22T19:54:06Z
,,0,diskio,648,2018-05-22T19:54:06Z
,,0,diskio,15205755,2018-05-22T19:54:16Z
,,0,diskio,648,2018-05-22T19:54:16Z
1 #datatype string long string long dateTime:RFC3339
2 #partition false false true false false
3 #default 0
4 result table _measurement io_time time
5 0 diskio 15204688 2018-05-22T19:53:26Z
6 0 diskio 648 2018-05-22T19:53:26Z
7 0 diskio 15204894 2018-05-22T19:53:36Z
8 0 diskio 648 2018-05-22T19:53:36Z
9 0 diskio 15205102 2018-05-22T19:53:46Z
10 0 diskio 648 2018-05-22T19:53:46Z
11 0 diskio 15205226 2018-05-22T19:53:56Z
12 0 diskio 648 2018-05-22T19:53:56Z
13 0 diskio 15205499 2018-05-22T19:54:06Z
14 0 diskio 648 2018-05-22T19:54:06Z
15 0 diskio 15205755 2018-05-22T19:54:16Z
16 0 diskio 648 2018-05-22T19:54:16Z

View File

@ -0,0 +1,6 @@
from(db:"testdb")
|> range(start: 2018-05-23T13:09:22.885021542Z)
|> window(every:1s)
|> group(by: ["name"])
|> mean()
|> group()

View File

@ -0,0 +1,16 @@
#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,dateTime:RFC3339,long,string,string,string,string
#partition,false,false,false,false,false,false,true,true,true,true
#default,_result,,,,,,,,,
,result,table,_start,_stop,_time,_value,_field,_measurement,host,name
,,1,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:26Z,15204688,io_time,diskio,host.local,disk0
,,1,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:36Z,15204894,io_time,diskio,host.local,disk0
,,1,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:46Z,15205102,io_time,diskio,host.local,disk0
,,1,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:56Z,15205226,io_time,diskio,host.local,disk0
,,1,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:54:06Z,15205499,io_time,diskio,host.local,disk0
,,1,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:54:16Z,15205755,io_time,diskio,host.local,disk0
,,10,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:26Z,648,io_time,diskio,host.local,disk2
,,10,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:36Z,648,io_time,diskio,host.local,disk2
,,10,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:46Z,648,io_time,diskio,host.local,disk2
,,10,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:56Z,648,io_time,diskio,host.local,disk2
,,10,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:54:06Z,648,io_time,diskio,host.local,disk2
,,10,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:54:16Z,648,io_time,diskio,host.local,disk2
1 #datatype string long dateTime:RFC3339 dateTime:RFC3339 dateTime:RFC3339 long string string string string
2 #partition false false false false false false true true true true
3 #default _result
4 result table _start _stop _time _value _field _measurement host name
5 1 2018-05-22T19:53:24.421470485Z 2018-05-22T19:54:24.421470485Z 2018-05-22T19:53:26Z 15204688 io_time diskio host.local disk0
6 1 2018-05-22T19:53:24.421470485Z 2018-05-22T19:54:24.421470485Z 2018-05-22T19:53:36Z 15204894 io_time diskio host.local disk0
7 1 2018-05-22T19:53:24.421470485Z 2018-05-22T19:54:24.421470485Z 2018-05-22T19:53:46Z 15205102 io_time diskio host.local disk0
8 1 2018-05-22T19:53:24.421470485Z 2018-05-22T19:54:24.421470485Z 2018-05-22T19:53:56Z 15205226 io_time diskio host.local disk0
9 1 2018-05-22T19:53:24.421470485Z 2018-05-22T19:54:24.421470485Z 2018-05-22T19:54:06Z 15205499 io_time diskio host.local disk0
10 1 2018-05-22T19:53:24.421470485Z 2018-05-22T19:54:24.421470485Z 2018-05-22T19:54:16Z 15205755 io_time diskio host.local disk0
11 10 2018-05-22T19:53:24.421470485Z 2018-05-22T19:54:24.421470485Z 2018-05-22T19:53:26Z 648 io_time diskio host.local disk2
12 10 2018-05-22T19:53:24.421470485Z 2018-05-22T19:54:24.421470485Z 2018-05-22T19:53:36Z 648 io_time diskio host.local disk2
13 10 2018-05-22T19:53:24.421470485Z 2018-05-22T19:54:24.421470485Z 2018-05-22T19:53:46Z 648 io_time diskio host.local disk2
14 10 2018-05-22T19:53:24.421470485Z 2018-05-22T19:54:24.421470485Z 2018-05-22T19:53:56Z 648 io_time diskio host.local disk2
15 10 2018-05-22T19:53:24.421470485Z 2018-05-22T19:54:24.421470485Z 2018-05-22T19:54:06Z 648 io_time diskio host.local disk2
16 10 2018-05-22T19:53:24.421470485Z 2018-05-22T19:54:24.421470485Z 2018-05-22T19:54:16Z 648 io_time diskio host.local disk2

View File

@ -0,0 +1 @@
select mean(io_time) from testdb..diskio group by time(1s)

View File

@ -0,0 +1 @@