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 messagepull/10616/head
parent
6b2cf4e666
commit
070649527c
|
@ -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 {
|
||||
|
|
|
@ -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)
|
||||
}
|
||||
}
|
|
@ -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) {
|
||||
|
|
|
@ -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))
|
||||
|
|
|
@ -0,0 +1,3 @@
|
|||
from(db:"testdb")
|
||||
|> range(start: 2018-05-23T13:09:22.885021542Z)
|
||||
|> derivative(unit:100ms)
|
|
@ -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,/
|
|
|
@ -0,0 +1 @@
|
|||
select derivative("used_percent") FROM testdb..disk
|
|
@ -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,/
|
||||
|
|
|
@ -0,0 +1 @@
|
|||
select io_time from testdb..diskio where "name" = "disk0"
|
|
@ -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
|
||||
|
||||
|
|
|
|
@ -0,0 +1,3 @@
|
|||
from(db:"testdb")
|
||||
|> range(start: 2018-05-23T13:09:22.885021542Z)
|
||||
|> group(by: ["name"])
|
|
@ -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
|
|
|
@ -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
|
||||
|
|
|
@ -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")
|
|
@ -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
|
|
|
@ -0,0 +1 @@
|
|||
select io_time from testdb..diskio group by "name"
|
|
@ -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,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")
|
|
@ -0,0 +1 @@
|
|||
select used_percent from testdb..swap
|
|
@ -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,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")
|
|
@ -0,0 +1 @@
|
|||
select load1 from testdb..system
|
|
@ -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,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")
|
||||
|
|
|
@ -3,3 +3,4 @@
|
|||
#default,0,,,,
|
||||
,result,table,_measurement,max,time
|
||||
,,0,m1,43,2018-04-17T00:00:01Z
|
||||
|
||||
|
|
|
|
@ -0,0 +1,3 @@
|
|||
from(db:"testdb")
|
||||
|> range(start: 2018-05-23T13:09:22.885021542Z)
|
||||
|> sort(cols:["_value"])
|
|
@ -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
|
|
|
@ -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
|
||||
|
|
|
@ -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")
|
|
@ -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
|
|
|
@ -0,0 +1 @@
|
|||
select io_time from testdb..diskio group by time(1s)
|
|
@ -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
|
||||
|
|
|
@ -0,0 +1,6 @@
|
|||
from(db:"testdb")
|
||||
|> range(start: 2018-05-23T13:09:22.885021542Z)
|
||||
|> window(every:1s)
|
||||
|> group(by: ["name"])
|
||||
|> mean()
|
||||
|> group()
|
|
@ -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
|
|
|
@ -0,0 +1 @@
|
|||
select mean(io_time) from testdb..diskio group by time(1s)
|
|
@ -0,0 +1 @@
|
|||
|
|
Loading…
Reference in New Issue