Merge pull request #2251 from influxdata/feat/fluxendtoend
feat(query/functions/tests): end to end testing is configured to run …pull/10616/head
commit
1f97798b7c
|
@ -25,7 +25,6 @@ import (
|
|||
influxlogger "github.com/influxdata/platform/logger"
|
||||
"github.com/influxdata/platform/nats"
|
||||
"github.com/influxdata/platform/query"
|
||||
_ "github.com/influxdata/platform/query/builtin"
|
||||
pcontrol "github.com/influxdata/platform/query/control"
|
||||
"github.com/influxdata/platform/snowflake"
|
||||
"github.com/influxdata/platform/source"
|
||||
|
|
2
go.mod
2
go.mod
|
@ -79,7 +79,7 @@ require (
|
|||
github.com/hashicorp/vault-plugin-secrets-kv v0.0.0-20181106190520-2236f141171e // indirect
|
||||
github.com/hashicorp/yamux v0.0.0-20181012175058-2f1d1f20f75d // indirect
|
||||
github.com/imdario/mergo v0.3.6 // indirect
|
||||
github.com/influxdata/flux v0.12.1-0.20190104180637-9c4371ac8c93
|
||||
github.com/influxdata/flux v0.12.1-0.20190104211048-b5bb2f7775aa
|
||||
github.com/influxdata/influxql v0.0.0-20180925231337-1cbfca8e56b6
|
||||
github.com/influxdata/usage-client v0.0.0-20160829180054-6d3895376368
|
||||
github.com/jefferai/jsonx v0.0.0-20160721235117-9cc31c3135ee // indirect
|
||||
|
|
4
go.sum
4
go.sum
|
@ -240,8 +240,8 @@ github.com/imdario/mergo v0.3.6 h1:xTNEAn+kxVO7dTZGu0CegyqKZmoWFI0rF8UxjlB2d28=
|
|||
github.com/imdario/mergo v0.3.6/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA=
|
||||
github.com/inconshreveable/mousetrap v1.0.0 h1:Z8tu5sraLXCXIcARxBp/8cbvlwVa7Z1NHg9XEKhtSvM=
|
||||
github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8=
|
||||
github.com/influxdata/flux v0.12.1-0.20190104180637-9c4371ac8c93 h1:HYb4I2jH8OrHAZj4bjPLNz9rSSHnWUdphCUNlD75wqo=
|
||||
github.com/influxdata/flux v0.12.1-0.20190104180637-9c4371ac8c93/go.mod h1:81jeDcHVn1rN5uj9aQ81S72Q8ol8If7N0zM0G8TnxTE=
|
||||
github.com/influxdata/flux v0.12.1-0.20190104211048-b5bb2f7775aa h1:lRE3B8y2tS8zu6BjoqHLYNG7FE4mR5vpNiwaB5KSALE=
|
||||
github.com/influxdata/flux v0.12.1-0.20190104211048-b5bb2f7775aa/go.mod h1:81jeDcHVn1rN5uj9aQ81S72Q8ol8If7N0zM0G8TnxTE=
|
||||
github.com/influxdata/goreleaser v0.86.2-0.20181010170531-0fd209ba67f5/go.mod h1:aVuBpDAT5VtjtUxzvBt8HOd0buzvvk7OX3H2iaviixg=
|
||||
github.com/influxdata/influxql v0.0.0-20180925231337-1cbfca8e56b6 h1:CFx+pP90q/qg3spoiZjf8donE4WpAdjeJfPOcoNqkWo=
|
||||
github.com/influxdata/influxql v0.0.0-20180925231337-1cbfca8e56b6/go.mod h1:KpVI7okXjK6PRi3Z5B+mtKZli+R1DnZgb3N+tzevNgo=
|
||||
|
|
|
@ -299,6 +299,9 @@ func (s *FluxService) Query(ctx context.Context, w io.Writer, r *query.ProxyRequ
|
|||
}
|
||||
defer resp.Body.Close()
|
||||
|
||||
if err := CheckError(resp, true); err != nil {
|
||||
return 0, err
|
||||
}
|
||||
if err := CheckError(resp); err != nil {
|
||||
return 0, err
|
||||
}
|
||||
|
|
|
@ -9,6 +9,7 @@ import (
|
|||
_ "github.com/influxdata/flux/functions" // Import the built-in functions
|
||||
_ "github.com/influxdata/flux/functions/inputs"
|
||||
_ "github.com/influxdata/flux/functions/outputs"
|
||||
_ "github.com/influxdata/flux/functions/tests"
|
||||
_ "github.com/influxdata/flux/functions/transformations"
|
||||
_ "github.com/influxdata/flux/options" // Import the built-in options
|
||||
_ "github.com/influxdata/platform/query/functions" // Import the built-in functions
|
||||
|
|
|
@ -179,6 +179,7 @@ func (o *ToOpSpec) BucketsAccessed() (readBuckets, writeBuckets []platform.Bucke
|
|||
|
||||
// ToProcedureSpec is the procedure spec for the `to` flux function.
|
||||
type ToProcedureSpec struct {
|
||||
plan.DefaultCost
|
||||
Spec *ToOpSpec
|
||||
}
|
||||
|
||||
|
|
|
@ -0,0 +1,311 @@
|
|||
package tests_test
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"context"
|
||||
"fmt"
|
||||
"github.com/influxdata/flux"
|
||||
"github.com/influxdata/flux/lang"
|
||||
"github.com/influxdata/platform"
|
||||
"github.com/influxdata/platform/bolt"
|
||||
"github.com/influxdata/platform/cmd/influxd/launcher"
|
||||
"github.com/influxdata/platform/http"
|
||||
"github.com/influxdata/platform/query"
|
||||
"io"
|
||||
"io/ioutil"
|
||||
nethttp "net/http"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"strings"
|
||||
"testing"
|
||||
|
||||
_ "github.com/influxdata/flux/functions" // Import the built-in functions
|
||||
_ "github.com/influxdata/flux/functions/inputs"
|
||||
_ "github.com/influxdata/flux/functions/outputs"
|
||||
_ "github.com/influxdata/flux/functions/tests"
|
||||
_ "github.com/influxdata/flux/functions/transformations"
|
||||
_ "github.com/influxdata/flux/options" // Import the built-in options
|
||||
_ "github.com/influxdata/platform/query/functions" // Import the built-in functions
|
||||
_ "github.com/influxdata/platform/query/functions/inputs"
|
||||
_ "github.com/influxdata/platform/query/functions/outputs"
|
||||
_ "github.com/influxdata/platform/query/options" // Import the built-in options
|
||||
)
|
||||
|
||||
// Default context.
|
||||
var ctx = context.Background()
|
||||
|
||||
type AssertionError interface {
|
||||
Assertion() bool
|
||||
}
|
||||
|
||||
func init() {
|
||||
flux.RegisterBuiltIn("loadTest", loadTestBuiltin)
|
||||
flux.FinalizeBuiltIns()
|
||||
}
|
||||
|
||||
var loadTestBuiltin = `
|
||||
// loadData is a function that's referenced in all the transformation tests.
|
||||
// it's registered here so that we can register a different loadData function for
|
||||
// each platform/binary.
|
||||
testLoadStorageHelper = (csv, bucket, org) => {fromCSV(csv: csv) |> to(bucket: bucket, org: org) return from(bucket: bucket) }
|
||||
testLoadMem = (csv) => fromCSV(csv: csv)
|
||||
`
|
||||
|
||||
var skipTests = map[string]string{
|
||||
// TODO(adam) determine the reason for these test failures.
|
||||
"cov": "Reason TBD",
|
||||
"covariance": "Reason TBD",
|
||||
"cumulative_sum": "Reason TBD",
|
||||
"cumulative_sum_default": "Reason TBD",
|
||||
"cumulative_sum_noop": "Reason TBD",
|
||||
"difference_panic": "Reason TBD",
|
||||
"filter_by_regex_function": "Reason TBD",
|
||||
"first": "Reason TBD",
|
||||
"group_by_irregular": "Reason TBD",
|
||||
"highestAverage": "Reason TBD",
|
||||
"highestMax": "Reason TBD",
|
||||
"histogram": "Reason TBD",
|
||||
"histogram_normalize": "Reason TBD",
|
||||
"histogram_quantile": "Reason TBD",
|
||||
"join": "Reason TBD",
|
||||
"join_across_measurements": "Reason TBD",
|
||||
"key_values": "Reason TBD",
|
||||
"key_values_host_name": "Reason TBD",
|
||||
"last": "Reason TBD",
|
||||
"lowestAverage": "Reason TBD",
|
||||
"max": "Reason TBD",
|
||||
"meta_query_fields": "Reason TBD",
|
||||
"meta_query_keys": "Reason TBD",
|
||||
"meta_query_measurements": "Reason TBD",
|
||||
"min": "Reason TBD",
|
||||
"multiple_range": "Reason TBD",
|
||||
"sample": "Reason TBD",
|
||||
"selector_preserve_time": "Reason TBD",
|
||||
"shift": "Reason TBD",
|
||||
"shift_negative_duration": "Reason TBD",
|
||||
"show_all_tag_keys": "Reason TBD",
|
||||
"sort": "Reason TBD",
|
||||
"task_per_line": "Reason TBD",
|
||||
"top": "Reason TBD",
|
||||
"union": "Reason TBD",
|
||||
"union_heterogeneous": "Reason TBD",
|
||||
"unique": "Reason TBD",
|
||||
|
||||
"string_max": "error: invalid use of function: *functions.MaxSelector has no implementation for type string (https://github.com/influxdata/platform/issues/224)",
|
||||
"null_as_value": "null not supported as value in influxql (https://github.com/influxdata/platform/issues/353)",
|
||||
"string_interp": "string interpolation not working as expected in flux (https://github.com/influxdata/platform/issues/404)",
|
||||
"to": "to functions are not supported in the testing framework (https://github.com/influxdata/flux/issues/77)",
|
||||
"covariance_missing_column_1": "need to support known errors in new test framework (https://github.com/influxdata/flux/issues/536)",
|
||||
"covariance_missing_column_2": "need to support known errors in new test framework (https://github.com/influxdata/flux/issues/536)",
|
||||
"drop_before_rename": "need to support known errors in new test framework (https://github.com/influxdata/flux/issues/536)",
|
||||
"drop_referenced": "need to support known errors in new test framework (https://github.com/influxdata/flux/issues/536)",
|
||||
"yield": "yield requires special test case (https://github.com/influxdata/flux/issues/535)",
|
||||
}
|
||||
|
||||
func withEachFluxFile(t testing.TB, fn func(filename string)) {
|
||||
dir, err := os.Getwd()
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
path := filepath.Join(dir, "testdata")
|
||||
os.Chdir(path)
|
||||
|
||||
fluxFiles, err := filepath.Glob("*.flux")
|
||||
if err != nil {
|
||||
t.Fatalf("error searching for Flux files: %s", err)
|
||||
}
|
||||
|
||||
for _, fluxFile := range fluxFiles {
|
||||
fn(fluxFile)
|
||||
}
|
||||
}
|
||||
|
||||
func Test_QueryEndToEnd(t *testing.T) {
|
||||
t.Skip("skipping platform end to end tests due to execution sync issues (https://github.com/influxdata/flux/issues/613)")
|
||||
l := RunMainOrFail(t, ctx)
|
||||
l.SetupOrFail(t)
|
||||
defer l.ShutdownOrFail(t, ctx)
|
||||
|
||||
withEachFluxFile(t, func(filename string) {
|
||||
testName := filename[:len(filename)-len(".flux")]
|
||||
reason, skip := skipTests[testName]
|
||||
t.Run(filename, func(t *testing.T) {
|
||||
if skip {
|
||||
t.Skip(reason)
|
||||
}
|
||||
if qs, err := ioutil.ReadFile(filename); err != nil {
|
||||
return
|
||||
} else {
|
||||
// Query server to ensure write persists.
|
||||
|
||||
b := &platform.Bucket{
|
||||
Organization: "ORG",
|
||||
Name: testName,
|
||||
RetentionPeriod: 0,
|
||||
}
|
||||
|
||||
s := l.BucketService()
|
||||
if err := s.CreateBucket(context.Background(), b); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
testLoadStorageQuery := fmt.Sprintf("testLoadStorage = (csv) => testLoadStorageHelper(csv:csv, bucket: \"%s\", org: \"%s\") \n", b.Name, b.Organization)
|
||||
|
||||
qy := testLoadStorageQuery + string(qs)
|
||||
t.Log(qy)
|
||||
|
||||
req := &query.Request{
|
||||
OrganizationID: l.Org.ID,
|
||||
Compiler: lang.FluxCompiler{Query: qy},
|
||||
}
|
||||
if _, err := l.FluxService().Query(ctx, req); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
// quirk: our execution engine doesn't guarantee the order of execution for disconnected DAGS
|
||||
// so that our function-with-side effects call to `to` may run _after_ the test instead of before.
|
||||
// running twice makes sure that `to` happens at least once before we run the test.
|
||||
r, err := l.FluxService().Query(ctx, req)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
for r.More() {
|
||||
v := r.Next()
|
||||
err := v.Tables().Do(func(tbl flux.Table) error {
|
||||
return nil
|
||||
})
|
||||
if err != nil {
|
||||
if assertionErr, ok := err.(AssertionError); ok {
|
||||
t.Error(assertionErr)
|
||||
} else {
|
||||
t.Fatal(err)
|
||||
}
|
||||
}
|
||||
}
|
||||
if err := r.Err(); err != nil {
|
||||
if assertionErr, ok := err.(AssertionError); ok {
|
||||
t.Error(assertionErr)
|
||||
} else {
|
||||
t.Fatal(err)
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
// Launcher is a test wrapper for main.Launcher.
|
||||
type Launcher struct {
|
||||
*launcher.Launcher
|
||||
|
||||
// Root temporary directory for all data.
|
||||
Path string
|
||||
|
||||
// Initialized after calling the Setup() helper.
|
||||
User *platform.User
|
||||
Org *platform.Organization
|
||||
Bucket *platform.Bucket
|
||||
Auth *platform.Authorization
|
||||
|
||||
// Standard in/out/err buffers.
|
||||
Stdin bytes.Buffer
|
||||
Stdout bytes.Buffer
|
||||
Stderr bytes.Buffer
|
||||
}
|
||||
|
||||
// NewLauncher returns a new instance of Launcher.
|
||||
func NewLauncher() *Launcher {
|
||||
l := &Launcher{Launcher: launcher.NewLauncher()}
|
||||
l.Launcher.Stdin = &l.Stdin
|
||||
l.Launcher.Stdout = &l.Stdout
|
||||
l.Launcher.Stderr = &l.Stderr
|
||||
if testing.Verbose() {
|
||||
l.Launcher.Stdout = io.MultiWriter(l.Launcher.Stdout, os.Stdout)
|
||||
l.Launcher.Stderr = io.MultiWriter(l.Launcher.Stderr, os.Stderr)
|
||||
}
|
||||
|
||||
path, err := ioutil.TempDir("", "")
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
l.Path = path
|
||||
return l
|
||||
}
|
||||
|
||||
// RunMainOrFail initializes and starts the server.
|
||||
func RunMainOrFail(tb testing.TB, ctx context.Context, args ...string) *Launcher {
|
||||
tb.Helper()
|
||||
l := NewLauncher()
|
||||
if err := l.Run(ctx, args...); err != nil {
|
||||
tb.Fatal(err)
|
||||
}
|
||||
return l
|
||||
}
|
||||
|
||||
// Run executes the program with additional arguments to set paths and ports.
|
||||
func (l *Launcher) Run(ctx context.Context, args ...string) error {
|
||||
args = append(args, "--bolt-path", filepath.Join(l.Path, "influxd.bolt"))
|
||||
args = append(args, "--engine-path", filepath.Join(l.Path, "engine"))
|
||||
args = append(args, "--nats-path", filepath.Join(l.Path, "nats"))
|
||||
args = append(args, "--http-bind-address", "127.0.0.1:0")
|
||||
args = append(args, "--log-level", "debug")
|
||||
return l.Launcher.Run(ctx, args...)
|
||||
}
|
||||
|
||||
// Shutdown stops the program and cleans up temporary paths.
|
||||
func (l *Launcher) Shutdown(ctx context.Context) error {
|
||||
l.Cancel()
|
||||
l.Launcher.Shutdown(ctx)
|
||||
return os.RemoveAll(l.Path)
|
||||
}
|
||||
|
||||
// ShutdownOrFail stops the program and cleans up temporary paths. Fail on error.
|
||||
func (l *Launcher) ShutdownOrFail(tb testing.TB, ctx context.Context) {
|
||||
tb.Helper()
|
||||
if err := l.Shutdown(ctx); err != nil {
|
||||
tb.Fatal(err)
|
||||
}
|
||||
}
|
||||
|
||||
// SetupOrFail creates a new user, bucket, org, and auth token. Fail on error.
|
||||
func (l *Launcher) SetupOrFail(tb testing.TB) {
|
||||
svc := &http.SetupService{Addr: l.URL()}
|
||||
results, err := svc.Generate(ctx, &platform.OnboardingRequest{
|
||||
User: "USER",
|
||||
Password: "PASSWORD",
|
||||
Org: "ORG",
|
||||
Bucket: "BUCKET",
|
||||
})
|
||||
if err != nil {
|
||||
tb.Fatal(err)
|
||||
}
|
||||
|
||||
l.User = results.User
|
||||
l.Org = results.Org
|
||||
l.Bucket = results.Bucket
|
||||
l.Auth = results.Auth
|
||||
}
|
||||
|
||||
func (l *Launcher) FluxService() *http.FluxQueryService {
|
||||
return &http.FluxQueryService{Addr: l.URL(), Token: l.Auth.Token}
|
||||
}
|
||||
|
||||
func (l *Launcher) BucketService() *http.BucketService {
|
||||
return &http.BucketService{
|
||||
Addr: l.URL(),
|
||||
Token: l.Auth.Token,
|
||||
OpPrefix: bolt.OpPrefix,
|
||||
}
|
||||
}
|
||||
|
||||
// MustNewHTTPRequest returns a new nethttp.Request with base URL and auth attached. Fail on error.
|
||||
func (l *Launcher) MustNewHTTPRequest(method, rawurl, body string) *nethttp.Request {
|
||||
req, err := nethttp.NewRequest(method, l.URL()+rawurl, strings.NewReader(body))
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
req.Header.Set("Authorization", "Token "+l.Auth.Token)
|
||||
return req
|
||||
}
|
|
@ -0,0 +1,39 @@
|
|||
inData = "
|
||||
#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,dateTime:RFC3339,double,string,string,string,string,string,string
|
||||
#group,false,false,true,true,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-22T00:00:00Z,2018-05-22T00:01:00Z,2018-05-22T00:00:00Z,30,used_percent,disk,disk1s1,apfs,host.local,/
|
||||
,,0,2018-05-22T00:00:00Z,2018-05-22T00:01:00Z,2018-05-22T00:00:10Z,30,used_percent,disk,disk1s1,apfs,host.local,/
|
||||
,,0,2018-05-22T00:00:00Z,2018-05-22T00:01:00Z,2018-05-22T00:00:20Z,30,used_percent,disk,disk1s1,apfs,host.local,/
|
||||
,,0,2018-05-22T00:00:00Z,2018-05-22T00:01:00Z,2018-05-22T00:00:30Z,40,used_percent,disk,disk1s1,apfs,host.local,/
|
||||
,,0,2018-05-22T00:00:00Z,2018-05-22T00:01:00Z,2018-05-22T00:00:40Z,40,used_percent,disk,disk1s1,apfs,host.local,/
|
||||
,,0,2018-05-22T00:00:00Z,2018-05-22T00:01:00Z,2018-05-22T00:00:50Z,40,used_percent,disk,disk1s1,apfs,host.local,/
|
||||
,,1,2018-05-22T00:00:00Z,2018-05-22T00:01:00Z,2018-05-22T00:00:00Z,35,used_percent,disk,disk1s1,apfs,host.local,/tmp
|
||||
,,1,2018-05-22T00:00:00Z,2018-05-22T00:01:00Z,2018-05-22T00:00:10Z,35,used_percent,disk,disk1s1,apfs,host.local,/tmp
|
||||
,,1,2018-05-22T00:00:00Z,2018-05-22T00:01:00Z,2018-05-22T00:00:20Z,35,used_percent,disk,disk1s1,apfs,host.local,/tmp
|
||||
,,1,2018-05-22T00:00:00Z,2018-05-22T00:01:00Z,2018-05-22T00:00:30Z,45,used_percent,disk,disk1s1,apfs,host.local,/tmp
|
||||
,,1,2018-05-22T00:00:00Z,2018-05-22T00:01:00Z,2018-05-22T00:00:40Z,45,used_percent,disk,disk1s1,apfs,host.local,/tmp
|
||||
,,1,2018-05-22T00:00:00Z,2018-05-22T00:01:00Z,2018-05-22T00:00:50Z,45,used_percent,disk,disk1s1,apfs,host.local,/tmp
|
||||
"
|
||||
|
||||
outData = "
|
||||
#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,dateTime:RFC3339,string,string,string,string,string,string,double
|
||||
#group,false,false,true,true,false,true,true,true,true,true,true,false
|
||||
#default,_result,,,,,,,,,,,
|
||||
,result,table,_start,_stop,_time,_field,_measurement,device,fstype,host,path,_value
|
||||
,,0,2018-05-22T00:00:00Z,2018-05-22T00:01:00Z,2018-05-22T00:00:30Z,used_percent,disk,disk1s1,apfs,host.local,/,30
|
||||
,,0,2018-05-22T00:00:00Z,2018-05-22T00:01:00Z,2018-05-22T00:01:00Z,used_percent,disk,disk1s1,apfs,host.local,/,40
|
||||
,,1,2018-05-22T00:00:00Z,2018-05-22T00:01:00Z,2018-05-22T00:00:30Z,used_percent,disk,disk1s1,apfs,host.local,/tmp,35
|
||||
,,1,2018-05-22T00:00:00Z,2018-05-22T00:01:00Z,2018-05-22T00:01:00Z,used_percent,disk,disk1s1,apfs,host.local,/tmp,45
|
||||
"
|
||||
|
||||
aggregate_window = (table=<-) =>
|
||||
table
|
||||
|> range(start: 2018-05-22T00:00:00Z, stop:2018-05-22T00:01:00Z)
|
||||
|> aggregateWindow(every:30s,fn:mean)
|
||||
|
||||
testingTest(name: "aggregate_window",
|
||||
input: testLoadStorage(csv: inData),
|
||||
want: testLoadMem(csv: outData),
|
||||
test: aggregate_window)
|
|
@ -0,0 +1,79 @@
|
|||
option now = () => 2018-12-18T21:00:00Z
|
||||
|
||||
inData = "
|
||||
#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,string,string,dateTime:RFC3339,unsignedLong
|
||||
#group,false,false,false,false,true,true,false,false
|
||||
#default,,,,,,,,
|
||||
,result,table,_start,_stop,_measurement,_field,_time,_value
|
||||
,,0,2018-12-18T20:52:33Z,2018-12-18T20:53:23Z,iZquGj,Au1iY,2018-12-18T20:52:33Z,7
|
||||
,,0,2018-12-18T20:52:33Z,2018-12-18T20:53:23Z,iZquGj,Au1iY,2018-12-18T20:52:43Z,38
|
||||
,,0,2018-12-18T20:52:33Z,2018-12-18T20:53:23Z,iZquGj,Au1iY,2018-12-18T20:52:53Z,79
|
||||
,,0,2018-12-18T20:52:33Z,2018-12-18T20:53:23Z,iZquGj,Au1iY,2018-12-18T20:53:03Z,51
|
||||
,,0,2018-12-18T20:52:33Z,2018-12-18T20:53:23Z,iZquGj,Au1iY,2018-12-18T20:53:13Z,94
|
||||
,,0,2018-12-18T20:52:33Z,2018-12-18T20:53:23Z,iZquGj,Au1iY,2018-12-18T20:53:23Z,85
|
||||
|
||||
#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,string,string,dateTime:RFC3339,string
|
||||
#group,false,false,false,false,true,true,false,false
|
||||
#default,,,,,,,,
|
||||
,result,table,_start,_stop,_measurement,_field,_time,_value
|
||||
,,1,2018-12-18T20:52:33Z,2018-12-18T20:53:23Z,iZquGj,HSbYC,2018-12-18T20:52:33Z,A9JcEV
|
||||
,,1,2018-12-18T20:52:33Z,2018-12-18T20:53:23Z,iZquGj,HSbYC,2018-12-18T20:52:43Z,iNI7Bqy
|
||||
,,1,2018-12-18T20:52:33Z,2018-12-18T20:53:23Z,iZquGj,HSbYC,2018-12-18T20:52:53Z,TFIS
|
||||
,,1,2018-12-18T20:52:33Z,2018-12-18T20:53:23Z,iZquGj,HSbYC,2018-12-18T20:53:03Z,q6h9yU
|
||||
,,1,2018-12-18T20:52:33Z,2018-12-18T20:53:23Z,iZquGj,HSbYC,2018-12-18T20:53:13Z,X8Ks
|
||||
,,1,2018-12-18T20:52:33Z,2018-12-18T20:53:23Z,iZquGj,HSbYC,2018-12-18T20:53:23Z,aOMgU
|
||||
|
||||
#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,string,string,dateTime:RFC3339,boolean
|
||||
#group,false,false,false,false,true,true,false,false
|
||||
#default,,,,,,,,
|
||||
,result,table,_start,_stop,_measurement,_field,_time,_value
|
||||
,,2,2018-12-18T20:52:33Z,2018-12-18T20:53:23Z,iZquGj,J1u,2018-12-18T20:52:33Z,false
|
||||
,,2,2018-12-18T20:52:33Z,2018-12-18T20:53:23Z,iZquGj,J1u,2018-12-18T20:52:43Z,false
|
||||
,,2,2018-12-18T20:52:33Z,2018-12-18T20:53:23Z,iZquGj,J1u,2018-12-18T20:52:53Z,true
|
||||
,,2,2018-12-18T20:52:33Z,2018-12-18T20:53:23Z,iZquGj,J1u,2018-12-18T20:53:03Z,true
|
||||
,,2,2018-12-18T20:52:33Z,2018-12-18T20:53:23Z,iZquGj,J1u,2018-12-18T20:53:13Z,true
|
||||
,,2,2018-12-18T20:52:33Z,2018-12-18T20:53:23Z,iZquGj,J1u,2018-12-18T20:53:23Z,false
|
||||
|
||||
#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,string,string,dateTime:RFC3339,double
|
||||
#group,false,false,false,false,true,true,false,false
|
||||
#default,,,,,,,,
|
||||
,result,table,_start,_stop,_measurement,_field,_time,_value
|
||||
,,3,2018-12-18T20:52:33Z,2018-12-18T20:53:23Z,iZquGj,ei77f8T,2018-12-18T20:52:33Z,-61.68790887989735
|
||||
,,3,2018-12-18T20:52:33Z,2018-12-18T20:53:23Z,iZquGj,ei77f8T,2018-12-18T20:52:43Z,-6.3173755351186465
|
||||
,,3,2018-12-18T20:52:33Z,2018-12-18T20:53:23Z,iZquGj,ei77f8T,2018-12-18T20:52:53Z,-26.049728557657513
|
||||
,,3,2018-12-18T20:52:33Z,2018-12-18T20:53:23Z,iZquGj,ei77f8T,2018-12-18T20:53:03Z,114.285955884979
|
||||
,,3,2018-12-18T20:52:33Z,2018-12-18T20:53:23Z,iZquGj,ei77f8T,2018-12-18T20:53:13Z,16.140262630578995
|
||||
,,3,2018-12-18T20:52:33Z,2018-12-18T20:53:23Z,iZquGj,ei77f8T,2018-12-18T20:53:23Z,29.50336437998469
|
||||
|
||||
#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,string,string,dateTime:RFC3339,long
|
||||
#group,false,false,false,false,true,true,false,false
|
||||
#default,,,,,,,,
|
||||
,result,table,_start,_stop,_measurement,_field,_time,_value
|
||||
,,4,2018-12-18T20:52:33Z,2018-12-18T20:53:23Z,iZquGj,ucyoZ,2018-12-18T20:52:33Z,-66
|
||||
,,4,2018-12-18T20:52:33Z,2018-12-18T20:53:23Z,iZquGj,ucyoZ,2018-12-18T20:52:43Z,59
|
||||
,,4,2018-12-18T20:52:33Z,2018-12-18T20:53:23Z,iZquGj,ucyoZ,2018-12-18T20:52:53Z,64
|
||||
,,4,2018-12-18T20:52:33Z,2018-12-18T20:53:23Z,iZquGj,ucyoZ,2018-12-18T20:53:03Z,84
|
||||
,,4,2018-12-18T20:52:33Z,2018-12-18T20:53:23Z,iZquGj,ucyoZ,2018-12-18T20:53:13Z,68
|
||||
,,4,2018-12-18T20:52:33Z,2018-12-18T20:53:23Z,iZquGj,ucyoZ,2018-12-18T20:53:23Z,49
|
||||
"
|
||||
|
||||
outData = "
|
||||
#datatype,string,long,string,string,long
|
||||
#group,false,false,true,true,false
|
||||
#default,_result,,,,
|
||||
,result,table,_measurement,_field,_value
|
||||
,,0,iZquGj,Au1iY,6
|
||||
,,1,iZquGj,HSbYC,6
|
||||
,,2,iZquGj,J1u,6
|
||||
,,3,iZquGj,ei77f8T,6
|
||||
,,4,iZquGj,ucyoZ,6
|
||||
"
|
||||
|
||||
t_count = (table=<-) => table
|
||||
|> range(start: -10m)
|
||||
|> count()
|
||||
|
||||
testingTest(name: "count",
|
||||
input: testLoadStorage(csv: inData),
|
||||
want: testLoadMem(csv: outData),
|
||||
test: t_count)
|
|
@ -0,0 +1,50 @@
|
|||
inData = "
|
||||
#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,dateTime:RFC3339,double,string,string
|
||||
#group,false,false,false,false,false,false,true,true
|
||||
#default,_result,,,,,,,
|
||||
,result,table,_start,_stop,_time,_value,_measurement,user
|
||||
,,0,2018-05-22T19:53:00Z,2018-05-22T19:55:00Z,2018-05-22T19:53:26Z,1,RAM,user1
|
||||
,,0,2018-05-22T19:53:00Z,2018-05-22T19:55:00Z,2018-05-22T19:53:36Z,2,RAM,user1
|
||||
,,0,2018-05-22T19:53:00Z,2018-05-22T19:55:00Z,2018-05-22T19:53:46Z,3,RAM,user1
|
||||
,,0,2018-05-22T19:53:00Z,2018-05-22T19:55:00Z,2018-05-22T19:53:56Z,5,RAM,user1
|
||||
,,1,2018-05-22T19:53:00Z,2018-05-22T19:55:00Z,2018-05-22T19:53:26Z,0,CPU,user1
|
||||
,,1,2018-05-22T19:53:00Z,2018-05-22T19:55:00Z,2018-05-22T19:53:36Z,1,CPU,user1
|
||||
,,2,2018-05-22T19:53:00Z,2018-05-22T19:55:00Z,2018-05-22T19:53:26Z,2,RAM,user2
|
||||
,,2,2018-05-22T19:53:00Z,2018-05-22T19:55:00Z,2018-05-22T19:53:36Z,4,RAM,user2
|
||||
,,2,2018-05-22T19:53:00Z,2018-05-22T19:55:00Z,2018-05-22T19:53:46Z,4,RAM,user2
|
||||
,,2,2018-05-22T19:53:00Z,2018-05-22T19:55:00Z,2018-05-22T19:53:56Z,0,RAM,user2
|
||||
,,2,2018-05-22T19:53:00Z,2018-05-22T19:55:00Z,2018-05-22T19:54:06Z,2,RAM,user2
|
||||
,,2,2018-05-22T19:53:00Z,2018-05-22T19:55:00Z,2018-05-22T19:54:16Z,10,RAM,user2
|
||||
,,3,2018-05-22T19:53:00Z,2018-05-22T19:55:00Z,2018-05-22T19:53:26Z,4,CPU,user2
|
||||
,,3,2018-05-22T19:53:00Z,2018-05-22T19:55:00Z,2018-05-22T19:53:36Z,20,CPU,user2
|
||||
,,3,2018-05-22T19:53:00Z,2018-05-22T19:55:00Z,2018-05-22T19:53:46Z,7,CPU,user2
|
||||
,,3,2018-05-22T19:53:00Z,2018-05-22T19:55:00Z,2018-05-22T19:53:56Z,10,CPU,user2
|
||||
"
|
||||
outData = "
|
||||
#datatype,string,long,string,double
|
||||
#group,false,false,true,false
|
||||
#default,_result,,,
|
||||
,result,table,_measurement,_value
|
||||
,,0,CPU,8
|
||||
,,1,RAM,-1.83333333333333333
|
||||
"
|
||||
|
||||
t_cov = () => {
|
||||
left = testLoadStorage(csv: inData)
|
||||
|> range(start:2018-05-22T19:53:00Z, stop:2018-05-22T19:55:00Z)
|
||||
|> drop(columns: ["_start", "_stop"])
|
||||
|> filter(fn: (r) => r.user == "user1")
|
||||
|> group(columns: ["_measurement"])
|
||||
|
||||
right = testLoadStorage(csv: inData)
|
||||
|> range(start:2018-05-22T19:53:00Z, stop:2018-05-22T19:55:00Z)
|
||||
|> drop(columns: ["_start", "_stop"])
|
||||
|> filter(fn: (r) => r.user == "user2")
|
||||
|> group(columns: ["_measurement"])
|
||||
|
||||
got = cov(x:left, y:right, on: ["_time", "_measurement"])
|
||||
want = testLoadStorage(csv: outData)
|
||||
return assertEquals(name: "cov", want: want, got: got)
|
||||
}
|
||||
|
||||
t_cov()
|
|
@ -0,0 +1,32 @@
|
|||
inData = "
|
||||
#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,dateTime:RFC3339,double,double,string
|
||||
#group,false,false,false,false,false,false,false,true
|
||||
#default,_result,,,,,,,
|
||||
,result,table,_start,_stop,_time,x,y,_measurement
|
||||
,,0,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:26Z,1,4,cpu
|
||||
,,0,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:36Z,2,3,cpu
|
||||
,,0,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:46Z,3,2,cpu
|
||||
,,0,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:56Z,4,1,cpu
|
||||
,,1,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:26Z,10,40,mem
|
||||
,,1,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:36Z,20,30,mem
|
||||
,,1,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:46Z,30,20,mem
|
||||
,,1,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:56Z,40,10,mem
|
||||
"
|
||||
outData = "
|
||||
#datatype,string,long,string,double
|
||||
#group,false,false,true,false
|
||||
#default,_result,,,
|
||||
,result,table,_measurement,_value
|
||||
,,0,cpu,-1.6666666666666667
|
||||
,,1,mem,-166.66666666666667
|
||||
"
|
||||
|
||||
t_covariance = (tables=<-) =>
|
||||
tables
|
||||
|> range(start: 2018-05-22T19:53:26Z)
|
||||
|> covariance(columns: ["x", "y"])
|
||||
|
||||
testingTest(name: "t_covariance",
|
||||
input: testLoadStorage(csv: inData),
|
||||
want: testLoadMem(csv: outData),
|
||||
test: t_covariance)
|
|
@ -0,0 +1,29 @@
|
|||
inData = "
|
||||
#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,dateTime:RFC3339,double,string
|
||||
#group,false,false,false,false,false,false,true
|
||||
#default,_result,,,,,,
|
||||
,result,table,_start,_stop,_time,x,_measurement
|
||||
,,0,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:26Z,0,cpu
|
||||
,,0,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:36Z,0,cpu
|
||||
,,0,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:46Z,2,cpu
|
||||
,,0,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:56Z,7,cpu
|
||||
"
|
||||
outData = "
|
||||
#datatype,string,string
|
||||
#group,true,true
|
||||
#default,,
|
||||
,error,reference
|
||||
,specified column does not exist in table: y,
|
||||
"
|
||||
|
||||
covariance_missing_column_1 = (table=<-) =>
|
||||
table
|
||||
|> range(start: 2018-05-22T19:53:26Z)
|
||||
|> covariance(columns: ["x", "r"])
|
||||
|> yield(name: "0")
|
||||
|
||||
|
||||
testingTest(name: "covariance_missing_column_1",
|
||||
input: testLoadStorage(csv: inData),
|
||||
want: testLoadMem(csv: outData),
|
||||
test: covariance_missing_column_1)
|
|
@ -0,0 +1,29 @@
|
|||
inData = "
|
||||
#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,dateTime:RFC3339,double,string
|
||||
#group,false,false,false,false,false,false,true
|
||||
#default,_result,,,,,,
|
||||
,result,table,_start,_stop,_time,y,_measurement
|
||||
,,0,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:26Z,0,cpu
|
||||
,,0,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:36Z,0,cpu
|
||||
,,0,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:46Z,2,cpu
|
||||
,,0,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:56Z,7,cpu
|
||||
"
|
||||
outData = "
|
||||
#datatype,string,string
|
||||
#group,true,true
|
||||
#default,,
|
||||
,error,reference
|
||||
,specified column does not exist in table: x,
|
||||
"
|
||||
|
||||
covariance_missing_column_2 = (table=<-) =>
|
||||
table
|
||||
|> range(start: 2018-05-22T19:53:26Z)
|
||||
|> covariance(columns: ["x", "y"])
|
||||
|> yield(name: "0")
|
||||
|
||||
|
||||
testingTest(name: "covariance_missing_column_2",
|
||||
input: testLoadStorage(csv: inData),
|
||||
want: testLoadMem(csv: outData),
|
||||
test: covariance_missing_column_2)
|
|
@ -0,0 +1,66 @@
|
|||
inData = "
|
||||
#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,dateTime:RFC3339,string,long,long,long
|
||||
#group,false,false,true,true,false,true,false,false,false
|
||||
#default,,,,,,,,,
|
||||
,result,table,_start,_stop,_time,_measurement,v0,v1,v2
|
||||
,,0,2018-05-22T19:53:00Z,2018-05-22T19:54:50Z,2018-05-22T19:53:30Z,_m0,1,10,100
|
||||
,,0,2018-05-22T19:53:00Z,2018-05-22T19:54:50Z,2018-05-22T19:53:40Z,_m0,1,10,100
|
||||
,,0,2018-05-22T19:53:00Z,2018-05-22T19:54:50Z,2018-05-22T19:53:50Z,_m0,1,10,100
|
||||
,,0,2018-05-22T19:53:00Z,2018-05-22T19:54:50Z,2018-05-22T19:53:00Z,_m0,1,10,100
|
||||
,,0,2018-05-22T19:53:00Z,2018-05-22T19:54:50Z,2018-05-22T19:53:10Z,_m0,1,10,100
|
||||
,,0,2018-05-22T19:53:00Z,2018-05-22T19:54:50Z,2018-05-22T19:53:20Z,_m0,1,10,100
|
||||
,,1,2018-05-22T19:53:00Z,2018-05-22T19:54:50Z,2018-05-22T19:53:30Z,_m1,1,10,100
|
||||
,,1,2018-05-22T19:53:00Z,2018-05-22T19:54:50Z,2018-05-22T19:53:40Z,_m1,1,10,100
|
||||
,,1,2018-05-22T19:53:00Z,2018-05-22T19:54:50Z,2018-05-22T19:53:50Z,_m1,1,10,100
|
||||
,,1,2018-05-22T19:53:00Z,2018-05-22T19:54:50Z,2018-05-22T19:54:00Z,_m1,1,10,100
|
||||
,,1,2018-05-22T19:53:00Z,2018-05-22T19:54:50Z,2018-05-22T19:54:10Z,_m1,1,10,100
|
||||
,,1,2018-05-22T19:53:00Z,2018-05-22T19:54:50Z,2018-05-22T19:54:30Z,_m1,1,10,100
|
||||
,,1,2018-05-22T19:53:00Z,2018-05-22T19:54:50Z,2018-05-22T19:54:40Z,_m1,1,10,100
|
||||
,,1,2018-05-22T19:53:00Z,2018-05-22T19:54:50Z,2018-05-22T19:53:50Z,_m1,1,10,100
|
||||
,,1,2018-05-22T19:53:00Z,2018-05-22T19:54:50Z,2018-05-22T19:54:00Z,_m1,1,10,100
|
||||
,,2,2018-05-22T19:53:00Z,2018-05-22T19:54:50Z,2018-05-22T19:53:10Z,_m2,1,10,100
|
||||
,,2,2018-05-22T19:53:00Z,2018-05-22T19:54:50Z,2018-05-22T19:53:30Z,_m2,1,10,100
|
||||
,,2,2018-05-22T19:53:00Z,2018-05-22T19:54:50Z,2018-05-22T19:54:40Z,_m2,1,10,100
|
||||
,,2,2018-05-22T19:53:00Z,2018-05-22T19:54:50Z,2018-05-22T19:53:50Z,_m2,1,10,100
|
||||
,,3,2018-05-22T19:53:00Z,2018-05-22T19:54:50Z,2018-05-22T19:54:00Z,_m3,1,10,100
|
||||
,,3,2018-05-22T19:53:00Z,2018-05-22T19:54:50Z,2018-05-22T19:54:10Z,_m3,1,10,100
|
||||
,,3,2018-05-22T19:53:00Z,2018-05-22T19:54:50Z,2018-05-22T19:54:20Z,_m3,1,10,100
|
||||
"
|
||||
|
||||
outData = "
|
||||
#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,dateTime:RFC3339,string,long,long,long
|
||||
#group,false,false,true,true,false,true,false,false,false
|
||||
#default,_result,,,,,,,,
|
||||
,result,table,_start,_stop,_time,_measurement,v0,v1,v2
|
||||
,,0,2018-05-22T19:53:00Z,2018-05-22T19:54:50Z,2018-05-22T19:53:30Z,_m0,1,10,100
|
||||
,,0,2018-05-22T19:53:00Z,2018-05-22T19:54:50Z,2018-05-22T19:53:40Z,_m0,2,20,100
|
||||
,,0,2018-05-22T19:53:00Z,2018-05-22T19:54:50Z,2018-05-22T19:53:50Z,_m0,3,30,100
|
||||
,,0,2018-05-22T19:53:00Z,2018-05-22T19:54:50Z,2018-05-22T19:53:00Z,_m0,4,40,100
|
||||
,,0,2018-05-22T19:53:00Z,2018-05-22T19:54:50Z,2018-05-22T19:53:10Z,_m0,5,50,100
|
||||
,,0,2018-05-22T19:53:00Z,2018-05-22T19:54:50Z,2018-05-22T19:53:20Z,_m0,6,60,100
|
||||
,,1,2018-05-22T19:53:00Z,2018-05-22T19:54:50Z,2018-05-22T19:53:30Z,_m1,1,10,100
|
||||
,,1,2018-05-22T19:53:00Z,2018-05-22T19:54:50Z,2018-05-22T19:53:40Z,_m1,2,20,100
|
||||
,,1,2018-05-22T19:53:00Z,2018-05-22T19:54:50Z,2018-05-22T19:53:50Z,_m1,3,30,100
|
||||
,,1,2018-05-22T19:53:00Z,2018-05-22T19:54:50Z,2018-05-22T19:54:00Z,_m1,4,40,100
|
||||
,,1,2018-05-22T19:53:00Z,2018-05-22T19:54:50Z,2018-05-22T19:54:10Z,_m1,5,50,100
|
||||
,,1,2018-05-22T19:53:00Z,2018-05-22T19:54:50Z,2018-05-22T19:54:30Z,_m1,6,60,100
|
||||
,,1,2018-05-22T19:53:00Z,2018-05-22T19:54:50Z,2018-05-22T19:54:40Z,_m1,7,70,100
|
||||
,,1,2018-05-22T19:53:00Z,2018-05-22T19:54:50Z,2018-05-22T19:53:50Z,_m1,8,80,100
|
||||
,,1,2018-05-22T19:53:00Z,2018-05-22T19:54:50Z,2018-05-22T19:54:00Z,_m1,9,90,100
|
||||
,,2,2018-05-22T19:53:00Z,2018-05-22T19:54:50Z,2018-05-22T19:53:10Z,_m2,1,10,100
|
||||
,,2,2018-05-22T19:53:00Z,2018-05-22T19:54:50Z,2018-05-22T19:53:30Z,_m2,2,20,100
|
||||
,,2,2018-05-22T19:53:00Z,2018-05-22T19:54:50Z,2018-05-22T19:54:40Z,_m2,3,30,100
|
||||
,,2,2018-05-22T19:53:00Z,2018-05-22T19:54:50Z,2018-05-22T19:53:50Z,_m2,4,40,100
|
||||
,,3,2018-05-22T19:53:00Z,2018-05-22T19:54:50Z,2018-05-22T19:54:00Z,_m3,1,10,100
|
||||
,,3,2018-05-22T19:53:00Z,2018-05-22T19:54:50Z,2018-05-22T19:54:10Z,_m3,2,20,100
|
||||
,,3,2018-05-22T19:53:00Z,2018-05-22T19:54:50Z,2018-05-22T19:54:20Z,_m3,3,30,100
|
||||
"
|
||||
|
||||
|
||||
t_cumulative_sum = (table=<-) => table
|
||||
|> cumulativeSum(columns: ["v0", "v1"])
|
||||
|
||||
testingTest(name: "cumulative_sum",
|
||||
input: testLoadStorage(csv: inData),
|
||||
want: testLoadMem(csv: outData),
|
||||
test: t_cumulative_sum)
|
|
@ -0,0 +1,66 @@
|
|||
inData = "
|
||||
#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,dateTime:RFC3339,string,string,long
|
||||
#group,false,false,true,true,false,true,true,false
|
||||
#default,,,,,,,,
|
||||
,result,table,_start,_stop,_time,_measurement,_field,_value
|
||||
,,0,2018-05-22T19:53:00Z,2018-05-22T19:54:50Z,2018-05-22T19:53:30Z,_m,FF,1
|
||||
,,0,2018-05-22T19:53:00Z,2018-05-22T19:54:50Z,2018-05-22T19:53:40Z,_m,FF,1
|
||||
,,0,2018-05-22T19:53:00Z,2018-05-22T19:54:50Z,2018-05-22T19:53:50Z,_m,FF,1
|
||||
,,0,2018-05-22T19:53:00Z,2018-05-22T19:54:50Z,2018-05-22T19:53:00Z,_m,FF,1
|
||||
,,0,2018-05-22T19:53:00Z,2018-05-22T19:54:50Z,2018-05-22T19:53:10Z,_m,FF,1
|
||||
,,0,2018-05-22T19:53:00Z,2018-05-22T19:54:50Z,2018-05-22T19:53:20Z,_m,FF,1
|
||||
,,1,2018-05-22T19:53:00Z,2018-05-22T19:54:50Z,2018-05-22T19:53:30Z,_m,QQ,1
|
||||
,,1,2018-05-22T19:53:00Z,2018-05-22T19:54:50Z,2018-05-22T19:53:40Z,_m,QQ,1
|
||||
,,1,2018-05-22T19:53:00Z,2018-05-22T19:54:50Z,2018-05-22T19:53:50Z,_m,QQ,1
|
||||
,,1,2018-05-22T19:53:00Z,2018-05-22T19:54:50Z,2018-05-22T19:54:00Z,_m,QQ,1
|
||||
,,1,2018-05-22T19:53:00Z,2018-05-22T19:54:50Z,2018-05-22T19:54:10Z,_m,QQ,1
|
||||
,,1,2018-05-22T19:53:00Z,2018-05-22T19:54:50Z,2018-05-22T19:54:30Z,_m,QQ,1
|
||||
,,1,2018-05-22T19:53:00Z,2018-05-22T19:54:50Z,2018-05-22T19:54:40Z,_m,QQ,1
|
||||
,,1,2018-05-22T19:53:00Z,2018-05-22T19:54:50Z,2018-05-22T19:53:50Z,_m,QQ,1
|
||||
,,1,2018-05-22T19:53:00Z,2018-05-22T19:54:50Z,2018-05-22T19:54:00Z,_m,QQ,1
|
||||
,,2,2018-05-22T19:53:00Z,2018-05-22T19:54:50Z,2018-05-22T19:53:10Z,_m,RR,1
|
||||
,,2,2018-05-22T19:53:00Z,2018-05-22T19:54:50Z,2018-05-22T19:53:30Z,_m,RR,1
|
||||
,,2,2018-05-22T19:53:00Z,2018-05-22T19:54:50Z,2018-05-22T19:54:40Z,_m,RR,1
|
||||
,,2,2018-05-22T19:53:00Z,2018-05-22T19:54:50Z,2018-05-22T19:53:50Z,_m,RR,1
|
||||
,,3,2018-05-22T19:53:00Z,2018-05-22T19:54:50Z,2018-05-22T19:54:00Z,_m,SR,1
|
||||
,,3,2018-05-22T19:53:00Z,2018-05-22T19:54:50Z,2018-05-22T19:54:10Z,_m,SR,1
|
||||
,,3,2018-05-22T19:53:00Z,2018-05-22T19:54:50Z,2018-05-22T19:54:20Z,_m,SR,1
|
||||
"
|
||||
outData = "
|
||||
#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,dateTime:RFC3339,string,string,long
|
||||
#group,false,false,true,true,false,true,true,false
|
||||
#default,_result,,,,,,,
|
||||
,result,table,_start,_stop,_time,_measurement,_field,_value
|
||||
,,0,2018-05-22T19:53:00Z,2018-05-22T19:54:50Z,2018-05-22T19:53:30Z,_m,FF,1
|
||||
,,0,2018-05-22T19:53:00Z,2018-05-22T19:54:50Z,2018-05-22T19:53:40Z,_m,FF,2
|
||||
,,0,2018-05-22T19:53:00Z,2018-05-22T19:54:50Z,2018-05-22T19:53:50Z,_m,FF,3
|
||||
,,0,2018-05-22T19:53:00Z,2018-05-22T19:54:50Z,2018-05-22T19:53:00Z,_m,FF,4
|
||||
,,0,2018-05-22T19:53:00Z,2018-05-22T19:54:50Z,2018-05-22T19:53:10Z,_m,FF,5
|
||||
,,0,2018-05-22T19:53:00Z,2018-05-22T19:54:50Z,2018-05-22T19:53:20Z,_m,FF,6
|
||||
,,1,2018-05-22T19:53:00Z,2018-05-22T19:54:50Z,2018-05-22T19:53:30Z,_m,QQ,1
|
||||
,,1,2018-05-22T19:53:00Z,2018-05-22T19:54:50Z,2018-05-22T19:53:40Z,_m,QQ,2
|
||||
,,1,2018-05-22T19:53:00Z,2018-05-22T19:54:50Z,2018-05-22T19:53:50Z,_m,QQ,3
|
||||
,,1,2018-05-22T19:53:00Z,2018-05-22T19:54:50Z,2018-05-22T19:54:00Z,_m,QQ,4
|
||||
,,1,2018-05-22T19:53:00Z,2018-05-22T19:54:50Z,2018-05-22T19:54:10Z,_m,QQ,5
|
||||
,,1,2018-05-22T19:53:00Z,2018-05-22T19:54:50Z,2018-05-22T19:54:30Z,_m,QQ,6
|
||||
,,1,2018-05-22T19:53:00Z,2018-05-22T19:54:50Z,2018-05-22T19:54:40Z,_m,QQ,7
|
||||
,,1,2018-05-22T19:53:00Z,2018-05-22T19:54:50Z,2018-05-22T19:53:50Z,_m,QQ,8
|
||||
,,1,2018-05-22T19:53:00Z,2018-05-22T19:54:50Z,2018-05-22T19:54:00Z,_m,QQ,9
|
||||
,,2,2018-05-22T19:53:00Z,2018-05-22T19:54:50Z,2018-05-22T19:53:10Z,_m,RR,1
|
||||
,,2,2018-05-22T19:53:00Z,2018-05-22T19:54:50Z,2018-05-22T19:53:30Z,_m,RR,2
|
||||
,,2,2018-05-22T19:53:00Z,2018-05-22T19:54:50Z,2018-05-22T19:54:40Z,_m,RR,3
|
||||
,,2,2018-05-22T19:53:00Z,2018-05-22T19:54:50Z,2018-05-22T19:53:50Z,_m,RR,4
|
||||
,,3,2018-05-22T19:53:00Z,2018-05-22T19:54:50Z,2018-05-22T19:54:00Z,_m,SR,1
|
||||
,,3,2018-05-22T19:53:00Z,2018-05-22T19:54:50Z,2018-05-22T19:54:10Z,_m,SR,2
|
||||
,,3,2018-05-22T19:53:00Z,2018-05-22T19:54:50Z,2018-05-22T19:54:20Z,_m,SR,3
|
||||
"
|
||||
|
||||
t_cumulative_sum_default = (table=<-) => table
|
||||
|> cumulativeSum()
|
||||
|
||||
testingTest(
|
||||
name: "cumulative_sum_default",
|
||||
input: testLoadStorage(csv: inData),
|
||||
want: testLoadMem(csv: outData),
|
||||
test: t_cumulative_sum_default
|
||||
)
|
|
@ -0,0 +1,66 @@
|
|||
inData = "
|
||||
#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,dateTime:RFC3339,string,long
|
||||
#group,false,false,true,true,false,true,false
|
||||
#default,,,,,,,
|
||||
,result,table,_start,_stop,_time,_measurement,values
|
||||
,,0,2018-05-22T19:53:00Z,2018-05-22T19:54:50Z,2018-05-22T19:53:30Z,_m,1
|
||||
,,0,2018-05-22T19:53:00Z,2018-05-22T19:54:50Z,2018-05-22T19:53:40Z,_m,1
|
||||
,,0,2018-05-22T19:53:00Z,2018-05-22T19:54:50Z,2018-05-22T19:53:50Z,_m,1
|
||||
,,0,2018-05-22T19:53:00Z,2018-05-22T19:54:50Z,2018-05-22T19:53:00Z,_m,1
|
||||
,,0,2018-05-22T19:53:00Z,2018-05-22T19:54:50Z,2018-05-22T19:53:10Z,_m,1
|
||||
,,0,2018-05-22T19:53:00Z,2018-05-22T19:54:50Z,2018-05-22T19:53:20Z,_m,1
|
||||
,,0,2018-05-22T19:53:00Z,2018-05-22T19:54:50Z,2018-05-22T19:53:30Z,_m,1
|
||||
,,0,2018-05-22T19:53:00Z,2018-05-22T19:54:50Z,2018-05-22T19:53:40Z,_m,1
|
||||
,,0,2018-05-22T19:53:00Z,2018-05-22T19:54:50Z,2018-05-22T19:53:50Z,_m,1
|
||||
,,0,2018-05-22T19:53:00Z,2018-05-22T19:54:50Z,2018-05-22T19:54:00Z,_m,1
|
||||
,,0,2018-05-22T19:53:00Z,2018-05-22T19:54:50Z,2018-05-22T19:54:10Z,_m,1
|
||||
,,0,2018-05-22T19:53:00Z,2018-05-22T19:54:50Z,2018-05-22T19:54:30Z,_m,1
|
||||
,,0,2018-05-22T19:53:00Z,2018-05-22T19:54:50Z,2018-05-22T19:54:40Z,_m,1
|
||||
,,0,2018-05-22T19:53:00Z,2018-05-22T19:54:50Z,2018-05-22T19:53:50Z,_m,1
|
||||
,,0,2018-05-22T19:53:00Z,2018-05-22T19:54:50Z,2018-05-22T19:54:00Z,_m,1
|
||||
,,0,2018-05-22T19:53:00Z,2018-05-22T19:54:50Z,2018-05-22T19:53:10Z,_m,1
|
||||
,,0,2018-05-22T19:53:00Z,2018-05-22T19:54:50Z,2018-05-22T19:53:30Z,_m,1
|
||||
,,0,2018-05-22T19:53:00Z,2018-05-22T19:54:50Z,2018-05-22T19:54:40Z,_m,1
|
||||
,,0,2018-05-22T19:53:00Z,2018-05-22T19:54:50Z,2018-05-22T19:53:50Z,_m,1
|
||||
,,0,2018-05-22T19:53:00Z,2018-05-22T19:54:50Z,2018-05-22T19:54:00Z,_m,1
|
||||
,,0,2018-05-22T19:53:00Z,2018-05-22T19:54:50Z,2018-05-22T19:54:10Z,_m,1
|
||||
,,0,2018-05-22T19:53:00Z,2018-05-22T19:54:50Z,2018-05-22T19:54:20Z,_m,1
|
||||
"
|
||||
outData = "
|
||||
#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,dateTime:RFC3339,string,long
|
||||
#group,false,false,true,true,false,true,false
|
||||
#default,_result,,,,,,
|
||||
,result,table,_start,_stop,_time,_measurement,values
|
||||
,,0,2018-05-22T19:53:00Z,2018-05-22T19:54:50Z,2018-05-22T19:53:30Z,_m,1
|
||||
,,0,2018-05-22T19:53:00Z,2018-05-22T19:54:50Z,2018-05-22T19:53:40Z,_m,1
|
||||
,,0,2018-05-22T19:53:00Z,2018-05-22T19:54:50Z,2018-05-22T19:53:50Z,_m,1
|
||||
,,0,2018-05-22T19:53:00Z,2018-05-22T19:54:50Z,2018-05-22T19:53:00Z,_m,1
|
||||
,,0,2018-05-22T19:53:00Z,2018-05-22T19:54:50Z,2018-05-22T19:53:10Z,_m,1
|
||||
,,0,2018-05-22T19:53:00Z,2018-05-22T19:54:50Z,2018-05-22T19:53:20Z,_m,1
|
||||
,,0,2018-05-22T19:53:00Z,2018-05-22T19:54:50Z,2018-05-22T19:53:30Z,_m,1
|
||||
,,0,2018-05-22T19:53:00Z,2018-05-22T19:54:50Z,2018-05-22T19:53:40Z,_m,1
|
||||
,,0,2018-05-22T19:53:00Z,2018-05-22T19:54:50Z,2018-05-22T19:53:50Z,_m,1
|
||||
,,0,2018-05-22T19:53:00Z,2018-05-22T19:54:50Z,2018-05-22T19:54:00Z,_m,1
|
||||
,,0,2018-05-22T19:53:00Z,2018-05-22T19:54:50Z,2018-05-22T19:54:10Z,_m,1
|
||||
,,0,2018-05-22T19:53:00Z,2018-05-22T19:54:50Z,2018-05-22T19:54:30Z,_m,1
|
||||
,,0,2018-05-22T19:53:00Z,2018-05-22T19:54:50Z,2018-05-22T19:54:40Z,_m,1
|
||||
,,0,2018-05-22T19:53:00Z,2018-05-22T19:54:50Z,2018-05-22T19:53:50Z,_m,1
|
||||
,,0,2018-05-22T19:53:00Z,2018-05-22T19:54:50Z,2018-05-22T19:54:00Z,_m,1
|
||||
,,0,2018-05-22T19:53:00Z,2018-05-22T19:54:50Z,2018-05-22T19:53:10Z,_m,1
|
||||
,,0,2018-05-22T19:53:00Z,2018-05-22T19:54:50Z,2018-05-22T19:53:30Z,_m,1
|
||||
,,0,2018-05-22T19:53:00Z,2018-05-22T19:54:50Z,2018-05-22T19:54:40Z,_m,1
|
||||
,,0,2018-05-22T19:53:00Z,2018-05-22T19:54:50Z,2018-05-22T19:53:50Z,_m,1
|
||||
,,0,2018-05-22T19:53:00Z,2018-05-22T19:54:50Z,2018-05-22T19:54:00Z,_m,1
|
||||
,,0,2018-05-22T19:53:00Z,2018-05-22T19:54:50Z,2018-05-22T19:54:10Z,_m,1
|
||||
,,0,2018-05-22T19:53:00Z,2018-05-22T19:54:50Z,2018-05-22T19:54:20Z,_m,1
|
||||
"
|
||||
|
||||
t_cumulative_sum_noop = (table=<-) => table
|
||||
|> cumulativeSum()
|
||||
|
||||
testingTest(
|
||||
name: "cumulative_sum_noop",
|
||||
input: testLoadStorage(csv: inData),
|
||||
want: testLoadMem(csv: outData),
|
||||
test: t_cumulative_sum_noop
|
||||
)
|
|
@ -0,0 +1,33 @@
|
|||
inData = "
|
||||
#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,dateTime:RFC3339,double,string,string,string,string,string,string
|
||||
#group,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,/
|
||||
"
|
||||
outData = "
|
||||
#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,dateTime:RFC3339,double,string,string,string,string,string,string
|
||||
#group,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,/
|
||||
"
|
||||
|
||||
t_derivative = (table=<-) =>
|
||||
table
|
||||
|> range(start: 2018-05-22T19:53:26Z)
|
||||
|> derivative(unit:100ms)
|
||||
|
||||
testingTest(name: "derivative",
|
||||
input: testLoadStorage(csv: inData),
|
||||
want: testLoadMem(csv: outData),
|
||||
test: t_derivative)
|
|
@ -0,0 +1,39 @@
|
|||
inData = "
|
||||
#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,dateTime:RFC3339,double,string,string,string,string
|
||||
#group,false,false,false,false,false,false,true,true,true,true
|
||||
#default,_result,,,,,,,,,
|
||||
,result,table,_start,_stop,_time,_value,_field,_measurement,cpu,host
|
||||
,,1,2018-05-22T19:53:24.421470485Z,2018-05-22T19:55:00Z,2018-05-22T19:53:36Z,4,usage_guest_nice,cpu,cpu-total,host.local
|
||||
,,1,2018-05-22T19:53:24.421470485Z,2018-05-22T19:55:00Z,2018-05-22T19:53:46Z,4,usage_guest_nice,cpu,cpu-total,host.local
|
||||
,,1,2018-05-22T19:53:24.421470485Z,2018-05-22T19:55:00Z,2018-05-22T19:53:56Z,0,usage_guest_nice,cpu,cpu-total,host.local
|
||||
,,1,2018-05-22T19:53:24.421470485Z,2018-05-22T19:55:00Z,2018-05-22T19:54:06Z,2,usage_guest_nice,cpu,cpu-total,host.local
|
||||
,,1,2018-05-22T19:53:24.421470485Z,2018-05-22T19:55:00Z,2018-05-22T19:54:16Z,10,usage_guest_nice,cpu,cpu-total,host.local
|
||||
,,1,2018-05-22T19:53:24.421470485Z,2018-05-22T19:55:00Z,2018-05-22T19:54:26Z,4,usage_guest_nice,cpu,cpu-total,host.local
|
||||
,,1,2018-05-22T19:53:24.421470485Z,2018-05-22T19:55:00Z,2018-05-22T19:54:36Z,20,usage_guest_nice,cpu,cpu-total,host.local
|
||||
,,1,2018-05-22T19:53:24.421470485Z,2018-05-22T19:55:00Z,2018-05-22T19:54:46Z,7,usage_guest_nice,cpu,cpu-total,host.local
|
||||
,,1,2018-05-22T19:53:24.421470485Z,2018-05-22T19:55:00Z,2018-05-22T19:54:56Z,10,usage_guest_nice,cpu,cpu-total,host.local
|
||||
"
|
||||
outData = "
|
||||
#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,dateTime:RFC3339,double,string,string,string,string
|
||||
#group,false,false,false,false,false,false,true,true,true,true
|
||||
#default,_result,,,,,,,,,
|
||||
,result,table,_start,_stop,_time,_value,_field,_measurement,cpu,host
|
||||
,,0,2018-05-22T19:53:26Z,2018-05-22T19:55:00Z,2018-05-22T19:53:46Z,0,usage_guest_nice,cpu,cpu-total,host.local
|
||||
,,0,2018-05-22T19:53:26Z,2018-05-22T19:55:00Z,2018-05-22T19:53:56Z,0,usage_guest_nice,cpu,cpu-total,host.local
|
||||
,,0,2018-05-22T19:53:26Z,2018-05-22T19:55:00Z,2018-05-22T19:54:06Z,0.02,usage_guest_nice,cpu,cpu-total,host.local
|
||||
,,0,2018-05-22T19:53:26Z,2018-05-22T19:55:00Z,2018-05-22T19:54:16Z,0.08,usage_guest_nice,cpu,cpu-total,host.local
|
||||
,,0,2018-05-22T19:53:26Z,2018-05-22T19:55:00Z,2018-05-22T19:54:26Z,0.04,usage_guest_nice,cpu,cpu-total,host.local
|
||||
,,0,2018-05-22T19:53:26Z,2018-05-22T19:55:00Z,2018-05-22T19:54:36Z,0.16,usage_guest_nice,cpu,cpu-total,host.local
|
||||
,,0,2018-05-22T19:53:26Z,2018-05-22T19:55:00Z,2018-05-22T19:54:46Z,0.07,usage_guest_nice,cpu,cpu-total,host.local
|
||||
,,0,2018-05-22T19:53:26Z,2018-05-22T19:55:00Z,2018-05-22T19:54:56Z,0.03,usage_guest_nice,cpu,cpu-total,host.local
|
||||
"
|
||||
|
||||
derivative_nonnegative = (table=<-) =>
|
||||
table
|
||||
|> range(start:2018-05-22T19:53:26Z)
|
||||
|> derivative(unit:100ms, nonNegative: true)
|
||||
|
||||
testingTest(name: "derivative_nonnegative",
|
||||
input: testLoadStorage(csv: inData),
|
||||
want: testLoadMem(csv: outData),
|
||||
test: derivative_nonnegative)
|
|
@ -0,0 +1,33 @@
|
|||
inData = "
|
||||
#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,dateTime:RFC3339,double,string,string,string,string,string,string
|
||||
#group,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,/
|
||||
"
|
||||
outData = "
|
||||
#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,dateTime:RFC3339,double,string,string,string,string,string,string
|
||||
#group,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:26Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:36Z,0.000006692848479872282,used_percent,disk,disk1s1,apfs,host.local,/
|
||||
,,0,2018-05-22T19:53:26Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:46Z,0.00009788290896750595,used_percent,disk,disk1s1,apfs,host.local,/
|
||||
,,0,2018-05-22T19:53:26Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:56Z,0,used_percent,disk,disk1s1,apfs,host.local,/
|
||||
,,0,2018-05-22T19:53:26Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:54:06Z,-0.0004057539388853115,used_percent,disk,disk1s1,apfs,host.local,/
|
||||
,,0,2018-05-22T19:53:26Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:54:16Z,0.00021082472700584276,used_percent,disk,disk1s1,apfs,host.local,/
|
||||
"
|
||||
|
||||
t_difference = (table=<-) =>
|
||||
table
|
||||
|> range(start:2018-05-22T19:53:26Z)
|
||||
|> difference()
|
||||
|
||||
testingTest(name: "difference",
|
||||
input: testLoadStorage(csv: inData),
|
||||
want: testLoadMem(csv: outData),
|
||||
test: t_difference)
|
|
@ -0,0 +1,23 @@
|
|||
inData = "
|
||||
#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,dateTime:RFC3339,double,string,string,string,string
|
||||
#group,false,false,false,false,false,false,true,true,true,true
|
||||
#default,_result,,,,,,,,,
|
||||
,result,table,_start,_stop,_time,_value,_field,_measurement,cpu,host
|
||||
,,0,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:26Z,1,usage_guest,cpu,cpu-total,host.local
|
||||
"
|
||||
outData = "
|
||||
#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,dateTime:RFC3339,double,string,string,string,string
|
||||
#group,false,false,false,false,false,false,true,true,true,true
|
||||
#default,_result,0,,,,,usage_guest,cpu,cpu-total,host.local
|
||||
,result,table,_start,_stop,_time,_value,_field,_measurement,cpu,host
|
||||
"
|
||||
|
||||
difference_one_value = (table=<-) =>
|
||||
table
|
||||
|> range(start:2018-05-22T19:53:26Z)
|
||||
|> difference(nonNegative:true)
|
||||
|
||||
testingTest(name: "difference_one_value",
|
||||
input: testLoadStorage(csv: inData),
|
||||
want: testLoadMem(csv: outData),
|
||||
test: difference_one_value)
|
|
@ -0,0 +1,38 @@
|
|||
inData = "
|
||||
#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,dateTime:RFC3339,double,string,string,string,string
|
||||
#group,false,false,false,false,false,false,true,true,true,true
|
||||
#default,_result,,,,,,,,,
|
||||
,result,table,_start,_stop,_time,_value,_field,_measurement,cpu,host
|
||||
,,0,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:26Z,1,usage_guest,cpu,cpu-total,host.local
|
||||
,,0,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:36Z,2,usage_guest,cpu,cpu-total,host.local
|
||||
,,0,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:46Z,3,usage_guest,cpu,cpu-total,host.local
|
||||
,,0,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:56Z,5,usage_guest,cpu,cpu-total,host.local
|
||||
,,0,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:54:06Z,0,usage_guest,cpu,cpu-total,host.local
|
||||
,,0,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:54:16Z,1,usage_guest,cpu,cpu-total,host.local
|
||||
,,1,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:26Z,2,usage_guest_nice,cpu,cpu-total,host.local
|
||||
,,1,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:36Z,4,field1,cpu,cpu-total,host.local
|
||||
"
|
||||
outData = "
|
||||
#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,dateTime:RFC3339,double,string,string,string,string
|
||||
#group,false,false,false,false,false,false,true,true,true,true
|
||||
#default,_result,0,,,,,usage_guest,cpu,cpu-total,host.local
|
||||
,result,table,_start,_stop,_time,_value,_field,_measurement,cpu,host
|
||||
|
||||
#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,dateTime:RFC3339,double,string,string,string,string
|
||||
#group,false,false,false,false,false,false,true,true,true,true
|
||||
#default,_result,1,,,,,usage_guest_nice,cpu,cpu-total,host.local
|
||||
,result,table,_start,_stop,_time,_value,_field,_measurement,cpu,host
|
||||
"
|
||||
|
||||
t_difference_panic = (table=<-) =>
|
||||
table
|
||||
|> range(start:2018-05-22T19:53:26Z)
|
||||
|> filter(fn: (r) => r._field == "no_exist")
|
||||
|> difference()
|
||||
|
||||
|
||||
|
||||
testingTest(name: "difference_panic",
|
||||
input: testLoadStorage(csv: inData),
|
||||
want: testLoadMem(csv: outData),
|
||||
test: t_difference_panic)
|
|
@ -0,0 +1,42 @@
|
|||
inData = "
|
||||
#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,dateTime:RFC3339,long,string,string,string,string
|
||||
#group,false,false,false,false,false,false,false,false,true,true
|
||||
#default,_result,,,,,,,,,
|
||||
,result,table,_start,_stop,_time,_value,_field,_measurement,host,name
|
||||
,,1,2018-05-22T19:53:26Z,2018-05-22T19:54:16Z,2018-05-22T19:53:26Z,15204688,io_time,diskio,host.local,disk0
|
||||
,,1,2018-05-22T19:53:26Z,2018-05-22T19:54:16Z,2018-05-22T19:53:36Z,15204894,io_time,diskio,host.local,disk0
|
||||
,,1,2018-05-22T19:53:26Z,2018-05-22T19:54:16Z,2018-05-22T19:53:46Z,15205102,io_time,diskio,host.local,disk0
|
||||
,,1,2018-05-22T19:53:26Z,2018-05-22T19:54:16Z,2018-05-22T19:53:56Z,15205226,io_time,diskio,host.local,disk0
|
||||
,,1,2018-05-22T19:53:26Z,2018-05-22T19:54:16Z,2018-05-22T19:54:06Z,15205499,io_time,diskio,host.local,disk0
|
||||
,,1,2018-05-22T19:53:26Z,2018-05-22T19:54:16Z,2018-05-22T19:54:16Z,15205755,io_time,diskio,host.local,disk0
|
||||
,,10,2018-05-22T19:53:26Z,2018-05-22T19:54:16Z,2018-05-22T19:53:26Z,648,io_time,diskio,host.local,disk2
|
||||
,,10,2018-05-22T19:53:26Z,2018-05-22T19:54:16Z,2018-05-22T19:53:36Z,648,io_time,diskio,host.local,disk2
|
||||
,,10,2018-05-22T19:53:26Z,2018-05-22T19:54:16Z,2018-05-22T19:53:46Z,648,io_time,diskio,host.local,disk2
|
||||
,,10,2018-05-22T19:53:26Z,2018-05-22T19:54:16Z,2018-05-22T19:53:56Z,648,io_time,diskio,host.local,disk2
|
||||
,,10,2018-05-22T19:53:26Z,2018-05-22T19:54:16Z,2018-05-22T19:54:06Z,648,io_time,diskio,host.local,disk2
|
||||
,,10,2018-05-22T19:53:26Z,2018-05-22T19:54:16Z,2018-05-22T19:54:16Z,648,io_time,diskio,host.local,disk2
|
||||
"
|
||||
outData = "
|
||||
#datatype,string,long,string,string,long
|
||||
#group,false,false,true,true,false
|
||||
#default,0,,,,
|
||||
,result,table,host,name,_value
|
||||
,,0,host.local,disk0,15204688
|
||||
,,0,host.local,disk0,15204894
|
||||
,,0,host.local,disk0,15205102
|
||||
,,0,host.local,disk0,15205226
|
||||
,,0,host.local,disk0,15205499
|
||||
,,0,host.local,disk0,15205755
|
||||
,,1,host.local,disk2,648
|
||||
"
|
||||
|
||||
t_distinct = (table=<-) =>
|
||||
table
|
||||
|> range(start: 2018-05-20T19:53:26Z)
|
||||
|> distinct(column:"_value")
|
||||
|> yield(name:"0")
|
||||
|
||||
testingTest(name: "distinct",
|
||||
input: testLoadStorage(csv: inData),
|
||||
want: testLoadMem(csv: outData),
|
||||
test: t_distinct)
|
|
@ -0,0 +1,59 @@
|
|||
inData = "
|
||||
#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,dateTime:RFC3339,double,string,string,string,string
|
||||
#group,false,false,false,false,false,false,true,true,true,true
|
||||
#default,_result,,,,,,,,,
|
||||
,result,table,_start,_stop,_time,_value,_field,_measurement,old,host
|
||||
,,0,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:26Z,0,usage_guest,cpu,cpu-total,host.local
|
||||
,,0,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:36Z,0,usage_guest,cpu,cpu-total,host.local
|
||||
,,0,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:46Z,0,usage_guest,cpu,cpu-total,host.local
|
||||
,,0,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:56Z,0,usage_guest,cpu,cpu-total,host.local
|
||||
,,0,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:54:06Z,0,usage_guest,cpu,cpu-total,host.local
|
||||
,,0,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:54:16Z,0,usage_guest,cpu,cpu-total,host.local
|
||||
,,1,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:26Z,0,usage_guest_nice,cpu,cpu-total,host.local
|
||||
,,1,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:36Z,0,usage_guest_nice,cpu,cpu-total,host.local
|
||||
,,1,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:46Z,0,usage_guest_nice,cpu,cpu-total,host.local
|
||||
,,1,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:56Z,0,usage_guest_nice,cpu,cpu-total,host.local
|
||||
,,1,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:54:06Z,0,usage_guest_nice,cpu,cpu-total,host.local
|
||||
,,1,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:54:16Z,0,usage_guest_nice,cpu,cpu-total,host.local
|
||||
,,2,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:26Z,91.7364670583823,usage_idle,cpu,cpu-total,host.local
|
||||
,,2,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:36Z,89.51118889861233,usage_idle,cpu,cpu-total,host.local
|
||||
,,2,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:46Z,91.0977744436109,usage_idle,cpu,cpu-total,host.local
|
||||
,,2,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:56Z,91.02836436336374,usage_idle,cpu,cpu-total,host.local
|
||||
,,2,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:54:06Z,68.304576144036,usage_idle,cpu,cpu-total,host.local
|
||||
,,2,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:54:16Z,87.88598574821853,usage_idle,cpu,cpu-total,host.local
|
||||
"
|
||||
outData = "
|
||||
#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,dateTime:RFC3339,double,string,string,string,string
|
||||
#group,false,false,false,false,false,false,true,true,true,true
|
||||
#default,_result,,,,,,,,,
|
||||
,result,table,_start,_stop,_time,_value,_field,_measurement,new,host
|
||||
,,0,2018-05-22T19:53:26Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:26Z,0,usage_guest,cpu,cpu-total,host.local
|
||||
,,0,2018-05-22T19:53:26Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:36Z,0,usage_guest,cpu,cpu-total,host.local
|
||||
,,0,2018-05-22T19:53:26Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:46Z,0,usage_guest,cpu,cpu-total,host.local
|
||||
,,0,2018-05-22T19:53:26Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:56Z,0,usage_guest,cpu,cpu-total,host.local
|
||||
,,0,2018-05-22T19:53:26Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:54:06Z,0,usage_guest,cpu,cpu-total,host.local
|
||||
,,0,2018-05-22T19:53:26Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:54:16Z,0,usage_guest,cpu,cpu-total,host.local
|
||||
,,1,2018-05-22T19:53:26Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:26Z,0,usage_guest_nice,cpu,cpu-total,host.local
|
||||
,,1,2018-05-22T19:53:26Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:36Z,0,usage_guest_nice,cpu,cpu-total,host.local
|
||||
,,1,2018-05-22T19:53:26Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:46Z,0,usage_guest_nice,cpu,cpu-total,host.local
|
||||
,,1,2018-05-22T19:53:26Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:56Z,0,usage_guest_nice,cpu,cpu-total,host.local
|
||||
,,1,2018-05-22T19:53:26Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:54:06Z,0,usage_guest_nice,cpu,cpu-total,host.local
|
||||
,,1,2018-05-22T19:53:26Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:54:16Z,0,usage_guest_nice,cpu,cpu-total,host.local
|
||||
,,2,2018-05-22T19:53:26Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:26Z,91.7364670583823,usage_idle,cpu,cpu-total,host.local
|
||||
,,2,2018-05-22T19:53:26Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:36Z,89.51118889861233,usage_idle,cpu,cpu-total,host.local
|
||||
,,2,2018-05-22T19:53:26Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:46Z,91.0977744436109,usage_idle,cpu,cpu-total,host.local
|
||||
,,2,2018-05-22T19:53:26Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:56Z,91.02836436336374,usage_idle,cpu,cpu-total,host.local
|
||||
,,2,2018-05-22T19:53:26Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:54:06Z,68.304576144036,usage_idle,cpu,cpu-total,host.local
|
||||
,,2,2018-05-22T19:53:26Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:54:16Z,87.88598574821853,usage_idle,cpu,cpu-total,host.local
|
||||
"
|
||||
|
||||
drop_after_rename = (table=<-) =>
|
||||
table
|
||||
|> range(start: 2018-05-22T19:53:26Z)
|
||||
|> rename(columns: {old: "new"})
|
||||
|> drop(columns: ["old"])
|
||||
|
||||
testingTest(name: "drop_after_rename",
|
||||
input: testLoadStorage(csv: inData),
|
||||
want: testLoadMem(csv: outData),
|
||||
test: drop_after_rename)
|
|
@ -0,0 +1,44 @@
|
|||
inData = "
|
||||
#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,dateTime:RFC3339,double,string,string,string,string
|
||||
#group,false,false,false,false,false,false,true,true,true,true
|
||||
#default,_result,,,,,,,,,
|
||||
,result,table,_start,_stop,_time,_value,_field,_measurement,old,host
|
||||
,,0,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:26Z,0,usage_guest,cpu,cpu-total,host.local
|
||||
,,0,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:36Z,0,usage_guest,cpu,cpu-total,host.local
|
||||
,,0,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:46Z,0,usage_guest,cpu,cpu-total,host.local
|
||||
,,0,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:56Z,0,usage_guest,cpu,cpu-total,host.local
|
||||
,,0,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:54:06Z,0,usage_guest,cpu,cpu-total,host.local
|
||||
,,0,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:54:16Z,0,usage_guest,cpu,cpu-total,host.local
|
||||
,,1,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:26Z,0,usage_guest_nice,cpu,cpu-total,host.local
|
||||
,,1,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:36Z,0,usage_guest_nice,cpu,cpu-total,host.local
|
||||
,,1,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:46Z,0,usage_guest_nice,cpu,cpu-total,host.local
|
||||
,,1,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:56Z,0,usage_guest_nice,cpu,cpu-total,host.local
|
||||
,,1,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:54:06Z,0,usage_guest_nice,cpu,cpu-total,host.local
|
||||
,,1,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:54:16Z,0,usage_guest_nice,cpu,cpu-total,host.local
|
||||
,,2,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:26Z,91.7364670583823,usage_idle,cpu,cpu-total,host.local
|
||||
,,2,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:36Z,89.51118889861233,usage_idle,cpu,cpu-total,host.local
|
||||
,,2,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:46Z,91.0977744436109,usage_idle,cpu,cpu-total,host.local
|
||||
,,2,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:56Z,91.02836436336374,usage_idle,cpu,cpu-total,host.local
|
||||
,,2,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:54:06Z,68.304576144036,usage_idle,cpu,cpu-total,host.local
|
||||
,,2,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:54:16Z,87.88598574821853,usage_idle,cpu,cpu-total,host.local
|
||||
"
|
||||
outData = "
|
||||
#datatype,string,string
|
||||
#group,true,true
|
||||
#default,,
|
||||
,error,reference
|
||||
,"rename error: column ""old"" doesn't exist",
|
||||
"
|
||||
|
||||
drop_before_rename = (table=<-) =>
|
||||
table
|
||||
|> range(start: 2018-05-22T19:53:26Z)
|
||||
|> drop(columns: ["old"])
|
||||
|> rename(columns: {old: "new"})
|
||||
|> yield(name: "0")
|
||||
|
||||
|
||||
testingTest(name: "drop_before_rename",
|
||||
input: testLoadStorage(csv: inData),
|
||||
want: testLoadMem(csv: outData),
|
||||
test: drop_before_rename)
|
|
@ -0,0 +1,59 @@
|
|||
inData = "
|
||||
#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,dateTime:RFC3339,double,string,string,string,string
|
||||
#group,false,false,false,false,false,false,true,true,true,true
|
||||
#default,_result,,,,,,,,,
|
||||
,result,table,_start,_stop,_time,_value,_field,_measurement,old,host
|
||||
,,0,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:26Z,0,usage_guest,cpu,cpu-total,host.local
|
||||
,,0,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:36Z,0,usage_guest,cpu,cpu-total,host.local
|
||||
,,0,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:46Z,0,usage_guest,cpu,cpu-total,host.local
|
||||
,,0,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:56Z,0,usage_guest,cpu,cpu-total,host.local
|
||||
,,0,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:54:06Z,0,usage_guest,cpu,cpu-total,host.local
|
||||
,,0,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:54:16Z,0,usage_guest,cpu,cpu-total,host.local
|
||||
,,1,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:26Z,0,usage_guest_nice,cpu,cpu-total,host.local
|
||||
,,1,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:36Z,0,usage_guest_nice,cpu,cpu-total,host.local
|
||||
,,1,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:46Z,0,usage_guest_nice,cpu,cpu-total,host.local
|
||||
,,1,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:56Z,0,usage_guest_nice,cpu,cpu-total,host.local
|
||||
,,1,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:54:06Z,0,usage_guest_nice,cpu,cpu-total,host.local
|
||||
,,1,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:54:16Z,0,usage_guest_nice,cpu,cpu-total,host.local
|
||||
,,2,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:26Z,91.7364670583823,usage_idle,cpu,cpu-total,host.local
|
||||
,,2,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:36Z,89.51118889861233,usage_idle,cpu,cpu-total,host.local
|
||||
,,2,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:46Z,91.0977744436109,usage_idle,cpu,cpu-total,host.local
|
||||
,,2,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:56Z,91.02836436336374,usage_idle,cpu,cpu-total,host.local
|
||||
,,2,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:54:06Z,68.304576144036,usage_idle,cpu,cpu-total,host.local
|
||||
,,2,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:54:16Z,87.88598574821853,usage_idle,cpu,cpu-total,host.local
|
||||
"
|
||||
outData = "
|
||||
#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,dateTime:RFC3339,double,string,string,string
|
||||
#group,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:26Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:26Z,0,usage_guest,cpu,host.local
|
||||
,,0,2018-05-22T19:53:26Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:36Z,0,usage_guest,cpu,host.local
|
||||
,,0,2018-05-22T19:53:26Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:46Z,0,usage_guest,cpu,host.local
|
||||
,,0,2018-05-22T19:53:26Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:56Z,0,usage_guest,cpu,host.local
|
||||
,,0,2018-05-22T19:53:26Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:54:06Z,0,usage_guest,cpu,host.local
|
||||
,,0,2018-05-22T19:53:26Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:54:16Z,0,usage_guest,cpu,host.local
|
||||
,,1,2018-05-22T19:53:26Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:26Z,0,usage_guest_nice,cpu,host.local
|
||||
,,1,2018-05-22T19:53:26Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:36Z,0,usage_guest_nice,cpu,host.local
|
||||
,,1,2018-05-22T19:53:26Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:46Z,0,usage_guest_nice,cpu,host.local
|
||||
,,1,2018-05-22T19:53:26Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:56Z,0,usage_guest_nice,cpu,host.local
|
||||
,,1,2018-05-22T19:53:26Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:54:06Z,0,usage_guest_nice,cpu,host.local
|
||||
,,1,2018-05-22T19:53:26Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:54:16Z,0,usage_guest_nice,cpu,host.local
|
||||
,,2,2018-05-22T19:53:26Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:26Z,91.7364670583823,usage_idle,cpu,host.local
|
||||
,,2,2018-05-22T19:53:26Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:36Z,89.51118889861233,usage_idle,cpu,host.local
|
||||
,,2,2018-05-22T19:53:26Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:46Z,91.0977744436109,usage_idle,cpu,host.local
|
||||
,,2,2018-05-22T19:53:26Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:56Z,91.02836436336374,usage_idle,cpu,host.local
|
||||
,,2,2018-05-22T19:53:26Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:54:06Z,68.304576144036,usage_idle,cpu,host.local
|
||||
,,2,2018-05-22T19:53:26Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:54:16Z,87.88598574821853,usage_idle,cpu,host.local
|
||||
"
|
||||
|
||||
drop_newname_after = (table=<-) =>
|
||||
table
|
||||
|> range(start: 2018-05-22T19:53:26Z)
|
||||
|> rename(columns:{old:"new"})
|
||||
|> drop(columns: ["new"])
|
||||
|
||||
testingTest(name: "drop_newname_after",
|
||||
input: testLoadStorage(csv: inData),
|
||||
want: testLoadMem(csv: outData),
|
||||
test: drop_newname_after)
|
|
@ -0,0 +1,59 @@
|
|||
inData = "
|
||||
#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,dateTime:RFC3339,double,string,string,string,string
|
||||
#group,false,false,false,false,false,false,true,true,true,true
|
||||
#default,_result,,,,,,,,,
|
||||
,result,table,_start,_stop,_time,_value,_field,_measurement,old,host
|
||||
,,0,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:26Z,0,usage_guest,cpu,cpu-total,host.local
|
||||
,,0,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:36Z,0,usage_guest,cpu,cpu-total,host.local
|
||||
,,0,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:46Z,0,usage_guest,cpu,cpu-total,host.local
|
||||
,,0,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:56Z,0,usage_guest,cpu,cpu-total,host.local
|
||||
,,0,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:54:06Z,0,usage_guest,cpu,cpu-total,host.local
|
||||
,,0,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:54:16Z,0,usage_guest,cpu,cpu-total,host.local
|
||||
,,1,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:26Z,0,usage_guest_nice,cpu,cpu-total,host.local
|
||||
,,1,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:36Z,0,usage_guest_nice,cpu,cpu-total,host.local
|
||||
,,1,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:46Z,0,usage_guest_nice,cpu,cpu-total,host.local
|
||||
,,1,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:56Z,0,usage_guest_nice,cpu,cpu-total,host.local
|
||||
,,1,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:54:06Z,0,usage_guest_nice,cpu,cpu-total,host.local
|
||||
,,1,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:54:16Z,0,usage_guest_nice,cpu,cpu-total,host.local
|
||||
,,2,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:26Z,91.7364670583823,usage_idle,cpu,cpu-total,host.local
|
||||
,,2,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:36Z,89.51118889861233,usage_idle,cpu,cpu-total,host.local
|
||||
,,2,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:46Z,91.0977744436109,usage_idle,cpu,cpu-total,host.local
|
||||
,,2,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:56Z,91.02836436336374,usage_idle,cpu,cpu-total,host.local
|
||||
,,2,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:54:06Z,68.304576144036,usage_idle,cpu,cpu-total,host.local
|
||||
,,2,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:54:16Z,87.88598574821853,usage_idle,cpu,cpu-total,host.local
|
||||
"
|
||||
outData = "
|
||||
#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,dateTime:RFC3339,double,string,string,string,string
|
||||
#group,false,false,false,false,false,false,true,true,true,true
|
||||
#default,_result,,,,,,,,,
|
||||
,result,table,_start,_stop,_time,_value,_field,_measurement,new,host
|
||||
,,0,2018-05-22T19:53:26Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:26Z,0,usage_guest,cpu,cpu-total,host.local
|
||||
,,0,2018-05-22T19:53:26Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:36Z,0,usage_guest,cpu,cpu-total,host.local
|
||||
,,0,2018-05-22T19:53:26Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:46Z,0,usage_guest,cpu,cpu-total,host.local
|
||||
,,0,2018-05-22T19:53:26Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:56Z,0,usage_guest,cpu,cpu-total,host.local
|
||||
,,0,2018-05-22T19:53:26Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:54:06Z,0,usage_guest,cpu,cpu-total,host.local
|
||||
,,0,2018-05-22T19:53:26Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:54:16Z,0,usage_guest,cpu,cpu-total,host.local
|
||||
,,1,2018-05-22T19:53:26Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:26Z,0,usage_guest_nice,cpu,cpu-total,host.local
|
||||
,,1,2018-05-22T19:53:26Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:36Z,0,usage_guest_nice,cpu,cpu-total,host.local
|
||||
,,1,2018-05-22T19:53:26Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:46Z,0,usage_guest_nice,cpu,cpu-total,host.local
|
||||
,,1,2018-05-22T19:53:26Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:56Z,0,usage_guest_nice,cpu,cpu-total,host.local
|
||||
,,1,2018-05-22T19:53:26Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:54:06Z,0,usage_guest_nice,cpu,cpu-total,host.local
|
||||
,,1,2018-05-22T19:53:26Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:54:16Z,0,usage_guest_nice,cpu,cpu-total,host.local
|
||||
,,2,2018-05-22T19:53:26Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:26Z,91.7364670583823,usage_idle,cpu,cpu-total,host.local
|
||||
,,2,2018-05-22T19:53:26Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:36Z,89.51118889861233,usage_idle,cpu,cpu-total,host.local
|
||||
,,2,2018-05-22T19:53:26Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:46Z,91.0977744436109,usage_idle,cpu,cpu-total,host.local
|
||||
,,2,2018-05-22T19:53:26Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:56Z,91.02836436336374,usage_idle,cpu,cpu-total,host.local
|
||||
,,2,2018-05-22T19:53:26Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:54:06Z,68.304576144036,usage_idle,cpu,cpu-total,host.local
|
||||
,,2,2018-05-22T19:53:26Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:54:16Z,87.88598574821853,usage_idle,cpu,cpu-total,host.local
|
||||
"
|
||||
|
||||
drop_newname_before = (table=<-) =>
|
||||
table
|
||||
|> range(start:2018-05-22T19:53:26Z)
|
||||
|> drop(columns:["new"])
|
||||
|> rename(columns: {old:"new"})
|
||||
|
||||
testingTest(name: "drop_newname_before",
|
||||
input: testLoadStorage(csv: inData),
|
||||
want: testLoadMem(csv: outData),
|
||||
test: drop_newname_before)
|
|
@ -0,0 +1,42 @@
|
|||
inData = "
|
||||
#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,dateTime:RFC3339,double,string,string,string,string
|
||||
#group,false,false,false,false,false,false,true,true,true,true
|
||||
#default,_result,,,,,,,,,
|
||||
,result,table,_start,_stop,_time,_value,_field,_measurement,old,host
|
||||
,,0,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:26Z,0,usage_guest,cpu,cpu-total,host.local
|
||||
,,0,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:36Z,0,usage_guest,cpu,cpu-total,host.local
|
||||
,,0,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:46Z,0,usage_guest,cpu,cpu-total,host.local
|
||||
,,0,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:56Z,0,usage_guest,cpu,cpu-total,host.local
|
||||
,,0,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:54:06Z,0,usage_guest,cpu,cpu-total,host.local
|
||||
,,0,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:54:16Z,0,usage_guest,cpu,cpu-total,host.local
|
||||
,,1,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:26Z,0,usage_guest_nice,cpu,cpu-total,host.local
|
||||
,,1,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:36Z,0,usage_guest_nice,cpu,cpu-total,host.local
|
||||
,,1,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:46Z,0,usage_guest_nice,cpu,cpu-total,host.local
|
||||
,,1,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:56Z,0,usage_guest_nice,cpu,cpu-total,host.local
|
||||
,,1,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:54:06Z,0,usage_guest_nice,cpu,cpu-total,host.local
|
||||
,,1,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:54:16Z,0,usage_guest_nice,cpu,cpu-total,host.local
|
||||
,,2,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:26Z,91.7364670583823,usage_idle,cpu,cpu-total,host.local
|
||||
,,2,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:36Z,89.51118889861233,usage_idle,cpu,cpu-total,host.local
|
||||
,,2,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:46Z,91.0977744436109,usage_idle,cpu,cpu-total,host.local
|
||||
,,2,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:56Z,91.02836436336374,usage_idle,cpu,cpu-total,host.local
|
||||
,,2,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:54:06Z,68.304576144036,usage_idle,cpu,cpu-total,host.local
|
||||
,,2,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:54:16Z,87.88598574821853,usage_idle,cpu,cpu-total,host.local
|
||||
"
|
||||
outData = "
|
||||
#datatype,string,string
|
||||
#group,true,true
|
||||
#default,,
|
||||
,error,reference
|
||||
,"function references unknown column ""_field""",
|
||||
"
|
||||
|
||||
drop_referenced = (table=<-) =>
|
||||
table
|
||||
|> range(start:2018-05-22T19:53:26Z)
|
||||
|> drop(columns: ["_field"])
|
||||
|> filter(fn: (r) => r._field == "usage_guest")
|
||||
|
||||
testingTest(name: "drop_referenced",
|
||||
input: testLoadStorage(csv: inData),
|
||||
want: testLoadMem(csv: outData),
|
||||
test: drop_referenced)
|
|
@ -0,0 +1,57 @@
|
|||
inData = "
|
||||
#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,dateTime:RFC3339,double,string,string,string,string
|
||||
#group,false,false,false,false,false,false,true,true,true,true
|
||||
#default,_result,,,,,,,,,
|
||||
,result,table,_start,_stop,_time,_value,_field,_measurement,old,host
|
||||
,,0,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:26Z,0,usage_guest,cpu,cpu-total,host.local
|
||||
,,0,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:36Z,0,usage_guest,cpu,cpu-total,host.local
|
||||
,,0,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:46Z,0,usage_guest,cpu,cpu-total,host.local
|
||||
,,0,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:56Z,0,usage_guest,cpu,cpu-total,host.local
|
||||
,,0,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:54:06Z,0,usage_guest,cpu,cpu-total,host.local
|
||||
,,0,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:54:16Z,0,usage_guest,cpu,cpu-total,host.local
|
||||
,,1,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:26Z,0,usage_guest_nice,cpu,cpu-total,host.local
|
||||
,,1,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:36Z,0,usage_guest_nice,cpu,cpu-total,host.local
|
||||
,,1,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:46Z,0,usage_guest_nice,cpu,cpu-total,host.local
|
||||
,,1,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:56Z,0,usage_guest_nice,cpu,cpu-total,host.local
|
||||
,,1,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:54:06Z,0,usage_guest_nice,cpu,cpu-total,host.local
|
||||
,,1,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:54:16Z,0,usage_guest_nice,cpu,cpu-total,host.local
|
||||
,,2,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:26Z,91.7364670583823,usage_idle,cpu,cpu-total,host.local
|
||||
,,2,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:36Z,89.51118889861233,usage_idle,cpu,cpu-total,host.local
|
||||
,,2,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:46Z,91.0977744436109,usage_idle,cpu,cpu-total,host.local
|
||||
,,2,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:56Z,91.02836436336374,usage_idle,cpu,cpu-total,host.local
|
||||
,,2,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:54:06Z,68.304576144036,usage_idle,cpu,cpu-total,host.local
|
||||
,,2,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:54:16Z,87.88598574821853,usage_idle,cpu,cpu-total,host.local
|
||||
"
|
||||
outData = "
|
||||
#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,dateTime:RFC3339,double,string,string,string
|
||||
#group,false,false,false,false,false,false,true,true,true
|
||||
#default,_result,,,,,,,,
|
||||
,result,table,_start,_stop,_time,_value,_field,old,host
|
||||
,,0,2018-05-22T19:53:26Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:26Z,0,usage_guest,cpu-total,host.local
|
||||
,,0,2018-05-22T19:53:26Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:36Z,0,usage_guest,cpu-total,host.local
|
||||
,,0,2018-05-22T19:53:26Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:46Z,0,usage_guest,cpu-total,host.local
|
||||
,,0,2018-05-22T19:53:26Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:56Z,0,usage_guest,cpu-total,host.local
|
||||
,,0,2018-05-22T19:53:26Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:54:06Z,0,usage_guest,cpu-total,host.local
|
||||
,,0,2018-05-22T19:53:26Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:54:16Z,0,usage_guest,cpu-total,host.local
|
||||
|
||||
#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,dateTime:RFC3339,double,string,string,string
|
||||
#group,false,false,false,false,false,false,true,true,true
|
||||
#default,_result,1,,,,,usage_guest_nice,cpu-total,host.local
|
||||
,result,table,_start,_stop,_time,_value,_field,old,host
|
||||
|
||||
#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,dateTime:RFC3339,double,string,string,string
|
||||
#group,false,false,false,false,false,false,true,true,true
|
||||
#default,_result,2,,,,,usage_idle,cpu-total,host.local
|
||||
,result,table,_start,_stop,_time,_value,_field,old,host
|
||||
"
|
||||
|
||||
drop_unused = (table=<-) =>
|
||||
table
|
||||
|> range(start:2018-05-22T19:53:26Z)
|
||||
|> drop(columns: ["_measurement"])
|
||||
|> filter(fn: (r) => r._field == "usage_guest")
|
||||
|
||||
testingTest(name: "drop_unused",
|
||||
input: testLoadStorage(csv: inData),
|
||||
want: testLoadMem(csv: outData),
|
||||
test: drop_unused)
|
|
@ -0,0 +1,46 @@
|
|||
inData = "
|
||||
#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,dateTime:RFC3339,double,string,string,string,string
|
||||
#group,false,false,false,false,false,false,true,true,true,true
|
||||
#default,_result,,,,,,,,,
|
||||
,result,table,_start,_stop,_time,_value,_field,_measurement,cpu,host
|
||||
,,0,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:26Z,0,usage_guest,cpu,cpu-total,host.local
|
||||
,,0,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:36Z,0,usage_guest,cpu,cpu-total,host.local
|
||||
,,0,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:46Z,0,usage_guest,cpu,cpu-total,host.local
|
||||
,,0,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:56Z,0,usage_guest,cpu,cpu-total,host.local
|
||||
,,0,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:54:06Z,0,usage_guest,cpu,cpu-total,host.local
|
||||
,,0,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:54:16Z,0,usage_guest,cpu,cpu-total,host.local
|
||||
,,1,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:26Z,0,usage_guest_nice,cpu,cpu-total,host.local
|
||||
,,1,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:36Z,0,usage_guest_nice,cpu,cpu-total,host.local
|
||||
,,1,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:46Z,0,usage_guest_nice,cpu,cpu-total,host.local
|
||||
,,1,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:56Z,0,usage_guest_nice,cpu,cpu-total,host.local
|
||||
,,1,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:54:06Z,0,usage_guest_nice,cpu,cpu-total,host.local
|
||||
,,1,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:54:16Z,0,usage_guest_nice,cpu,cpu-total,host.local
|
||||
"
|
||||
outData = "
|
||||
#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,dateTime:RFC3339,double,string,string,string,string,string
|
||||
#group,false,false,false,false,false,false,true,true,true,true,false
|
||||
#default,_result,,,,,,,,,,
|
||||
,result,table,_start,_stop,_time,_value,_field,_measurement,cpu,host,host_new
|
||||
,,0,2018-05-22T19:53:26Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:26Z,0,usage_guest,cpu,cpu-total,host.local,host.local
|
||||
,,0,2018-05-22T19:53:26Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:36Z,0,usage_guest,cpu,cpu-total,host.local,host.local
|
||||
,,0,2018-05-22T19:53:26Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:46Z,0,usage_guest,cpu,cpu-total,host.local,host.local
|
||||
,,0,2018-05-22T19:53:26Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:56Z,0,usage_guest,cpu,cpu-total,host.local,host.local
|
||||
,,0,2018-05-22T19:53:26Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:54:06Z,0,usage_guest,cpu,cpu-total,host.local,host.local
|
||||
,,0,2018-05-22T19:53:26Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:54:16Z,0,usage_guest,cpu,cpu-total,host.local,host.local
|
||||
,,1,2018-05-22T19:53:26Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:26Z,0,usage_guest_nice,cpu,cpu-total,host.local,host.local
|
||||
,,1,2018-05-22T19:53:26Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:36Z,0,usage_guest_nice,cpu,cpu-total,host.local,host.local
|
||||
,,1,2018-05-22T19:53:26Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:46Z,0,usage_guest_nice,cpu,cpu-total,host.local,host.local
|
||||
,,1,2018-05-22T19:53:26Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:56Z,0,usage_guest_nice,cpu,cpu-total,host.local,host.local
|
||||
,,1,2018-05-22T19:53:26Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:54:06Z,0,usage_guest_nice,cpu,cpu-total,host.local,host.local
|
||||
,,1,2018-05-22T19:53:26Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:54:16Z,0,usage_guest_nice,cpu,cpu-total,host.local,host.local
|
||||
"
|
||||
|
||||
t_duplicate = (table=<-) =>
|
||||
table
|
||||
|> range(start:2018-05-22T19:53:26Z)
|
||||
|> duplicate(column: "host", as: "host_new")
|
||||
|
||||
testingTest(name: "duplicate",
|
||||
input: testLoadStorage(csv: inData),
|
||||
want: testLoadMem(csv: outData),
|
||||
test: t_duplicate)
|
|
@ -0,0 +1,43 @@
|
|||
inData = "
|
||||
#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,dateTime:RFC3339,long,string,string,string,string
|
||||
#group,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:26Z,2018-05-22T19:54:16Z,2018-05-22T19:53:26Z,15204688,io_time,diskio,host.local,disk0
|
||||
,,1,2018-05-22T19:53:26Z,2018-05-22T19:54:16Z,2018-05-22T19:53:36Z,15204894,io_time,diskio,host.local,disk0
|
||||
,,1,2018-05-22T19:53:26Z,2018-05-22T19:54:16Z,2018-05-22T19:53:46Z,15205102,io_time,diskio,host.local,disk0
|
||||
,,1,2018-05-22T19:53:26Z,2018-05-22T19:54:16Z,2018-05-22T19:53:56Z,15205226,io_time,diskio,host.local,disk0
|
||||
,,1,2018-05-22T19:53:26Z,2018-05-22T19:54:16Z,2018-05-22T19:54:06Z,15205499,io_time,diskio,host.local,disk0
|
||||
,,1,2018-05-22T19:53:26Z,2018-05-22T19:54:16Z,2018-05-22T19:54:16Z,15205755,io_time,diskio,host.local,disk0
|
||||
,,10,2018-05-22T19:53:26Z,2018-05-22T19:54:16Z,2018-05-22T19:53:26Z,648,io_time,diskio,host.local,disk2
|
||||
,,10,2018-05-22T19:53:26Z,2018-05-22T19:54:16Z,2018-05-22T19:53:36Z,648,io_time,diskio,host.local,disk2
|
||||
,,10,2018-05-22T19:53:26Z,2018-05-22T19:54:16Z,2018-05-22T19:53:46Z,648,io_time,diskio,host.local,disk2
|
||||
,,10,2018-05-22T19:53:26Z,2018-05-22T19:54:16Z,2018-05-22T19:53:56Z,648,io_time,diskio,host.local,disk2
|
||||
,,10,2018-05-22T19:53:26Z,2018-05-22T19:54:16Z,2018-05-22T19:54:06Z,648,io_time,diskio,host.local,disk2
|
||||
,,10,2018-05-22T19:53:26Z,2018-05-22T19:54:16Z,2018-05-22T19:54:16Z,648,io_time,diskio,host.local,disk2
|
||||
"
|
||||
outData = "
|
||||
#datatype,string,long,dateTime:RFC3339,string,dateTime:RFC3339,long
|
||||
#group,false,false,true,true,false,false
|
||||
#default,0,,,,,
|
||||
,result,table,_start,_measurement,_time,io_time
|
||||
,,0,2018-05-22T19:53:26Z,diskio,2018-05-22T19:53:26Z,15204688
|
||||
,,0,2018-05-22T19:53:26Z,diskio,2018-05-22T19:53:36Z,15204894
|
||||
,,0,2018-05-22T19:53:26Z,diskio,2018-05-22T19:53:46Z,15205102
|
||||
,,0,2018-05-22T19:53:26Z,diskio,2018-05-22T19:53:56Z,15205226
|
||||
,,0,2018-05-22T19:53:26Z,diskio,2018-05-22T19:54:06Z,15205499
|
||||
,,0,2018-05-22T19:53:26Z,diskio,2018-05-22T19:54:16Z,15205755
|
||||
"
|
||||
|
||||
t_filter_by_regex = (table=<-) =>
|
||||
table
|
||||
|> range(start: 2018-05-20T19:53:26Z)
|
||||
|> filter(fn: (r) => r["name"] =~ /.*0/)
|
||||
|> group(columns: ["_measurement", "_start"])
|
||||
|> map(fn: (r) => ({_time: r._time, io_time: r._value}))
|
||||
|> yield(name:"0")
|
||||
|
||||
testingTest(name: "filter_by_regex",
|
||||
input: testLoadStorage(csv: inData),
|
||||
want: testLoadMem(csv: outData),
|
||||
test: t_filter_by_regex)
|
|
@ -0,0 +1,47 @@
|
|||
inData = "
|
||||
#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,dateTime:RFC3339,long,string,string,string,string
|
||||
#group,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,ixo_time,diskio,host.local,disk2
|
||||
,,10,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:36Z,648,ixo_time,diskio,host.local,disk2
|
||||
,,10,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:46Z,648,ixo_time,diskio,host.local,disk2
|
||||
,,10,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:56Z,648,ixo_time,diskio,host.local,disk2
|
||||
,,10,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:54:06Z,648,ixo_time,diskio,host.local,disk2
|
||||
,,10,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:54:16Z,648,ixo_time,diskio,host.local,disk2
|
||||
"
|
||||
outData = "
|
||||
#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,dateTime:RFC3339,long,string,string,string,string
|
||||
#group,false,false,false,false,false,false,true,true,true,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:54:16Z,15205755,io_time,diskio,host.local,disk0
|
||||
|
||||
#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,dateTime:RFC3339,long,string,string,string,string
|
||||
#group,false,false,false,false,false,false,true,true,true,true
|
||||
#default,_result,1,,,,,ixo_time,diskio,host.local,disk2
|
||||
,result,table,_start,_stop,_time,_value,_field,_measurement,host,name
|
||||
"
|
||||
|
||||
regexFunc = (table=<-, regLiteral) =>
|
||||
table
|
||||
|> range(start:2018-05-20T19:53:26Z)
|
||||
|> filter(fn: (r) => r._field =~ regLiteral)
|
||||
|> max()
|
||||
|
||||
|
||||
t_filter_by_regex_function = (table=<-) =>
|
||||
table
|
||||
|> regexFunc(regLiteral: /io.*/)
|
||||
|
||||
testingTest(name: "filter_by_regex_function",
|
||||
input: testLoadStorage(csv: inData),
|
||||
want: testLoadMem(csv: outData),
|
||||
test: t_filter_by_regex_function)
|
||||
|
|
@ -0,0 +1,43 @@
|
|||
inData = "
|
||||
#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,dateTime:RFC3339,long,string,string,string,string
|
||||
#group,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
|
||||
"
|
||||
outData = "
|
||||
#datatype,string,long,string,dateTime:RFC3339,long
|
||||
#group,false,false,true,false,false
|
||||
#default,0,,,,
|
||||
,result,table,_measurement,_time,io_time
|
||||
,,0,diskio,2018-05-22T19:53:26Z,15204688
|
||||
,,0,diskio,2018-05-22T19:53:36Z,15204894
|
||||
,,0,diskio,2018-05-22T19:53:46Z,15205102
|
||||
,,0,diskio,2018-05-22T19:53:56Z,15205226
|
||||
,,0,diskio,2018-05-22T19:54:06Z,15205499
|
||||
,,0,diskio,2018-05-22T19:54:16Z,15205755
|
||||
"
|
||||
|
||||
t_filter_by_tags = (table=<-) =>
|
||||
table
|
||||
|> range(start: 2018-05-22T19:53:26Z)
|
||||
|> filter(fn: (r) => r["name"] == "disk0")
|
||||
|> group(columns: ["_measurement"])
|
||||
|> map(fn: (r) => ({_time: r._time, io_time: r._value}))
|
||||
|> yield(name:"0")
|
||||
|
||||
testingTest(name: "filter_by_tags",
|
||||
input: testLoadStorage(csv: inData),
|
||||
want: testLoadMem(csv: outData),
|
||||
test: t_filter_by_tags)
|
|
@ -0,0 +1,48 @@
|
|||
inData = "
|
||||
#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,dateTime:RFC3339,double,string,string,string
|
||||
#group,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
|
||||
,,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
|
||||
"
|
||||
outData = "
|
||||
#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,dateTime:RFC3339,double,string,string,string
|
||||
#group,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
|
||||
,,1,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:26Z,1.98,load15,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:26Z,82.9833984375,used_percent,swap,host.local
|
||||
"
|
||||
|
||||
t_first = (table=<-) =>
|
||||
table
|
||||
|> first()
|
||||
testingTest(name: "first",
|
||||
input: testLoadStorage(csv: inData),
|
||||
want: testLoadMem(csv: outData),
|
||||
test: t_first)
|
|
@ -0,0 +1,40 @@
|
|||
inData = "
|
||||
#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,dateTime:RFC3339,long,string,string,string,string
|
||||
#group,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:26Z,2018-05-22T19:54:16Z,2018-05-22T19:53:26Z,15204688,io_time,diskio,host.local,disk0
|
||||
,,1,2018-05-22T19:53:26Z,2018-05-22T19:54:16Z,2018-05-22T19:53:36Z,15204894,io_time,diskio,host.local,disk0
|
||||
,,1,2018-05-22T19:53:26Z,2018-05-22T19:54:16Z,2018-05-22T19:53:46Z,15205102,io_time,diskio,host.local,disk0
|
||||
,,1,2018-05-22T19:53:26Z,2018-05-22T19:54:16Z,2018-05-22T19:53:56Z,15205226,io_time,diskio,host.local,disk0
|
||||
,,1,2018-05-22T19:53:26Z,2018-05-22T19:54:16Z,2018-05-22T19:54:06Z,15205499,io_time,diskio,host.local,disk0
|
||||
,,1,2018-05-22T19:53:26Z,2018-05-22T19:54:16Z,2018-05-22T19:54:16Z,15205755,io_time,diskio,host.local,disk0
|
||||
,,10,2018-05-22T19:53:26Z,2018-05-22T19:54:16Z,2018-05-22T19:53:26Z,648,io_time,diskio,host.local,disk2
|
||||
,,10,2018-05-22T19:53:26Z,2018-05-22T19:54:16Z,2018-05-22T19:53:36Z,648,io_time,diskio,host.local,disk2
|
||||
,,10,2018-05-22T19:53:26Z,2018-05-22T19:54:16Z,2018-05-22T19:53:46Z,648,io_time,diskio,host.local,disk2
|
||||
,,10,2018-05-22T19:53:26Z,2018-05-22T19:54:16Z,2018-05-22T19:53:56Z,648,io_time,diskio,host.local,disk2
|
||||
,,10,2018-05-22T19:53:26Z,2018-05-22T19:54:16Z,2018-05-22T19:54:06Z,648,io_time,diskio,host.local,disk2
|
||||
,,10,2018-05-22T19:53:26Z,2018-05-22T19:54:16Z,2018-05-22T19:54:16Z,648,io_time,diskio,host.local,disk2
|
||||
"
|
||||
outData = "
|
||||
#datatype,string,long,dateTime:RFC3339,string,string,dateTime:RFC3339,long
|
||||
#group,false,false,true,true,true,false,false
|
||||
#default,0,,,,,,
|
||||
,result,table,_start,_measurement,name,_time,max
|
||||
,,0,2018-05-22T19:53:26Z,diskio,disk0,2018-05-22T19:54:16Z,15205755
|
||||
,,1,2018-05-22T19:53:26Z,diskio,disk2,2018-05-22T19:53:26Z,648
|
||||
"
|
||||
|
||||
t_group = (table=<-) =>
|
||||
table
|
||||
|> range(start: 2018-05-22T19:53:26Z)
|
||||
|> filter(fn: (r) => r._measurement == "diskio" and r._field == "io_time")
|
||||
|> group(columns: ["_measurement", "_start", "name"])
|
||||
|> max()
|
||||
|> map(fn: (r) => ({_time: r._time, max: r._value}))
|
||||
|> yield(name: "0")
|
||||
|
||||
testingTest(name: "group",
|
||||
input: testLoadStorage(csv: inData),
|
||||
want: testLoadMem(csv: outData),
|
||||
test: t_group)
|
|
@ -0,0 +1,33 @@
|
|||
inData = "
|
||||
#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,dateTime:RFC3339,double,string,string,string,string
|
||||
#group,false,false,false,false,false,false,true,true,true,true
|
||||
#default,_result,,,,,,,,,
|
||||
,result,table,_start,_stop,_time,_value,_field,_measurement,cpu,host
|
||||
,,2,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:26Z,91.7364670583823,usage_idle,cpu,cpu-total,host1
|
||||
,,2,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:36Z,89.51118889861233,usage_idle,cpu,cpu-total,host2
|
||||
,,2,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:46Z,91.0977744436109,usage_idle,cpu,cpu-total,host1
|
||||
,,2,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:56Z,91.02836436336374,usage_idle,cpu,cpu-total,host2
|
||||
,,2,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:54:06Z,68.304576144036,usage_idle,cpu,cpu-total,host1
|
||||
,,2,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:54:16Z,87.88598574821853,usage_idle,cpu,cpu-total,host2
|
||||
"
|
||||
outData = "
|
||||
#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,dateTime:RFC3339,double,string,string,string,string
|
||||
#group,false,false,false,false,false,true,false,false,false,false
|
||||
#default,_result,,,,,,,,,
|
||||
,result,table,_start,_stop,_time,_value,_field,_measurement,cpu,host
|
||||
,,0,2018-05-22T19:53:26Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:54:06Z,68.304576144036,usage_idle,cpu,cpu-total,host1
|
||||
,,1,2018-05-22T19:53:26Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:54:16Z,87.88598574821853,usage_idle,cpu,cpu-total,host2
|
||||
,,2,2018-05-22T19:53:26Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:36Z,89.51118889861233,usage_idle,cpu,cpu-total,host2
|
||||
,,3,2018-05-22T19:53:26Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:56Z,91.02836436336374,usage_idle,cpu,cpu-total,host2
|
||||
,,4,2018-05-22T19:53:26Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:46Z,91.0977744436109,usage_idle,cpu,cpu-total,host1
|
||||
,,5,2018-05-22T19:53:26Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:26Z,91.7364670583823,usage_idle,cpu,cpu-total,host1
|
||||
"
|
||||
|
||||
t_group_by_field = (table=<-) =>
|
||||
table
|
||||
|> range(start:2018-05-22T19:53:26Z)
|
||||
|> group(columns: ["_value"])
|
||||
testingTest(name: "group_by_field",
|
||||
input: testLoadStorage(csv: inData),
|
||||
want: testLoadMem(csv: outData),
|
||||
test: t_group_by_field)
|
|
@ -0,0 +1,46 @@
|
|||
inData = "
|
||||
#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,dateTime:RFC3339,string,string,string,string,string,string
|
||||
#group,false,false,true,true,false,false,true,true,true,true,true
|
||||
#default,_result,,,,,,,,,,
|
||||
,result,table,_start,_stop,_time,_value,_field,taskID,orgID,status,_measurement
|
||||
,,0,2018-10-02T17:55:11.520461Z,2018-10-03T17:55:11.520461Z,2018-10-03T17:55:11.01114Z,02bac3c908f37000,runID,02bac3c8f0f37000,02bac3c8d6c5b000,started,records
|
||||
,,0,2018-10-02T17:55:11.520461Z,2018-10-03T17:55:11.520461Z,2018-10-03T17:55:11.113222Z,02bac3c922737000,runID,02bac3c8f0f37000,02bac3c8d6c5b000,started,records
|
||||
,,1,2018-10-02T17:55:11.520461Z,2018-10-03T17:55:11.520461Z,2018-10-03T17:55:10.920529Z,02bac3c8f1737000,runID,02bac3c8f0f37000,02bac3c8d6c5b000,success,records
|
||||
,,1,2018-10-02T17:55:11.520461Z,2018-10-03T17:55:11.520461Z,2018-10-03T17:55:11.01435Z,02bac3c908f37000,runID,02bac3c8f0f37000,02bac3c8d6c5b000,success,records
|
||||
,,1,2018-10-02T17:55:11.520461Z,2018-10-03T17:55:11.520461Z,2018-10-03T17:55:11.115415Z,02bac3c922737000,runID,02bac3c8f0f37000,02bac3c8d6c5b000,success,records
|
||||
,,2,2018-10-02T17:55:11.520461Z,2018-10-03T17:55:11.520461Z,2018-10-03T17:55:11.01114Z,2018-10-03T17:55:12Z,scheduledFor,02bac3c8f0f37000,02bac3c8d6c5b000,started,records
|
||||
,,2,2018-10-02T17:55:11.520461Z,2018-10-03T17:55:11.520461Z,2018-10-03T17:55:11.113222Z,2018-10-03T17:55:13Z,scheduledFor,02bac3c8f0f37000,02bac3c8d6c5b000,started,records
|
||||
,,3,2018-10-02T17:55:11.520461Z,2018-10-03T17:55:11.520461Z,2018-10-03T17:55:10.920529Z,2018-10-03T17:55:11Z,scheduledFor,02bac3c8f0f37000,02bac3c8d6c5b000,success,records
|
||||
,,3,2018-10-02T17:55:11.520461Z,2018-10-03T17:55:11.520461Z,2018-10-03T17:55:11.01435Z,2018-10-03T17:55:12Z,scheduledFor,02bac3c8f0f37000,02bac3c8d6c5b000,success,records
|
||||
,,3,2018-10-02T17:55:11.520461Z,2018-10-03T17:55:11.520461Z,2018-10-03T17:55:11.115415Z,2018-10-03T17:55:13Z,scheduledFor,02bac3c8f0f37000,02bac3c8d6c5b000,success,records
|
||||
,,4,2018-10-02T17:55:11.520461Z,2018-10-03T17:55:11.520461Z,2018-10-03T17:55:11.01114Z,1970-01-01T00:00:01Z,requestedAt,02bac3c8f0f37000,02bac3c8d6c5b000,started,records
|
||||
"
|
||||
outData = "
|
||||
#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,dateTime:RFC3339,string,string,string,string,string,string
|
||||
#group,false,false,false,false,false,false,false,false,false,true,false
|
||||
#default,r1,,,,,,,,,,
|
||||
,result,table,_start,_stop,_time,taskID,orgID,status,_measurement,runID,scheduledFor
|
||||
,,0,2018-10-02T17:55:11.520461Z,2018-10-03T17:55:11.520461Z,2018-10-03T17:55:10.920529Z,02bac3c8f0f37000,02bac3c8d6c5b000,success,records,02bac3c8f1737000,2018-10-03T17:55:11Z
|
||||
|
||||
#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,dateTime:RFC3339,string,string,string,string,string,string,string
|
||||
#group,false,false,false,false,false,false,false,false,false,false,true,false
|
||||
#default,r1,,,,,,,,,,,
|
||||
,result,table,_start,_stop,_time,taskID,orgID,status,_measurement,requestedAt,runID,scheduledFor
|
||||
,,1,2018-10-02T17:55:11.520461Z,2018-10-03T17:55:11.520461Z,2018-10-03T17:55:11.01114Z,02bac3c8f0f37000,02bac3c8d6c5b000,started,records,1970-01-01T00:00:01Z,02bac3c908f37000,2018-10-03T17:55:12Z
|
||||
,,1,2018-10-02T17:55:11.520461Z,2018-10-03T17:55:11.520461Z,2018-10-03T17:55:11.01435Z,02bac3c8f0f37000,02bac3c8d6c5b000,success,records,,02bac3c908f37000,2018-10-03T17:55:12Z
|
||||
,,2,2018-10-02T17:55:11.520461Z,2018-10-03T17:55:11.520461Z,2018-10-03T17:55:11.113222Z,02bac3c8f0f37000,02bac3c8d6c5b000,started,records,,02bac3c922737000,2018-10-03T17:55:13Z
|
||||
,,2,2018-10-02T17:55:11.520461Z,2018-10-03T17:55:11.520461Z,2018-10-03T17:55:11.115415Z,02bac3c8f0f37000,02bac3c8d6c5b000,success,records,,02bac3c922737000,2018-10-03T17:55:13Z
|
||||
"
|
||||
|
||||
t_group_by_irregular = (table=<-) =>
|
||||
table
|
||||
|> range(start: 2018-10-02T17:55:11.520461Z)
|
||||
|> filter(fn: (r) => r._measurement == "records" and r.taskID == "02bac3c8f0f37000" )
|
||||
|> pivot(rowKey:["_time"], columnKey: ["_field"], valueColumn: "_value")
|
||||
|> group(columns: ["runID"])
|
||||
|> yield(name:"r1")
|
||||
|
||||
testingTest(name: "group_by_irregular",
|
||||
input: testLoadStorage(csv: inData),
|
||||
want: testLoadMem(csv: outData),
|
||||
test: t_group_by_irregular)
|
|
@ -0,0 +1,37 @@
|
|||
inData = "
|
||||
#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,dateTime:RFC3339,long,string,string,string,string
|
||||
#group,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,diskio1,host.local,disk0
|
||||
,,1,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:36Z,15204894,io_time,diskio1,host.local,disk0
|
||||
,,1,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:46Z,15205102,io_time,diskio1,host.local,disk0
|
||||
,,1,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:56Z,15205226,io_time,diskio1,host.local,disk0
|
||||
,,1,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:54:06Z,15205499,io_time,diskio2,host.local,disk0
|
||||
,,1,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:54:16Z,15205755,io_time,diskio2,host.local,disk0
|
||||
,,10,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:26Z,648,io_time,diskio2,host.local,disk2
|
||||
,,10,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:36Z,648,io_time,diskio2,host.local,disk2
|
||||
,,10,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:46Z,648,io_time,diskio3,host.local,disk2
|
||||
,,10,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:56Z,648,io_time,diskio3,host.local,disk2
|
||||
,,10,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:54:06Z,648,io_time,diskio3,host.local,disk2
|
||||
,,10,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:54:16Z,648,io_time,diskio3,host.local,disk2
|
||||
"
|
||||
outData = "
|
||||
#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,dateTime:RFC3339,long,string,string,string,string
|
||||
#group,false,false,true,true,false,false,true,false,true,true
|
||||
#default,_result,,,,,,,,,
|
||||
,result,table,_start,_stop,_time,_value,_field,_measurement,host,name
|
||||
,,0,2018-05-22T19:53:26Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:54:16Z,15205755,io_time,diskio2,host.local,disk0
|
||||
,,1,2018-05-22T19:53:26Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:26Z,648,io_time,diskio2,host.local,disk2
|
||||
"
|
||||
|
||||
t_group_except = (table=<-) =>
|
||||
table
|
||||
|> range(start:2018-05-22T19:53:26Z)
|
||||
|> group(columns:["_measurement", "_time", "_value"], mode: "except")
|
||||
|> max()
|
||||
|
||||
testingTest(name: "group_except",
|
||||
input: testLoadStorage(csv: inData),
|
||||
want: testLoadMem(csv: outData),
|
||||
test: t_group_except)
|
|
@ -0,0 +1,49 @@
|
|||
inData = "
|
||||
#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,dateTime:RFC3339,long,string,string,string,string
|
||||
#group,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
|
||||
"
|
||||
outData = "
|
||||
#datatype,string,long,dateTime:RFC3339,long
|
||||
#group,false,false,false,false
|
||||
#default,0,,,
|
||||
,result,table,_time,io_time
|
||||
,,0,2018-05-22T19:53:26Z,15204688
|
||||
,,0,2018-05-22T19:53:36Z,15204894
|
||||
,,0,2018-05-22T19:53:46Z,15205102
|
||||
,,0,2018-05-22T19:53:56Z,15205226
|
||||
,,0,2018-05-22T19:54:06Z,15205499
|
||||
,,0,2018-05-22T19:54:16Z,15205755
|
||||
,,0,2018-05-22T19:53:26Z,648
|
||||
,,0,2018-05-22T19:53:36Z,648
|
||||
,,0,2018-05-22T19:53:46Z,648
|
||||
,,0,2018-05-22T19:53:56Z,648
|
||||
,,0,2018-05-22T19:54:06Z,648
|
||||
,,0,2018-05-22T19:54:16Z,648
|
||||
"
|
||||
|
||||
t_group_ungroup = (table=<-) =>
|
||||
table
|
||||
|> range(start: 2018-05-22T19:53:26Z)
|
||||
|> group(columns: ["name"])
|
||||
|> group()
|
||||
|> map(fn: (r) => ({_time: r._time, io_time:r._value}))
|
||||
|> yield(name:"0")
|
||||
|
||||
testingTest(name: "group_ungroup",
|
||||
input: testLoadStorage(csv: inData),
|
||||
want: testLoadMem(csv: outData),
|
||||
test: t_group_ungroup)
|
|
@ -0,0 +1,39 @@
|
|||
inData = "
|
||||
#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,dateTime:RFC3339,long,string,string,string
|
||||
#group,false,false,false,false,false,false,true,true,false
|
||||
#default,_result,,,,,,,,
|
||||
,result,table,_start,_stop,_time,_value,_field,_measurement,host
|
||||
,,1,2018-11-07T00:00:00Z,2018-11-08T00:00:00Z,2018-11-07T00:00:00Z,10,A,BB,HostA
|
||||
,,1,2018-11-07T00:00:00Z,2018-11-08T00:00:00Z,2018-11-07T01:00:00Z,20,A,BB,HostA
|
||||
,,1,2018-11-07T00:00:00Z,2018-11-08T00:00:00Z,2018-11-07T02:00:00Z,30,A,BB,HostA
|
||||
,,2,2018-11-07T00:00:00Z,2018-11-08T00:00:00Z,2018-11-07T03:00:00Z,15,A,CC,HostA
|
||||
,,2,2018-11-07T00:00:00Z,2018-11-08T00:00:00Z,2018-11-07T04:00:00Z,21,A,CC,HostA
|
||||
,,2,2018-11-07T00:00:00Z,2018-11-08T00:00:00Z,2018-11-07T05:00:00Z,33,A,CC,HostB
|
||||
,,3,2018-11-07T00:00:00Z,2018-11-08T00:00:00Z,2018-11-07T06:00:00Z,18,A,DD,HostC
|
||||
,,3,2018-11-07T00:00:00Z,2018-11-08T00:00:00Z,2018-11-07T07:00:00Z,12,A,DD,HostC
|
||||
,,3,2018-11-07T00:00:00Z,2018-11-08T00:00:00Z,2018-11-07T08:00:00Z,15,A,DD,HostC
|
||||
,,4,2018-11-07T00:00:00Z,2018-11-08T00:00:00Z,2018-11-07T09:00:00Z,25,B,CC,HostD
|
||||
,,4,2018-11-07T00:00:00Z,2018-11-08T00:00:00Z,2018-11-07T10:00:00Z,75,B,CC,HostD
|
||||
,,4,2018-11-07T00:00:00Z,2018-11-08T00:00:00Z,2018-11-07T11:00:00Z,50,B,CC,HostD
|
||||
,,5,2018-11-07T00:00:00Z,2018-11-08T00:00:00Z,2018-11-07T12:00:00Z,10,B,DD,HostD
|
||||
,,5,2018-11-07T00:00:00Z,2018-11-08T00:00:00Z,2018-11-07T13:00:00Z,13,B,DD,HostE
|
||||
,,5,2018-11-07T00:00:00Z,2018-11-08T00:00:00Z,2018-11-07T14:00:00Z,27,B,DD,HostE
|
||||
"
|
||||
outData = "
|
||||
#datatype,string,long,string,string,double
|
||||
#group,false,false,false,false,false
|
||||
#default,_result,,,,
|
||||
,result,table,_measurement,host,_value
|
||||
,,0,CC,HostD,50
|
||||
,,0,CC,HostB,33
|
||||
,,0,BB,HostA,20
|
||||
"
|
||||
|
||||
t_highestAverage = (table=<-) =>
|
||||
table
|
||||
|> highestAverage(n: 3, groupColumns: ["_measurement", "host"])
|
||||
|
||||
testingTest(name: "highestAverage",
|
||||
input: testLoadStorage(csv: inData),
|
||||
want: testLoadMem(csv: outData),
|
||||
test: t_highestAverage)
|
|
@ -0,0 +1,40 @@
|
|||
inData = "
|
||||
#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,dateTime:RFC3339,long,string,string,string
|
||||
#group,false,false,false,false,false,false,true,true,false
|
||||
#default,_result,,,,,,,,
|
||||
,result,table,_start,_stop,_time,_value,_field,_measurement,host
|
||||
,,1,2018-11-07T00:00:00Z,2018-11-08T00:00:00Z,2018-11-07T00:00:00Z,10,A,BB,HostA
|
||||
,,1,2018-11-07T00:00:00Z,2018-11-08T00:00:00Z,2018-11-07T01:00:00Z,20,A,BB,HostA
|
||||
,,1,2018-11-07T00:00:00Z,2018-11-08T00:00:00Z,2018-11-07T02:00:00Z,30,A,BB,HostA
|
||||
,,2,2018-11-07T00:00:00Z,2018-11-08T00:00:00Z,2018-11-07T03:00:00Z,15,A,CC,HostA
|
||||
,,2,2018-11-07T00:00:00Z,2018-11-08T00:00:00Z,2018-11-07T04:00:00Z,21,A,CC,HostA
|
||||
,,2,2018-11-07T00:00:00Z,2018-11-08T00:00:00Z,2018-11-07T05:00:00Z,33,A,CC,HostB
|
||||
,,3,2018-11-07T00:00:00Z,2018-11-08T00:00:00Z,2018-11-07T06:00:00Z,18,A,DD,HostC
|
||||
,,3,2018-11-07T00:00:00Z,2018-11-08T00:00:00Z,2018-11-07T07:00:00Z,12,A,DD,HostC
|
||||
,,3,2018-11-07T00:00:00Z,2018-11-08T00:00:00Z,2018-11-07T08:00:00Z,15,A,DD,HostC
|
||||
,,4,2018-11-07T00:00:00Z,2018-11-08T00:00:00Z,2018-11-07T09:00:00Z,25,B,CC,HostD
|
||||
,,4,2018-11-07T00:00:00Z,2018-11-08T00:00:00Z,2018-11-07T10:00:00Z,75,B,CC,HostD
|
||||
,,4,2018-11-07T00:00:00Z,2018-11-08T00:00:00Z,2018-11-07T11:00:00Z,50,B,CC,HostD
|
||||
,,5,2018-11-07T00:00:00Z,2018-11-08T00:00:00Z,2018-11-07T12:00:00Z,10,B,DD,HostD
|
||||
,,5,2018-11-07T00:00:00Z,2018-11-08T00:00:00Z,2018-11-07T13:00:00Z,13,B,DD,HostE
|
||||
,,5,2018-11-07T00:00:00Z,2018-11-08T00:00:00Z,2018-11-07T14:00:00Z,27,B,DD,HostE
|
||||
"
|
||||
outData = "
|
||||
#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,dateTime:RFC3339,long,string,string,string
|
||||
#group,false,false,false,false,false,false,false,false,false
|
||||
#default,_result,,,,,,,,
|
||||
,result,table,_start,_stop,_time,_value,_field,_measurement,host
|
||||
,,0,2018-11-07T00:00:00Z,2018-11-08T00:00:00Z,2018-11-07T11:00:00Z,50,B,CC,HostD
|
||||
,,0,2018-11-07T00:00:00Z,2018-11-08T00:00:00Z,2018-11-07T05:00:00Z,33,A,CC,HostB
|
||||
,,0,2018-11-07T00:00:00Z,2018-11-08T00:00:00Z,2018-11-07T02:00:00Z,30,A,BB,HostA
|
||||
"
|
||||
|
||||
t_highestCurrent = (table=<-) =>
|
||||
table
|
||||
|> range(start: 2018-11-07T00:00:00Z)
|
||||
|> highestCurrent(n: 3, groupColumns: ["_measurement", "host"])
|
||||
|
||||
testingTest(name: "highestCurrent",
|
||||
input: testLoadStorage(csv: inData),
|
||||
want: testLoadMem(csv: outData),
|
||||
test: t_highestCurrent)
|
|
@ -0,0 +1,39 @@
|
|||
inData = "
|
||||
#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,dateTime:RFC3339,long,string,string,string
|
||||
#group,false,false,false,false,false,false,true,true,false
|
||||
#default,_result,,,,,,,,
|
||||
,result,table,_start,_stop,_time,_value,_field,_measurement,host
|
||||
,,1,2018-11-07T00:00:00Z,2018-11-08T00:00:00Z,2018-11-07T00:00:00Z,10,A,BB,HostA
|
||||
,,1,2018-11-07T00:00:00Z,2018-11-08T00:00:00Z,2018-11-07T01:00:00Z,20,A,BB,HostA
|
||||
,,1,2018-11-07T00:00:00Z,2018-11-08T00:00:00Z,2018-11-07T02:00:00Z,30,A,BB,HostA
|
||||
,,2,2018-11-07T00:00:00Z,2018-11-08T00:00:00Z,2018-11-07T03:00:00Z,15,A,CC,HostA
|
||||
,,2,2018-11-07T00:00:00Z,2018-11-08T00:00:00Z,2018-11-07T04:00:00Z,21,A,CC,HostA
|
||||
,,2,2018-11-07T00:00:00Z,2018-11-08T00:00:00Z,2018-11-07T05:00:00Z,33,A,CC,HostB
|
||||
,,3,2018-11-07T00:00:00Z,2018-11-08T00:00:00Z,2018-11-07T06:00:00Z,18,A,DD,HostC
|
||||
,,3,2018-11-07T00:00:00Z,2018-11-08T00:00:00Z,2018-11-07T07:00:00Z,12,A,DD,HostC
|
||||
,,3,2018-11-07T00:00:00Z,2018-11-08T00:00:00Z,2018-11-07T08:00:00Z,15,A,DD,HostC
|
||||
,,4,2018-11-07T00:00:00Z,2018-11-08T00:00:00Z,2018-11-07T09:00:00Z,25,B,CC,HostD
|
||||
,,4,2018-11-07T00:00:00Z,2018-11-08T00:00:00Z,2018-11-07T10:00:00Z,75,B,CC,HostD
|
||||
,,4,2018-11-07T00:00:00Z,2018-11-08T00:00:00Z,2018-11-07T11:00:00Z,50,B,CC,HostD
|
||||
,,5,2018-11-07T00:00:00Z,2018-11-08T00:00:00Z,2018-11-07T12:00:00Z,10,B,DD,HostD
|
||||
,,5,2018-11-07T00:00:00Z,2018-11-08T00:00:00Z,2018-11-07T13:00:00Z,13,B,DD,HostE
|
||||
,,5,2018-11-07T00:00:00Z,2018-11-08T00:00:00Z,2018-11-07T14:00:00Z,27,B,DD,HostE
|
||||
"
|
||||
outData = "
|
||||
#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,dateTime:RFC3339,long,string,string,string
|
||||
#group,false,false,false,false,false,false,false,false,false
|
||||
#default,_result,,,,,,,,
|
||||
,result,table,_start,_stop,_time,_value,_field,_measurement,host
|
||||
,,0,2018-11-07T00:00:00Z,2018-11-08T00:00:00Z,2018-11-07T10:00:00Z,75,B,CC,HostD
|
||||
,,0,2018-11-07T00:00:00Z,2018-11-08T00:00:00Z,2018-11-07T05:00:00Z,33,A,CC,HostB
|
||||
,,0,2018-11-07T00:00:00Z,2018-11-08T00:00:00Z,2018-11-07T02:00:00Z,30,A,BB,HostA
|
||||
"
|
||||
|
||||
t_highestMax = (table=<-) =>
|
||||
table
|
||||
|> highestMax(n: 3, groupColumns: ["_measurement", "host"])
|
||||
|
||||
testingTest(name: "highestMax",
|
||||
input: testLoadStorage(csv: inData),
|
||||
want: testLoadMem(csv: outData),
|
||||
test: t_highestMax)
|
|
@ -0,0 +1,34 @@
|
|||
inData = "
|
||||
#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,dateTime:RFC3339,string,double
|
||||
#group,false,false,true,true,true,true,false
|
||||
#default,_result,,,,,,
|
||||
,result,table,_start,_stop,_time,_field,_value
|
||||
,,1,2018-05-22T19:53:00Z,2018-05-22T19:54:00Z,2018-05-22T19:53:00Z,x_duration_seconds,0
|
||||
,,1,2018-05-22T19:53:00Z,2018-05-22T19:54:00Z,2018-05-22T19:53:00Z,x_duration_seconds,1
|
||||
,,2,2018-05-22T19:53:00Z,2018-05-22T19:54:00Z,2018-05-22T19:53:00Z,y_duration_seconds,0
|
||||
,,2,2018-05-22T19:53:00Z,2018-05-22T19:54:00Z,2018-05-22T19:53:00Z,y_duration_seconds,0
|
||||
,,2,2018-05-22T19:53:00Z,2018-05-22T19:54:00Z,2018-05-22T19:53:00Z,y_duration_seconds,1.5
|
||||
"
|
||||
outData = "
|
||||
#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,dateTime:RFC3339,string,double,double
|
||||
#group,false,false,true,true,true,true,false,false
|
||||
#default,_result,,,,,,,
|
||||
,result,table,_start,_stop,_time,_field,le,_value
|
||||
,,0,2018-05-22T19:53:00Z,2018-05-22T19:54:00Z,2018-05-22T19:53:00Z,x_duration_seconds,-1,0
|
||||
,,0,2018-05-22T19:53:00Z,2018-05-22T19:54:00Z,2018-05-22T19:53:00Z,x_duration_seconds,0,1
|
||||
,,0,2018-05-22T19:53:00Z,2018-05-22T19:54:00Z,2018-05-22T19:53:00Z,x_duration_seconds,1,2
|
||||
,,0,2018-05-22T19:53:00Z,2018-05-22T19:54:00Z,2018-05-22T19:53:00Z,x_duration_seconds,2,2
|
||||
,,1,2018-05-22T19:53:00Z,2018-05-22T19:54:00Z,2018-05-22T19:53:00Z,y_duration_seconds,-1,0
|
||||
,,1,2018-05-22T19:53:00Z,2018-05-22T19:54:00Z,2018-05-22T19:53:00Z,y_duration_seconds,0,2
|
||||
,,1,2018-05-22T19:53:00Z,2018-05-22T19:54:00Z,2018-05-22T19:53:00Z,y_duration_seconds,1,2
|
||||
,,1,2018-05-22T19:53:00Z,2018-05-22T19:54:00Z,2018-05-22T19:53:00Z,y_duration_seconds,2,3
|
||||
"
|
||||
|
||||
t_histogram = (table=<-) =>
|
||||
table
|
||||
|> histogram(bins:[-1.0,0.0,1.0,2.0])
|
||||
|
||||
testingTest(name: "histogram",
|
||||
input: testLoadStorage(csv: inData),
|
||||
want: testLoadMem(csv: outData),
|
||||
test: t_histogram)
|
|
@ -0,0 +1,38 @@
|
|||
inData = "
|
||||
#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,dateTime:RFC3339,string,double
|
||||
#group,false,false,true,true,true,true,false
|
||||
#default,_result,,,,,,
|
||||
,result,table,_start,_stop,_time,_field,theValue
|
||||
,,1,2018-05-22T19:53:00Z,2018-05-22T19:54:00Z,2018-05-22T19:53:00Z,x_duration_seconds,0
|
||||
,,1,2018-05-22T19:53:00Z,2018-05-22T19:54:00Z,2018-05-22T19:53:00Z,x_duration_seconds,1
|
||||
,,2,2018-05-22T19:53:00Z,2018-05-22T19:54:00Z,2018-05-22T19:53:00Z,y_duration_seconds,0
|
||||
,,2,2018-05-22T19:53:00Z,2018-05-22T19:54:00Z,2018-05-22T19:53:00Z,y_duration_seconds,0
|
||||
,,2,2018-05-22T19:53:00Z,2018-05-22T19:54:00Z,2018-05-22T19:53:00Z,y_duration_seconds,1.5
|
||||
"
|
||||
outData = "
|
||||
#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,dateTime:RFC3339,string,double,double
|
||||
#group,false,false,true,true,true,true,false,false
|
||||
#default,_result,,,,,,,
|
||||
,result,table,_start,_stop,_time,_field,ub,theCount
|
||||
,,0,2018-05-22T19:53:00Z,2018-05-22T19:54:00Z,2018-05-22T19:53:00Z,x_duration_seconds,-1,0
|
||||
,,0,2018-05-22T19:53:00Z,2018-05-22T19:54:00Z,2018-05-22T19:53:00Z,x_duration_seconds,0,0.5
|
||||
,,0,2018-05-22T19:53:00Z,2018-05-22T19:54:00Z,2018-05-22T19:53:00Z,x_duration_seconds,1,1
|
||||
,,0,2018-05-22T19:53:00Z,2018-05-22T19:54:00Z,2018-05-22T19:53:00Z,x_duration_seconds,2,1
|
||||
,,1,2018-05-22T19:53:00Z,2018-05-22T19:54:00Z,2018-05-22T19:53:00Z,y_duration_seconds,-1,0
|
||||
,,1,2018-05-22T19:53:00Z,2018-05-22T19:54:00Z,2018-05-22T19:53:00Z,y_duration_seconds,0,0.6666666666666666
|
||||
,,1,2018-05-22T19:53:00Z,2018-05-22T19:54:00Z,2018-05-22T19:53:00Z,y_duration_seconds,1,0.6666666666666666
|
||||
,,1,2018-05-22T19:53:00Z,2018-05-22T19:54:00Z,2018-05-22T19:53:00Z,y_duration_seconds,2,1
|
||||
"
|
||||
|
||||
t_histogram = (table=<-) =>
|
||||
table
|
||||
|> histogram(bins:[-1.0,0.0,1.0,2.0],
|
||||
normalize:true,
|
||||
column: "theValue",
|
||||
countColumn: "theCount",
|
||||
upperBoundColumn: "ub")
|
||||
|
||||
testingTest(name: "histogram",
|
||||
input: testLoadStorage(csv: inData),
|
||||
want: testLoadMem(csv: outData),
|
||||
test: t_histogram)
|
|
@ -0,0 +1,41 @@
|
|||
inData = "
|
||||
#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,dateTime:RFC3339,string,double,double
|
||||
#group,false,false,true,true,true,true,false,false
|
||||
#default,_result,,,,,,,
|
||||
,result,table,_start,_stop,_time,_field,_value,le
|
||||
,,1,2018-05-22T19:53:00Z,2018-05-22T19:54:00Z,2018-05-22T19:53:00Z,x_duration_seconds,1,0.1
|
||||
,,1,2018-05-22T19:53:00Z,2018-05-22T19:54:00Z,2018-05-22T19:53:00Z,x_duration_seconds,2,0.2
|
||||
,,1,2018-05-22T19:53:00Z,2018-05-22T19:54:00Z,2018-05-22T19:53:00Z,x_duration_seconds,2,0.3
|
||||
,,1,2018-05-22T19:53:00Z,2018-05-22T19:54:00Z,2018-05-22T19:53:00Z,x_duration_seconds,2,0.4
|
||||
,,1,2018-05-22T19:53:00Z,2018-05-22T19:54:00Z,2018-05-22T19:53:00Z,x_duration_seconds,2,0.5
|
||||
,,1,2018-05-22T19:53:00Z,2018-05-22T19:54:00Z,2018-05-22T19:53:00Z,x_duration_seconds,2,0.6
|
||||
,,1,2018-05-22T19:53:00Z,2018-05-22T19:54:00Z,2018-05-22T19:53:00Z,x_duration_seconds,2,0.7
|
||||
,,1,2018-05-22T19:53:00Z,2018-05-22T19:54:00Z,2018-05-22T19:53:00Z,x_duration_seconds,8,0.8
|
||||
,,1,2018-05-22T19:53:00Z,2018-05-22T19:54:00Z,2018-05-22T19:53:00Z,x_duration_seconds,10,0.9
|
||||
,,1,2018-05-22T19:53:00Z,2018-05-22T19:54:00Z,2018-05-22T19:53:00Z,x_duration_seconds,10,+Inf
|
||||
,,2,2018-05-22T19:53:00Z,2018-05-22T19:54:00Z,2018-05-22T19:53:00Z,y_duration_seconds,0,-Inf
|
||||
,,2,2018-05-22T19:53:00Z,2018-05-22T19:54:00Z,2018-05-22T19:53:00Z,y_duration_seconds,10,0.2
|
||||
,,2,2018-05-22T19:53:00Z,2018-05-22T19:54:00Z,2018-05-22T19:53:00Z,y_duration_seconds,15,0.4
|
||||
,,2,2018-05-22T19:53:00Z,2018-05-22T19:54:00Z,2018-05-22T19:53:00Z,y_duration_seconds,25,0.6
|
||||
,,2,2018-05-22T19:53:00Z,2018-05-22T19:54:00Z,2018-05-22T19:53:00Z,y_duration_seconds,35,0.8
|
||||
,,2,2018-05-22T19:53:00Z,2018-05-22T19:54:00Z,2018-05-22T19:53:00Z,y_duration_seconds,45,1.0
|
||||
,,2,2018-05-22T19:53:00Z,2018-05-22T19:54:00Z,2018-05-22T19:53:00Z,y_duration_seconds,45,+Inf
|
||||
"
|
||||
outData = "
|
||||
#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,dateTime:RFC3339,string,double
|
||||
#group,false,false,true,true,true,true,false
|
||||
#default,_result,,,,,,
|
||||
,result,table,_start,_stop,_time,_field,_value
|
||||
,,0,2018-05-22T19:53:00Z,2018-05-22T19:54:00Z,2018-05-22T19:53:00Z,x_duration_seconds,0.8500000000000001
|
||||
,,1,2018-05-22T19:53:00Z,2018-05-22T19:54:00Z,2018-05-22T19:53:00Z,y_duration_seconds,0.91
|
||||
"
|
||||
|
||||
t_histogram_quantile = (table=<-) =>
|
||||
table
|
||||
|> range(start: 2018-05-22T19:53:00Z)
|
||||
|> histogramQuantile(quantile:0.90,upperBoundColumn:"le")
|
||||
|
||||
testingTest(name: "histogram_quantile",
|
||||
input: testLoadStorage(csv: inData),
|
||||
want: testLoadMem(csv: outData),
|
||||
test: t_histogram_quantile)
|
|
@ -0,0 +1,53 @@
|
|||
inData = "
|
||||
#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,dateTime:RFC3339,double,string,string,string,string
|
||||
#group,false,false,false,false,false,false,true,true,true,true
|
||||
#default,_result,,,,,,,,,
|
||||
,result,table,_start,_stop,_time,_value,_field,_measurement,cpu,host
|
||||
,,0,2018-05-22T19:53:24.421470485Z,2018-05-22T19:55:00Z,2018-05-22T19:53:26Z,1,usage_guest,cpu,cpu-total,host.local
|
||||
,,0,2018-05-22T19:53:24.421470485Z,2018-05-22T19:55:00Z,2018-05-22T19:53:36Z,2,usage_guest,cpu,cpu-total,host.local
|
||||
,,0,2018-05-22T19:53:24.421470485Z,2018-05-22T19:55:00Z,2018-05-22T19:53:46Z,3,usage_guest,cpu,cpu-total,host.local
|
||||
,,0,2018-05-22T19:53:24.421470485Z,2018-05-22T19:55:00Z,2018-05-22T19:53:56Z,5,usage_guest,cpu,cpu-total,host.local
|
||||
,,0,2018-05-22T19:53:24.421470485Z,2018-05-22T19:55:00Z,2018-05-22T19:54:06Z,0,usage_guest,cpu,cpu-total,host.local
|
||||
,,0,2018-05-22T19:53:24.421470485Z,2018-05-22T19:55:00Z,2018-05-22T19:54:16Z,1,usage_guest,cpu,cpu-total,host.local
|
||||
,,1,2018-05-22T19:53:24.421470485Z,2018-05-22T19:55:00Z,2018-05-22T19:53:26Z,2,usage_guest_nice,cpu,cpu-total,host.local
|
||||
,,1,2018-05-22T19:53:24.421470485Z,2018-05-22T19:55:00Z,2018-05-22T19:53:36Z,4,usage_guest_nice,cpu,cpu-total,host.local
|
||||
,,1,2018-05-22T19:53:24.421470485Z,2018-05-22T19:55:00Z,2018-05-22T19:53:46Z,4,usage_guest_nice,cpu,cpu-total,host.local
|
||||
,,1,2018-05-22T19:53:24.421470485Z,2018-05-22T19:55:00Z,2018-05-22T19:53:56Z,0,usage_guest_nice,cpu,cpu-total,host.local
|
||||
,,1,2018-05-22T19:53:24.421470485Z,2018-05-22T19:55:00Z,2018-05-22T19:54:06Z,2,usage_guest_nice,cpu,cpu-total,host.local
|
||||
,,1,2018-05-22T19:53:24.421470485Z,2018-05-22T19:55:00Z,2018-05-22T19:54:16Z,10,usage_guest_nice,cpu,cpu-total,host.local
|
||||
,,1,2018-05-22T19:53:24.421470485Z,2018-05-22T19:55:00Z,2018-05-22T19:54:26Z,4,usage_guest_nice,cpu,cpu-total,host.local
|
||||
,,1,2018-05-22T19:53:24.421470485Z,2018-05-22T19:55:00Z,2018-05-22T19:54:36Z,20,usage_guest_nice,cpu,cpu-total,host.local
|
||||
,,1,2018-05-22T19:53:24.421470485Z,2018-05-22T19:55:00Z,2018-05-22T19:54:46Z,7,usage_guest_nice,cpu,cpu-total,host.local
|
||||
,,1,2018-05-22T19:53:24.421470485Z,2018-05-22T19:55:00Z,2018-05-22T19:54:56Z,10,usage_guest_nice,cpu,cpu-total,host.local
|
||||
"
|
||||
outData = "
|
||||
#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,dateTime:RFC3339,double,string,string,string,string
|
||||
#group,false,false,false,false,false,false,true,true,true,true
|
||||
#default,_result,,,,,,,,,
|
||||
,result,table,_start,_stop,_time,_value,_field,_measurement,cpu,host
|
||||
,,0,2018-05-22T19:53:26Z,2018-05-22T19:55:00Z,2018-05-22T19:53:36Z,1,usage_guest,cpu,cpu-total,host.local
|
||||
,,0,2018-05-22T19:53:26Z,2018-05-22T19:55:00Z,2018-05-22T19:53:46Z,2,usage_guest,cpu,cpu-total,host.local
|
||||
,,0,2018-05-22T19:53:26Z,2018-05-22T19:55:00Z,2018-05-22T19:53:56Z,4,usage_guest,cpu,cpu-total,host.local
|
||||
,,0,2018-05-22T19:53:26Z,2018-05-22T19:55:00Z,2018-05-22T19:54:06Z,4,usage_guest,cpu,cpu-total,host.local
|
||||
,,0,2018-05-22T19:53:26Z,2018-05-22T19:55:00Z,2018-05-22T19:54:16Z,5,usage_guest,cpu,cpu-total,host.local
|
||||
,,1,2018-05-22T19:53:26Z,2018-05-22T19:55:00Z,2018-05-22T19:53:36Z,2,usage_guest_nice,cpu,cpu-total,host.local
|
||||
,,1,2018-05-22T19:53:26Z,2018-05-22T19:55:00Z,2018-05-22T19:53:46Z,2,usage_guest_nice,cpu,cpu-total,host.local
|
||||
,,1,2018-05-22T19:53:26Z,2018-05-22T19:55:00Z,2018-05-22T19:53:56Z,2,usage_guest_nice,cpu,cpu-total,host.local
|
||||
,,1,2018-05-22T19:53:26Z,2018-05-22T19:55:00Z,2018-05-22T19:54:06Z,4,usage_guest_nice,cpu,cpu-total,host.local
|
||||
,,1,2018-05-22T19:53:26Z,2018-05-22T19:55:00Z,2018-05-22T19:54:16Z,12,usage_guest_nice,cpu,cpu-total,host.local
|
||||
,,1,2018-05-22T19:53:26Z,2018-05-22T19:55:00Z,2018-05-22T19:54:26Z,16,usage_guest_nice,cpu,cpu-total,host.local
|
||||
,,1,2018-05-22T19:53:26Z,2018-05-22T19:55:00Z,2018-05-22T19:54:36Z,32,usage_guest_nice,cpu,cpu-total,host.local
|
||||
,,1,2018-05-22T19:53:26Z,2018-05-22T19:55:00Z,2018-05-22T19:54:46Z,39,usage_guest_nice,cpu,cpu-total,host.local
|
||||
,,1,2018-05-22T19:53:26Z,2018-05-22T19:55:00Z,2018-05-22T19:54:56Z,42,usage_guest_nice,cpu,cpu-total,host.local
|
||||
"
|
||||
|
||||
t_increase = (table=<-) =>
|
||||
table
|
||||
|> range(start:2018-05-22T19:53:26Z)
|
||||
|> increase()
|
||||
|
||||
|
||||
testingTest(name: "increase",
|
||||
input: testLoadStorage(csv: inData),
|
||||
want: testLoadMem(csv: outData),
|
||||
test: t_increase)
|
|
@ -0,0 +1,63 @@
|
|||
inData = "
|
||||
#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,dateTime:RFC3339,double,string,string,string
|
||||
#group,false,false,true,true,false,false,true,true,true
|
||||
#default,_result,,,,,,,,
|
||||
,result,table,_start,_stop,_time,_value,_field,_measurement,host
|
||||
,,161,2018-05-22T19:53:26Z,2018-05-22T19:54:16Z,2018-05-22T19:53:26Z,82.9833984375,used_percent,swap,host.local
|
||||
,,161,2018-05-22T19:53:26Z,2018-05-22T19:54:16Z,2018-05-22T19:53:36Z,82.598876953125,used_percent,swap,host.local
|
||||
,,161,2018-05-22T19:53:26Z,2018-05-22T19:54:16Z,2018-05-22T19:53:46Z,82.598876953125,used_percent,swap,host.local
|
||||
,,161,2018-05-22T19:53:26Z,2018-05-22T19:54:16Z,2018-05-22T19:53:56Z,82.598876953125,used_percent,swap,host.local
|
||||
,,161,2018-05-22T19:53:26Z,2018-05-22T19:54:16Z,2018-05-22T19:54:06Z,82.598876953125,used_percent,swap,host.local
|
||||
,,161,2018-05-22T19:53:26Z,2018-05-22T19:54:16Z,2018-05-22T19:54:16Z,82.6416015625,used_percent,swap,host.local
|
||||
,,162,2018-05-22T19:53:26Z,2018-05-22T19:54:16Z,2018-05-22T19:53:26Z,1.83,load1,system,host.local
|
||||
,,162,2018-05-22T19:53:26Z,2018-05-22T19:54:16Z,2018-05-22T19:53:36Z,1.7,load1,system,host.local
|
||||
,,162,2018-05-22T19:53:26Z,2018-05-22T19:54:16Z,2018-05-22T19:53:46Z,1.74,load1,system,host.local
|
||||
,,162,2018-05-22T19:53:26Z,2018-05-22T19:54:16Z,2018-05-22T19:53:56Z,1.63,load1,system,host.local
|
||||
,,162,2018-05-22T19:53:26Z,2018-05-22T19:54:16Z,2018-05-22T19:54:06Z,1.91,load1,system,host.local
|
||||
,,162,2018-05-22T19:53:26Z,2018-05-22T19:54:16Z,2018-05-22T19:54:16Z,1.84,load1,system,host.local
|
||||
,,163,2018-05-22T19:53:26Z,2018-05-22T19:54:16Z,2018-05-22T19:53:26Z,1.98,load15,system,host.local
|
||||
,,163,2018-05-22T19:53:26Z,2018-05-22T19:54:16Z,2018-05-22T19:53:36Z,1.97,load15,system,host.local
|
||||
,,163,2018-05-22T19:53:26Z,2018-05-22T19:54:16Z,2018-05-22T19:53:46Z,1.97,load15,system,host.local
|
||||
,,163,2018-05-22T19:53:26Z,2018-05-22T19:54:16Z,2018-05-22T19:53:56Z,1.96,load15,system,host.local
|
||||
,,163,2018-05-22T19:53:26Z,2018-05-22T19:54:16Z,2018-05-22T19:54:06Z,1.98,load15,system,host.local
|
||||
,,163,2018-05-22T19:53:26Z,2018-05-22T19:54:16Z,2018-05-22T19:54:16Z,1.97,load15,system,host.local
|
||||
,,164,2018-05-22T19:53:26Z,2018-05-22T19:54:16Z,2018-05-22T19:53:26Z,1.95,load5,system,host.local
|
||||
,,164,2018-05-22T19:53:26Z,2018-05-22T19:54:16Z,2018-05-22T19:53:36Z,1.92,load5,system,host.local
|
||||
,,164,2018-05-22T19:53:26Z,2018-05-22T19:54:16Z,2018-05-22T19:53:46Z,1.92,load5,system,host.local
|
||||
,,164,2018-05-22T19:53:26Z,2018-05-22T19:54:16Z,2018-05-22T19:53:56Z,1.89,load5,system,host.local
|
||||
,,164,2018-05-22T19:53:26Z,2018-05-22T19:54:16Z,2018-05-22T19:54:06Z,1.94,load5,system,host.local
|
||||
,,164,2018-05-22T19:53:26Z,2018-05-22T19:54:16Z,2018-05-22T19:54:16Z,1.93,load5,system,host.local
|
||||
"
|
||||
outData = "
|
||||
#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,dateTime:RFC3339,string,string,double
|
||||
#group,false,false,true,true,false,true,true,false
|
||||
#default,0,,,,,,,
|
||||
,result,table,_start,_stop,_time,_measurement,host,used_percent
|
||||
,,0,2018-05-22T19:53:26Z,2018-05-22T19:54:16Z,2018-05-22T19:53:26Z,swap,host.local,82.9833984375
|
||||
,,0,2018-05-22T19:53:26Z,2018-05-22T19:54:16Z,2018-05-22T19:53:36Z,swap,host.local,82.598876953125
|
||||
,,0,2018-05-22T19:53:26Z,2018-05-22T19:54:16Z,2018-05-22T19:53:46Z,swap,host.local,82.598876953125
|
||||
,,0,2018-05-22T19:53:26Z,2018-05-22T19:54:16Z,2018-05-22T19:53:56Z,swap,host.local,82.598876953125
|
||||
,,0,2018-05-22T19:53:26Z,2018-05-22T19:54:16Z,2018-05-22T19:54:06Z,swap,host.local,82.598876953125
|
||||
,,0,2018-05-22T19:53:26Z,2018-05-22T19:54:16Z,2018-05-22T19:54:16Z,swap,host.local,82.6416015625
|
||||
|
||||
#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,dateTime:RFC3339,string,string,double,double,double
|
||||
#group,false,false,true,true,false,true,true,false,false,false
|
||||
#default,0,,,,,,,,,
|
||||
,result,table,_start,_stop,_time,_measurement,host,load1,load15,load5
|
||||
,,1,2018-05-22T19:53:26Z,2018-05-22T19:54:16Z,2018-05-22T19:53:26Z,system,host.local,1.83,1.98,1.95
|
||||
,,1,2018-05-22T19:53:26Z,2018-05-22T19:54:16Z,2018-05-22T19:53:36Z,system,host.local,1.7,1.97,1.92
|
||||
,,1,2018-05-22T19:53:26Z,2018-05-22T19:54:16Z,2018-05-22T19:53:46Z,system,host.local,1.74,1.97,1.92
|
||||
,,1,2018-05-22T19:53:26Z,2018-05-22T19:54:16Z,2018-05-22T19:53:56Z,system,host.local,1.63,1.96,1.89
|
||||
,,1,2018-05-22T19:53:26Z,2018-05-22T19:54:16Z,2018-05-22T19:54:06Z,system,host.local,1.91,1.98,1.94
|
||||
,,1,2018-05-22T19:53:26Z,2018-05-22T19:54:16Z,2018-05-22T19:54:16Z,system,host.local,1.84,1.97,1.93
|
||||
"
|
||||
|
||||
t_influxFieldsAsCols = (table=<-) =>
|
||||
table
|
||||
|> range(start: 2018-05-22T19:53:26Z, stop: 2018-05-22T19:54:17Z)
|
||||
|> influxFieldsAsCols()
|
||||
|> yield(name:"0")
|
||||
testingTest(name: "influxFieldsAsCols",
|
||||
input: testLoadStorage(csv: inData),
|
||||
want: testLoadMem(csv: outData),
|
||||
test: t_influxFieldsAsCols)
|
|
@ -0,0 +1,54 @@
|
|||
inData = "
|
||||
#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,dateTime:RFC3339,double,string,string
|
||||
#group,false,false,false,false,false,false,true,true
|
||||
#default,_result,,,,,,,
|
||||
,result,table,_start,_stop,_time,_value,_measurement,user
|
||||
,,0,2018-05-22T19:53:00Z,2018-05-22T19:55:00Z,2018-05-22T19:53:26Z,1,RAM,user1
|
||||
,,0,2018-05-22T19:53:00Z,2018-05-22T19:55:00Z,2018-05-22T19:53:36Z,2,RAM,user1
|
||||
,,0,2018-05-22T19:53:00Z,2018-05-22T19:55:00Z,2018-05-22T19:53:46Z,3,RAM,user1
|
||||
,,0,2018-05-22T19:53:00Z,2018-05-22T19:55:00Z,2018-05-22T19:53:56Z,5,RAM,user1
|
||||
,,1,2018-05-22T19:53:00Z,2018-05-22T19:55:00Z,2018-05-22T19:53:26Z,0,CPU,user1
|
||||
,,1,2018-05-22T19:53:00Z,2018-05-22T19:55:00Z,2018-05-22T19:53:36Z,1,CPU,user1
|
||||
,,2,2018-05-22T19:53:00Z,2018-05-22T19:55:00Z,2018-05-22T19:53:26Z,2,RAM,user2
|
||||
,,2,2018-05-22T19:53:00Z,2018-05-22T19:55:00Z,2018-05-22T19:53:36Z,4,RAM,user2
|
||||
,,2,2018-05-22T19:53:00Z,2018-05-22T19:55:00Z,2018-05-22T19:53:46Z,4,RAM,user2
|
||||
,,2,2018-05-22T19:53:00Z,2018-05-22T19:55:00Z,2018-05-22T19:53:56Z,0,RAM,user2
|
||||
,,2,2018-05-22T19:53:00Z,2018-05-22T19:55:00Z,2018-05-22T19:54:06Z,2,RAM,user2
|
||||
,,2,2018-05-22T19:53:00Z,2018-05-22T19:55:00Z,2018-05-22T19:54:16Z,10,RAM,user2
|
||||
,,3,2018-05-22T19:53:00Z,2018-05-22T19:55:00Z,2018-05-22T19:53:26Z,4,CPU,user2
|
||||
,,3,2018-05-22T19:53:00Z,2018-05-22T19:55:00Z,2018-05-22T19:53:36Z,20,CPU,user2
|
||||
,,3,2018-05-22T19:53:00Z,2018-05-22T19:55:00Z,2018-05-22T19:53:46Z,7,CPU,user2
|
||||
,,3,2018-05-22T19:53:00Z,2018-05-22T19:55:00Z,2018-05-22T19:53:56Z,10,CPU,user2
|
||||
"
|
||||
outData = "
|
||||
#datatype,string,long,string,dateTime:RFC3339,double,double,string,string
|
||||
#group,false,false,true,false,false,false,true,false
|
||||
#default,_result,,,,,,,
|
||||
,result,table,_measurement,_time,_value_left,_value_right,user_left,user_right
|
||||
,,0,CPU,2018-05-22T19:53:26Z,0,4,user1,user2
|
||||
,,0,CPU,2018-05-22T19:53:36Z,1,20,user1,user2
|
||||
,,1,RAM,2018-05-22T19:53:26Z,1,2,user1,user2
|
||||
,,1,RAM,2018-05-22T19:53:36Z,2,4,user1,user2
|
||||
,,1,RAM,2018-05-22T19:53:46Z,3,4,user1,user2
|
||||
,,1,RAM,2018-05-22T19:53:56Z,5,0,user1,user2
|
||||
"
|
||||
|
||||
t_join = () => {
|
||||
left = testLoadStorage(csv: inData)
|
||||
|> range(start:2018-05-22T19:53:00Z, stop:2018-05-22T19:55:00Z)
|
||||
|> drop(columns: ["_start", "_stop"])
|
||||
|> filter(fn: (r) => r.user == "user1")
|
||||
|> group(columns: ["user"])
|
||||
|
||||
right = testLoadStorage(csv: inData)
|
||||
|> range(start:2018-05-22T19:53:00Z, stop:2018-05-22T19:55:00Z)
|
||||
|> drop(columns: ["_start", "_stop"])
|
||||
|> filter(fn: (r) => r.user == "user2")
|
||||
|> group(columns: ["_measurement"])
|
||||
|
||||
got = join(tables: {left:left, right:right}, on: ["_time", "_measurement"])
|
||||
want = testLoadMem(csv: outData)
|
||||
return assertEquals(name: "join", want: want, got: got)
|
||||
}
|
||||
|
||||
t_join()
|
|
@ -0,0 +1,191 @@
|
|||
inData = "
|
||||
#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,dateTime:RFC3339,long,string,string,string
|
||||
#group,false,false,false,false,false,false,true,true,true
|
||||
#default,_result,,,,,,,,
|
||||
,result,table,_start,_stop,_time,_value,_field,_measurement,host
|
||||
,,138,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:26Z,6535598080,active,mem,host.local
|
||||
,,138,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:36Z,6390587392,active,mem,host.local
|
||||
,,138,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:46Z,6445174784,active,mem,host.local
|
||||
,,138,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:56Z,6387265536,active,mem,host.local
|
||||
,,138,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:54:06Z,6375489536,active,mem,host.local
|
||||
,,138,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:54:16Z,6427201536,active,mem,host.local
|
||||
,,139,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:26Z,6347390976,available,mem,host.local
|
||||
,,139,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:36Z,6405451776,available,mem,host.local
|
||||
,,139,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:46Z,6461759488,available,mem,host.local
|
||||
,,139,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:56Z,6400196608,available,mem,host.local
|
||||
,,139,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:54:06Z,6394032128,available,mem,host.local
|
||||
,,139,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:54:16Z,6448041984,available,mem,host.local
|
||||
|
||||
#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,dateTime:RFC3339,double,string,string,string
|
||||
#group,false,false,false,false,false,false,true,true,true
|
||||
#default,_result,,,,,,,,
|
||||
,result,table,_start,_stop,_time,_value,_field,_measurement,host
|
||||
,,140,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:26Z,36.946678161621094,available_percent,mem,host.local
|
||||
,,140,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:36Z,37.28463649749756,available_percent,mem,host.local
|
||||
,,140,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:46Z,37.61239051818848,available_percent,mem,host.local
|
||||
,,140,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:56Z,37.25404739379883,available_percent,mem,host.local
|
||||
,,140,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:54:06Z,37.21816539764404,available_percent,mem,host.local
|
||||
,,140,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:54:16Z,37.53254413604736,available_percent,mem,host.local
|
||||
|
||||
#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,dateTime:RFC3339,long,string,string,string
|
||||
#group,false,false,false,false,false,false,true,true,true
|
||||
#default,_result,,,,,,,,
|
||||
,result,table,_start,_stop,_time,_value,_field,_measurement,host
|
||||
,,141,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:26Z,0,buffered,mem,host.local
|
||||
,,141,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:36Z,0,buffered,mem,host.local
|
||||
,,141,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:46Z,0,buffered,mem,host.local
|
||||
,,141,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:56Z,0,buffered,mem,host.local
|
||||
,,141,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:54:06Z,0,buffered,mem,host.local
|
||||
,,141,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:54:16Z,0,buffered,mem,host.local
|
||||
,,142,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:26Z,0,cached,mem,host.local
|
||||
,,142,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:36Z,0,cached,mem,host.local
|
||||
,,142,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:46Z,0,cached,mem,host.local
|
||||
,,142,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:56Z,0,cached,mem,host.local
|
||||
,,142,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:54:06Z,0,cached,mem,host.local
|
||||
,,142,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:54:16Z,0,cached,mem,host.local
|
||||
,,143,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:26Z,54624256,free,mem,host.local
|
||||
,,143,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:36Z,17481728,free,mem,host.local
|
||||
,,143,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:46Z,17805312,free,mem,host.local
|
||||
,,143,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:56Z,16089088,free,mem,host.local
|
||||
,,143,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:54:06Z,20774912,free,mem,host.local
|
||||
,,143,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:54:16Z,20930560,free,mem,host.local
|
||||
,,144,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:26Z,6292766720,inactive,mem,host.local
|
||||
,,144,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:36Z,6387970048,inactive,mem,host.local
|
||||
,,144,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:46Z,6443954176,inactive,mem,host.local
|
||||
,,144,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:56Z,6384107520,inactive,mem,host.local
|
||||
,,144,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:54:06Z,6373257216,inactive,mem,host.local
|
||||
,,144,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:54:16Z,6427111424,inactive,mem,host.local
|
||||
,,145,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:26Z,17179869184,total,mem,host.local
|
||||
,,145,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:36Z,17179869184,total,mem,host.local
|
||||
,,145,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:46Z,17179869184,total,mem,host.local
|
||||
,,145,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:56Z,17179869184,total,mem,host.local
|
||||
,,145,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:54:06Z,17179869184,total,mem,host.local
|
||||
,,145,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:54:16Z,17179869184,total,mem,host.local
|
||||
,,146,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:26Z,10832478208,used,mem,host.local
|
||||
,,146,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:36Z,10774417408,used,mem,host.local
|
||||
,,146,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:46Z,10718109696,used,mem,host.local
|
||||
,,146,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:56Z,10779672576,used,mem,host.local
|
||||
,,146,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:54:06Z,10785837056,used,mem,host.local
|
||||
,,146,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:54:16Z,10731827200,used,mem,host.local
|
||||
|
||||
#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,dateTime:RFC3339,double,string,string,string
|
||||
#group,false,false,false,false,false,false,true,true,true
|
||||
#default,_result,,,,,,,,
|
||||
,result,table,_start,_stop,_time,_value,_field,_measurement,host
|
||||
,,147,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:26Z,63.053321838378906,used_percent,mem,host.local
|
||||
,,147,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:36Z,62.71536350250244,used_percent,mem,host.local
|
||||
,,147,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:46Z,62.38760948181152,used_percent,mem,host.local
|
||||
,,147,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:56Z,62.74595260620117,used_percent,mem,host.local
|
||||
,,147,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:54:06Z,62.78183460235596,used_percent,mem,host.local
|
||||
,,147,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:54:16Z,62.46745586395264,used_percent,mem,host.local
|
||||
|
||||
#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,dateTime:RFC3339,long,string,string,string
|
||||
#group,false,false,false,false,false,false,true,true,true
|
||||
#default,_result,,,,,,,,
|
||||
,result,table,_start,_stop,_time,_value,_field,_measurement,host
|
||||
,,148,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:26Z,0,blocked,processes,host.local
|
||||
,,148,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:36Z,0,blocked,processes,host.local
|
||||
,,148,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:46Z,0,blocked,processes,host.local
|
||||
,,148,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:56Z,2,blocked,processes,host.local
|
||||
,,148,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:54:06Z,0,blocked,processes,host.local
|
||||
,,148,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:54:16Z,0,blocked,processes,host.local
|
||||
,,149,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:26Z,0,idle,processes,host.local
|
||||
,,149,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:36Z,0,idle,processes,host.local
|
||||
,,149,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:46Z,0,idle,processes,host.local
|
||||
,,149,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:56Z,0,idle,processes,host.local
|
||||
,,149,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:54:06Z,0,idle,processes,host.local
|
||||
,,149,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:54:16Z,0,idle,processes,host.local
|
||||
,,150,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:26Z,3,running,processes,host.local
|
||||
,,150,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:36Z,1,running,processes,host.local
|
||||
,,150,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:46Z,1,running,processes,host.local
|
||||
,,150,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:56Z,2,running,processes,host.local
|
||||
,,150,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:54:06Z,2,running,processes,host.local
|
||||
,,150,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:54:16Z,3,running,processes,host.local
|
||||
,,151,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:26Z,414,sleeping,processes,host.local
|
||||
,,151,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:36Z,415,sleeping,processes,host.local
|
||||
,,151,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:46Z,415,sleeping,processes,host.local
|
||||
,,151,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:56Z,414,sleeping,processes,host.local
|
||||
,,151,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:54:06Z,415,sleeping,processes,host.local
|
||||
,,151,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:54:16Z,414,sleeping,processes,host.local
|
||||
,,152,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:26Z,0,stopped,processes,host.local
|
||||
,,152,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:36Z,0,stopped,processes,host.local
|
||||
,,152,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:46Z,0,stopped,processes,host.local
|
||||
,,152,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:56Z,0,stopped,processes,host.local
|
||||
,,152,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:54:06Z,0,stopped,processes,host.local
|
||||
,,152,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:54:16Z,0,stopped,processes,host.local
|
||||
,,153,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:26Z,417,total,processes,host.local
|
||||
,,153,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:36Z,416,total,processes,host.local
|
||||
,,153,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:46Z,416,total,processes,host.local
|
||||
,,153,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:56Z,418,total,processes,host.local
|
||||
,,153,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:54:06Z,418,total,processes,host.local
|
||||
,,153,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:54:16Z,417,total,processes,host.local
|
||||
,,154,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:26Z,0,unknown,processes,host.local
|
||||
,,154,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:36Z,0,unknown,processes,host.local
|
||||
,,154,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:46Z,0,unknown,processes,host.local
|
||||
,,154,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:56Z,0,unknown,processes,host.local
|
||||
,,154,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:54:06Z,1,unknown,processes,host.local
|
||||
,,154,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:54:16Z,0,unknown,processes,host.local
|
||||
,,155,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:26Z,0,zombies,processes,host.local
|
||||
,,155,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:36Z,0,zombies,processes,host.local
|
||||
,,155,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:46Z,0,zombies,processes,host.local
|
||||
,,155,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:56Z,0,zombies,processes,host.local
|
||||
,,155,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:54:06Z,0,zombies,processes,host.local
|
||||
,,155,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:54:16Z,0,zombies,processes,host.local
|
||||
,,156,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:26Z,1461714944,free,swap,host.local
|
||||
,,156,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:36Z,1494745088,free,swap,host.local
|
||||
,,156,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:46Z,1494745088,free,swap,host.local
|
||||
,,156,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:56Z,1494745088,free,swap,host.local
|
||||
,,156,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:54:06Z,1494745088,free,swap,host.local
|
||||
,,156,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:54:16Z,1491075072,free,swap,host.local
|
||||
,,157,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:26Z,0,in,swap,host.local
|
||||
,,157,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:36Z,0,in,swap,host.local
|
||||
,,157,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:46Z,0,in,swap,host.local
|
||||
,,157,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:56Z,0,in,swap,host.local
|
||||
,,157,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:54:06Z,0,in,swap,host.local
|
||||
,,157,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:54:16Z,0,in,swap,host.local
|
||||
,,158,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:26Z,0,out,swap,host.local
|
||||
,,158,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:36Z,0,out,swap,host.local
|
||||
,,158,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:46Z,0,out,swap,host.local
|
||||
,,158,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:56Z,0,out,swap,host.local
|
||||
,,158,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:54:06Z,0,out,swap,host.local
|
||||
,,158,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:54:16Z,0,out,swap,host.local
|
||||
,,159,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:26Z,8589934592,total,swap,host.local
|
||||
,,159,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:36Z,8589934592,total,swap,host.local
|
||||
,,159,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:46Z,8589934592,total,swap,host.local
|
||||
,,159,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:56Z,8589934592,total,swap,host.local
|
||||
,,159,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:54:06Z,8589934592,total,swap,host.local
|
||||
,,159,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:54:16Z,8589934592,total,swap,host.local
|
||||
,,160,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:26Z,7128219648,used,swap,host.local
|
||||
,,160,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:36Z,7095189504,used,swap,host.local
|
||||
,,160,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:46Z,7095189504,used,swap,host.local
|
||||
,,160,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:56Z,7095189504,used,swap,host.local
|
||||
,,160,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:54:06Z,7095189504,used,swap,host.local
|
||||
,,160,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:54:16Z,7098859520,used,swap,host.local
|
||||
"
|
||||
outData = "
|
||||
#datatype,string,long,string,string,string,string,dateTime:RFC3339,dateTime:RFC3339,dateTime:RFC3339,long,long,string
|
||||
#group,false,false,true,true,true,true,false,false,false,false,false,true
|
||||
#default,_result,,,,,,,,,,,
|
||||
,result,table,_field_mem,_field_proc,_measurement_mem,_measurement_proc,_start,_stop,_time,_value_mem,_value_proc,host
|
||||
,,0,used,total,mem,processes,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:26Z,10832478208,417,host.local
|
||||
,,0,used,total,mem,processes,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:36Z,10774417408,416,host.local
|
||||
,,0,used,total,mem,processes,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:46Z,10718109696,416,host.local
|
||||
,,0,used,total,mem,processes,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:56Z,10779672576,418,host.local
|
||||
,,0,used,total,mem,processes,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:54:06Z,10785837056,418,host.local
|
||||
,,0,used,total,mem,processes,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:54:16Z,10731827200,417,host.local
|
||||
"
|
||||
|
||||
memUsed = testLoadStorage(csv: inData)
|
||||
|> range(start:2018-05-22T19:53:00Z, stop:2018-05-22T19:55:00Z)
|
||||
|> filter(fn: (r) => r._measurement == "mem" and r._field == "used" )
|
||||
|
||||
procTotal = testLoadStorage(csv: inData)
|
||||
|> range(start:2018-05-22T19:53:00Z, stop:2018-05-22T19:55:00Z)
|
||||
|> filter(fn: (r) =>
|
||||
r._measurement == "processes" and
|
||||
r._field == "total"
|
||||
)
|
||||
|
||||
got = join(tables: {mem:memUsed, proc:procTotal}, on: ["_time", "_stop", "_start", "host"])
|
||||
want = testLoadMem(csv: outData)
|
||||
assertEquals(name: "join", want: want, got: got)
|
|
@ -0,0 +1,58 @@
|
|||
inData = "
|
||||
#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,dateTime:RFC3339,double,string,string,string,string
|
||||
#group,false,false,false,false,false,false,true,true,true,true
|
||||
#default,_result,,,,,,,,,
|
||||
,result,table,_start,_stop,_time,_value,_field,_measurement,old,host
|
||||
,,0,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:26Z,0,usage_guest,cpu,cpu-total,host.local
|
||||
,,0,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:36Z,0,usage_guest,cpu,cpu-total,host.local
|
||||
,,0,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:46Z,0,usage_guest,cpu,cpu-total,host.local
|
||||
,,0,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:56Z,0,usage_guest,cpu,cpu-total,host.local
|
||||
,,0,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:54:06Z,0,usage_guest,cpu,cpu-total,host.local
|
||||
,,0,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:54:16Z,0,usage_guest,cpu,cpu-total,host.local
|
||||
,,1,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:26Z,0,usage_guest_nice,cpu,cpu-total,host.local
|
||||
,,1,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:36Z,0,usage_guest_nice,cpu,cpu-total,host.local
|
||||
,,1,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:46Z,0,usage_guest_nice,cpu,cpu-total,host.local
|
||||
,,1,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:56Z,0,usage_guest_nice,cpu,cpu-total,host.local
|
||||
,,1,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:54:06Z,0,usage_guest_nice,cpu,cpu-total,host.local
|
||||
,,1,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:54:16Z,0,usage_guest_nice,cpu,cpu-total,host.local
|
||||
,,2,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:26Z,91.7364670583823,usage_idle,cpu,cpu-total,host.local
|
||||
,,2,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:36Z,89.51118889861233,usage_idle,cpu,cpu-total,host.local
|
||||
,,2,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:46Z,91.0977744436109,usage_idle,cpu,cpu-total,host.local
|
||||
,,2,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:56Z,91.02836436336374,usage_idle,cpu,cpu-total,host.local
|
||||
,,2,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:54:06Z,68.304576144036,usage_idle,cpu,cpu-total,host.local
|
||||
,,2,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:54:16Z,87.88598574821853,usage_idle,cpu,cpu-total,host.local
|
||||
"
|
||||
outData = "
|
||||
#datatype,string,long,dateTime:RFC3339,double,string
|
||||
#group,false,false,false,false,true
|
||||
#default,_result,,,,
|
||||
,result,table,_time,_value,_field
|
||||
,,0,2018-05-22T19:53:26Z,0,usage_guest
|
||||
,,0,2018-05-22T19:53:36Z,0,usage_guest
|
||||
,,0,2018-05-22T19:53:46Z,0,usage_guest
|
||||
,,0,2018-05-22T19:53:56Z,0,usage_guest
|
||||
,,0,2018-05-22T19:54:06Z,0,usage_guest
|
||||
,,0,2018-05-22T19:54:16Z,0,usage_guest
|
||||
,,1,2018-05-22T19:53:26Z,0,usage_guest_nice
|
||||
,,1,2018-05-22T19:53:36Z,0,usage_guest_nice
|
||||
,,1,2018-05-22T19:53:46Z,0,usage_guest_nice
|
||||
,,1,2018-05-22T19:53:56Z,0,usage_guest_nice
|
||||
,,1,2018-05-22T19:54:06Z,0,usage_guest_nice
|
||||
,,1,2018-05-22T19:54:16Z,0,usage_guest_nice
|
||||
,,2,2018-05-22T19:53:26Z,91.7364670583823,usage_idle
|
||||
,,2,2018-05-22T19:53:36Z,89.51118889861233,usage_idle
|
||||
,,2,2018-05-22T19:53:46Z,91.0977744436109,usage_idle
|
||||
,,2,2018-05-22T19:53:56Z,91.02836436336374,usage_idle
|
||||
,,2,2018-05-22T19:54:06Z,68.304576144036,usage_idle
|
||||
,,2,2018-05-22T19:54:16Z,87.88598574821853,usage_idle
|
||||
"
|
||||
|
||||
t_keep = (table=<-) =>
|
||||
table
|
||||
|> range(start: 2018-05-22T19:53:26Z)
|
||||
|> keep(columns: ["_time", "_value", "_field"])
|
||||
|
||||
testingTest(name: "keep",
|
||||
input: testLoadStorage(csv: inData),
|
||||
want: testLoadMem(csv: outData),
|
||||
test: t_keep)
|
|
@ -0,0 +1,59 @@
|
|||
inData = "
|
||||
#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,dateTime:RFC3339,double,string,string,string,string
|
||||
#group,false,false,false,false,false,false,true,true,true,true
|
||||
#default,_result,,,,,,,,,
|
||||
,result,table,_start,_stop,_time,_value,_field,_measurement,old,host
|
||||
,,0,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:26Z,0,usage_guest,cpu,cpu-total,host.local
|
||||
,,0,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:36Z,0,usage_guest,cpu,cpu-total,host.local
|
||||
,,0,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:46Z,0,usage_guest,cpu,cpu-total,host.local
|
||||
,,0,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:56Z,0,usage_guest,cpu,cpu-total,host.local
|
||||
,,0,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:54:06Z,0,usage_guest,cpu,cpu-total,host.local
|
||||
,,0,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:54:16Z,0,usage_guest,cpu,cpu-total,host.local
|
||||
,,1,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:26Z,0,usage_guest_nice,cpu,cpu-total,host.local
|
||||
,,1,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:36Z,0,usage_guest_nice,cpu,cpu-total,host.local
|
||||
,,1,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:46Z,0,usage_guest_nice,cpu,cpu-total,host.local
|
||||
,,1,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:56Z,0,usage_guest_nice,cpu,cpu-total,host.local
|
||||
,,1,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:54:06Z,0,usage_guest_nice,cpu,cpu-total,host.local
|
||||
,,1,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:54:16Z,0,usage_guest_nice,cpu,cpu-total,host.local
|
||||
,,2,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:26Z,91.7364670583823,usage_idle,cpu,cpu-total,host.local
|
||||
,,2,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:36Z,89.51118889861233,usage_idle,cpu,cpu-total,host.local
|
||||
,,2,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:46Z,91.0977744436109,usage_idle,cpu,cpu-total,host.local
|
||||
,,2,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:56Z,91.02836436336374,usage_idle,cpu,cpu-total,host.local
|
||||
,,2,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:54:06Z,68.304576144036,usage_idle,cpu,cpu-total,host.local
|
||||
,,2,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:54:16Z,87.88598574821853,usage_idle,cpu,cpu-total,host.local
|
||||
"
|
||||
outData = "
|
||||
#datatype,string,long,double
|
||||
#group,false,false,false
|
||||
#default,_result,,
|
||||
,result,table,_value
|
||||
,,0,0
|
||||
,,0,0
|
||||
,,0,0
|
||||
,,0,0
|
||||
,,0,0
|
||||
,,0,0
|
||||
,,0,0
|
||||
,,0,0
|
||||
,,0,0
|
||||
,,0,0
|
||||
,,0,0
|
||||
,,0,0
|
||||
,,0,91.7364670583823
|
||||
,,0,89.51118889861233
|
||||
,,0,91.0977744436109
|
||||
,,0,91.02836436336374
|
||||
,,0,68.304576144036
|
||||
,,0,87.88598574821853
|
||||
"
|
||||
|
||||
t_keep_fn = (table=<-) =>
|
||||
table
|
||||
|> range(start: 2018-05-22T19:53:26Z)
|
||||
|> keep(fn: (column) => column == "_field" or column == "_value")
|
||||
|> keep(fn: (column) => {return column == "_value"})
|
||||
|
||||
testingTest(name: "keep_fn",
|
||||
input: testLoadStorage(csv: inData),
|
||||
want: testLoadMem(csv: outData),
|
||||
test: t_keep_fn)
|
|
@ -0,0 +1,46 @@
|
|||
inData = "
|
||||
#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,dateTime:RFC3339,long,string,string,string,string
|
||||
#group,false,false,false,false,false,false,false,false,true,true
|
||||
#default,_result,,,,,,,,,
|
||||
,result,table,_start,_stop,_time,_value,_field,_measurement,host,name
|
||||
,,1,2018-05-22T19:53:26Z,2018-05-22T19:54:16Z,2018-05-22T19:53:26Z,10,io_time,diskio,host.local,disk0
|
||||
,,1,2018-05-22T19:53:26Z,2018-05-22T19:54:16Z,2018-05-22T19:53:36Z,11,io_time,diskio,host.local,disk0
|
||||
,,1,2018-05-22T19:53:26Z,2018-05-22T19:54:16Z,2018-05-22T19:53:46Z,12,io_time,diskio,host.local,disk0
|
||||
,,1,2018-05-22T19:53:26Z,2018-05-22T19:54:16Z,2018-05-22T19:53:56Z,13,io_time,diskio,host.local,disk0
|
||||
,,1,2018-05-22T19:53:26Z,2018-05-22T19:54:16Z,2018-05-22T19:54:06Z,14,io_time,diskio,host.local,disk0
|
||||
,,1,2018-05-22T19:53:26Z,2018-05-22T19:54:16Z,2018-05-22T19:54:16Z,15,io_time,diskio,host.local,disk0
|
||||
,,2,2018-05-22T19:53:26Z,2018-05-22T19:54:16Z,2018-05-22T19:53:26Z,16,io_time,diskio,host.local,disk2
|
||||
,,2,2018-05-22T19:53:26Z,2018-05-22T19:54:16Z,2018-05-22T19:53:36Z,17,io_time,diskio,host.local,disk2
|
||||
,,2,2018-05-22T19:53:26Z,2018-05-22T19:54:16Z,2018-05-22T19:53:46Z,18,io_time,diskio,host.local,disk2
|
||||
,,2,2018-05-22T19:53:26Z,2018-05-22T19:54:16Z,2018-05-22T19:53:56Z,19,io_time,diskio,host.local,disk2
|
||||
,,2,2018-05-22T19:53:26Z,2018-05-22T19:54:16Z,2018-05-22T19:54:06Z,20,io_time,diskio,host.local,disk2
|
||||
,,2,2018-05-22T19:53:26Z,2018-05-22T19:54:16Z,2018-05-22T19:54:16Z,21,io_time,diskio,host.local,disk2
|
||||
"
|
||||
outData = "
|
||||
#datatype,string,long,string,string,string,long
|
||||
#group,false,false,true,true,false,false
|
||||
#default,_result,,,,,
|
||||
,result,table,host,name,_key,_value
|
||||
,,0,host.local,disk0,_value,10
|
||||
,,0,host.local,disk0,_value,11
|
||||
,,0,host.local,disk0,_value,12
|
||||
,,0,host.local,disk0,_value,13
|
||||
,,0,host.local,disk0,_value,14
|
||||
,,0,host.local,disk0,_value,15
|
||||
,,1,host.local,disk2,_value,16
|
||||
,,1,host.local,disk2,_value,17
|
||||
,,1,host.local,disk2,_value,18
|
||||
,,1,host.local,disk2,_value,19
|
||||
,,1,host.local,disk2,_value,20
|
||||
,,1,host.local,disk2,_value,21
|
||||
"
|
||||
|
||||
t_key_values = (table=<-) =>
|
||||
table
|
||||
|> keyValues(keyColumns: ["_value"])
|
||||
|
||||
testingTest(name: "key_values",
|
||||
input: testLoadStorage(csv: inData),
|
||||
want: testLoadMem(csv: outData),
|
||||
test: t_key_values,
|
||||
)
|
|
@ -0,0 +1,62 @@
|
|||
inData = "
|
||||
#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,dateTime:RFC3339,string,string,string
|
||||
#group,false,false,true,true,false,true,false,false
|
||||
#default,,,,,,,,
|
||||
,result,table,_start,_stop,_time,_measurement,host,name
|
||||
,,0,2018-05-22T19:53:00Z,2018-05-22T19:54:50Z,2018-05-22T19:53:30Z,_m0,h0,n0
|
||||
,,0,2018-05-22T19:53:00Z,2018-05-22T19:54:50Z,2018-05-22T19:53:40Z,_m0,h0,n0
|
||||
,,0,2018-05-22T19:53:00Z,2018-05-22T19:54:50Z,2018-05-22T19:53:50Z,_m0,h0,n0
|
||||
,,0,2018-05-22T19:53:00Z,2018-05-22T19:54:50Z,2018-05-22T19:53:00Z,_m0,h0,n0
|
||||
,,0,2018-05-22T19:53:00Z,2018-05-22T19:54:50Z,2018-05-22T19:53:10Z,_m0,h1,n1
|
||||
,,0,2018-05-22T19:53:00Z,2018-05-22T19:54:50Z,2018-05-22T19:53:20Z,_m0,h1,n1
|
||||
,,1,2018-05-22T19:53:00Z,2018-05-22T19:54:50Z,2018-05-22T19:53:30Z,_m1,h1,n1
|
||||
,,1,2018-05-22T19:53:00Z,2018-05-22T19:54:50Z,2018-05-22T19:53:40Z,_m1,h1,n1
|
||||
,,1,2018-05-22T19:53:00Z,2018-05-22T19:54:50Z,2018-05-22T19:53:50Z,_m1,h2,n2
|
||||
,,1,2018-05-22T19:53:00Z,2018-05-22T19:54:50Z,2018-05-22T19:54:00Z,_m1,h1,n1
|
||||
,,1,2018-05-22T19:53:00Z,2018-05-22T19:54:50Z,2018-05-22T19:54:10Z,_m1,h1,n1
|
||||
,,1,2018-05-22T19:53:00Z,2018-05-22T19:54:50Z,2018-05-22T19:54:30Z,_m1,h1,n1
|
||||
,,1,2018-05-22T19:53:00Z,2018-05-22T19:54:50Z,2018-05-22T19:54:40Z,_m1,h3,n3
|
||||
,,1,2018-05-22T19:53:00Z,2018-05-22T19:54:50Z,2018-05-22T19:53:50Z,_m1,h3,n2
|
||||
,,1,2018-05-22T19:53:00Z,2018-05-22T19:54:50Z,2018-05-22T19:54:00Z,_m1,h3,n3
|
||||
,,2,2018-05-22T19:53:00Z,2018-05-22T19:54:50Z,2018-05-22T19:53:10Z,_m2,h3,n3
|
||||
,,2,2018-05-22T19:53:00Z,2018-05-22T19:54:50Z,2018-05-22T19:53:30Z,_m2,h5,n5
|
||||
,,2,2018-05-22T19:53:00Z,2018-05-22T19:54:50Z,2018-05-22T19:54:40Z,_m2,h5,n5
|
||||
,,2,2018-05-22T19:53:00Z,2018-05-22T19:54:50Z,2018-05-22T19:53:50Z,_m2,h5,n5
|
||||
,,3,2018-05-22T19:53:00Z,2018-05-22T19:54:50Z,2018-05-22T19:54:00Z,_m3,h5,n5
|
||||
,,3,2018-05-22T19:53:00Z,2018-05-22T19:54:50Z,2018-05-22T19:54:10Z,_m3,h4,n1
|
||||
,,3,2018-05-22T19:53:00Z,2018-05-22T19:54:50Z,2018-05-22T19:54:20Z,_m3,h4,n4
|
||||
"
|
||||
outData = "
|
||||
#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,string,string,string
|
||||
#group,false,false,true,true,true,false,false
|
||||
#default,_result,,,,,,
|
||||
,result,table,_start,_stop,_measurement,_key,_value
|
||||
,,0,2018-05-22T19:53:00Z,2018-05-22T19:54:50Z,_m0,host,h0
|
||||
,,0,2018-05-22T19:53:00Z,2018-05-22T19:54:50Z,_m0,name,n0
|
||||
,,0,2018-05-22T19:53:00Z,2018-05-22T19:54:50Z,_m0,host,h1
|
||||
,,0,2018-05-22T19:53:00Z,2018-05-22T19:54:50Z,_m0,name,n1
|
||||
,,1,2018-05-22T19:53:00Z,2018-05-22T19:54:50Z,_m1,host,h1
|
||||
,,1,2018-05-22T19:53:00Z,2018-05-22T19:54:50Z,_m1,name,n1
|
||||
,,1,2018-05-22T19:53:00Z,2018-05-22T19:54:50Z,_m1,host,h2
|
||||
,,1,2018-05-22T19:53:00Z,2018-05-22T19:54:50Z,_m1,name,n2
|
||||
,,1,2018-05-22T19:53:00Z,2018-05-22T19:54:50Z,_m1,host,h3
|
||||
,,1,2018-05-22T19:53:00Z,2018-05-22T19:54:50Z,_m1,name,n3
|
||||
,,2,2018-05-22T19:53:00Z,2018-05-22T19:54:50Z,_m2,host,h3
|
||||
,,2,2018-05-22T19:53:00Z,2018-05-22T19:54:50Z,_m2,name,n3
|
||||
,,2,2018-05-22T19:53:00Z,2018-05-22T19:54:50Z,_m2,host,h5
|
||||
,,2,2018-05-22T19:53:00Z,2018-05-22T19:54:50Z,_m2,name,n5
|
||||
,,3,2018-05-22T19:53:00Z,2018-05-22T19:54:50Z,_m3,host,h5
|
||||
,,3,2018-05-22T19:53:00Z,2018-05-22T19:54:50Z,_m3,name,n5
|
||||
,,3,2018-05-22T19:53:00Z,2018-05-22T19:54:50Z,_m3,host,h4
|
||||
,,3,2018-05-22T19:53:00Z,2018-05-22T19:54:50Z,_m3,name,n1
|
||||
,,3,2018-05-22T19:53:00Z,2018-05-22T19:54:50Z,_m3,name,n4
|
||||
"
|
||||
|
||||
t_key_values_host_name = (table=<-) =>
|
||||
table
|
||||
|> keyValues(keyColumns: ["host", "name"])
|
||||
testingTest(name: "key_values_host_name",
|
||||
input: testLoadStorage(csv: inData),
|
||||
want: testLoadMem(csv: outData),
|
||||
test: t_key_values_host_name,
|
||||
)
|
|
@ -0,0 +1,39 @@
|
|||
inData = "
|
||||
#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,dateTime:RFC3339,long,string,string,string,string
|
||||
#group,false,false,false,false,false,false,false,false,true,true
|
||||
#default,_result,,,,,,,,,
|
||||
,result,table,_start,_stop,_time,_value,_field,_measurement,host,name
|
||||
,,1,2018-05-22T19:53:26Z,2018-05-22T19:54:16Z,2018-05-22T19:53:26Z,15204688,io_time,diskio,host.local,disk0
|
||||
,,1,2018-05-22T19:53:26Z,2018-05-22T19:54:16Z,2018-05-22T19:53:36Z,15204894,io_time,diskio,host.local,disk0
|
||||
,,1,2018-05-22T19:53:26Z,2018-05-22T19:54:16Z,2018-05-22T19:53:46Z,15205102,io_time,diskio,host.local,disk0
|
||||
,,1,2018-05-22T19:53:26Z,2018-05-22T19:54:16Z,2018-05-22T19:53:56Z,15205226,io_time,diskio,host.local,disk0
|
||||
,,1,2018-05-22T19:53:26Z,2018-05-22T19:54:16Z,2018-05-22T19:54:06Z,15205499,io_time,diskio,host.local,disk0
|
||||
,,1,2018-05-22T19:53:26Z,2018-05-22T19:54:16Z,2018-05-22T19:54:16Z,15205755,io_time,diskio,host.local,disk0
|
||||
,,10,2018-05-22T19:53:26Z,2018-05-22T19:54:16Z,2018-05-22T19:53:26Z,648,io_time,diskio,host.local,disk2
|
||||
,,10,2018-05-22T19:53:26Z,2018-05-22T19:54:16Z,2018-05-22T19:53:36Z,648,io_time,diskio,host.local,disk2
|
||||
,,10,2018-05-22T19:53:26Z,2018-05-22T19:54:16Z,2018-05-22T19:53:46Z,648,io_time,diskio,host.local,disk2
|
||||
,,10,2018-05-22T19:53:26Z,2018-05-22T19:54:16Z,2018-05-22T19:53:56Z,648,io_time,diskio,host.local,disk2
|
||||
,,10,2018-05-22T19:53:26Z,2018-05-22T19:54:16Z,2018-05-22T19:54:06Z,648,io_time,diskio,host.local,disk2
|
||||
,,10,2018-05-22T19:53:26Z,2018-05-22T19:54:16Z,2018-05-22T19:54:16Z,648,io_time,diskio,host.local,disk2
|
||||
"
|
||||
outData = "
|
||||
#datatype,string,long,string
|
||||
#group,false,false,false
|
||||
#default,0,,
|
||||
,result,table,_value
|
||||
,,0,host
|
||||
,,0,name
|
||||
"
|
||||
|
||||
t_keys = (table=<-) =>
|
||||
table
|
||||
|> range(start: 2018-05-20T19:53:26Z)
|
||||
|> filter(fn: (r) => r._measurement == "diskio")
|
||||
|> keys(except:["_time", "_start", "_stop", "_field", "_measurement", "_value"])
|
||||
|> group()
|
||||
|> distinct(column:"_value")
|
||||
|> yield(name:"0")
|
||||
testingTest(name: "keys",
|
||||
input: testLoadStorage(csv: inData),
|
||||
want: testLoadMem(csv: outData),
|
||||
test: t_keys)
|
|
@ -0,0 +1,48 @@
|
|||
inData = "
|
||||
#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,dateTime:RFC3339,double,string,string,string
|
||||
#group,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
|
||||
,,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
|
||||
"
|
||||
outData = "
|
||||
#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,dateTime:RFC3339,double,string,string,string
|
||||
#group,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:54:16Z,1.84,load1,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
|
||||
,,2,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:54:16Z,1.93,load5,system,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
|
||||
"
|
||||
|
||||
t_last = (table=<-) =>
|
||||
table
|
||||
|> last()
|
||||
testingTest(name: "last",
|
||||
input: testLoadStorage(csv: inData),
|
||||
want: testLoadMem(csv: outData),
|
||||
test: t_last)
|
|
@ -0,0 +1,40 @@
|
|||
inData = "
|
||||
#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,dateTime:RFC3339,long,string,string,string
|
||||
#group,false,false,false,false,false,false,true,true,false
|
||||
#default,_result,,,,,,,,
|
||||
,result,table,_start,_stop,_time,_value,_field,_measurement,host
|
||||
,,1,2018-11-07T00:00:00Z,2018-11-08T00:00:00Z,2018-11-07T00:00:00Z,10,A,BB,HostA
|
||||
,,1,2018-11-07T00:00:00Z,2018-11-08T00:00:00Z,2018-11-07T01:00:00Z,20,A,BB,HostA
|
||||
,,1,2018-11-07T00:00:00Z,2018-11-08T00:00:00Z,2018-11-07T02:00:00Z,30,A,BB,HostA
|
||||
,,2,2018-11-07T00:00:00Z,2018-11-08T00:00:00Z,2018-11-07T03:00:00Z,15,A,CC,HostA
|
||||
,,2,2018-11-07T00:00:00Z,2018-11-08T00:00:00Z,2018-11-07T04:00:00Z,21,A,CC,HostA
|
||||
,,2,2018-11-07T00:00:00Z,2018-11-08T00:00:00Z,2018-11-07T05:00:00Z,33,A,CC,HostB
|
||||
,,3,2018-11-07T00:00:00Z,2018-11-08T00:00:00Z,2018-11-07T06:00:00Z,18,A,DD,HostC
|
||||
,,3,2018-11-07T00:00:00Z,2018-11-08T00:00:00Z,2018-11-07T07:00:00Z,12,A,DD,HostC
|
||||
,,3,2018-11-07T00:00:00Z,2018-11-08T00:00:00Z,2018-11-07T08:00:00Z,15,A,DD,HostC
|
||||
,,4,2018-11-07T00:00:00Z,2018-11-08T00:00:00Z,2018-11-07T09:00:00Z,25,B,CC,HostD
|
||||
,,4,2018-11-07T00:00:00Z,2018-11-08T00:00:00Z,2018-11-07T10:00:00Z,75,B,CC,HostD
|
||||
,,4,2018-11-07T00:00:00Z,2018-11-08T00:00:00Z,2018-11-07T11:00:00Z,50,B,CC,HostD
|
||||
,,5,2018-11-07T00:00:00Z,2018-11-08T00:00:00Z,2018-11-07T12:00:00Z,10,B,DD,HostD
|
||||
,,5,2018-11-07T00:00:00Z,2018-11-08T00:00:00Z,2018-11-07T13:00:00Z,13,B,DD,HostE
|
||||
,,5,2018-11-07T00:00:00Z,2018-11-08T00:00:00Z,2018-11-07T14:00:00Z,27,B,DD,HostE
|
||||
"
|
||||
outData = "
|
||||
#datatype,string,long,string,string,double
|
||||
#group,false,false,false,false,false
|
||||
#default,_result,,,,
|
||||
,result,table,_measurement,host,_value
|
||||
,,0,DD,HostD,10
|
||||
,,0,DD,HostC,15
|
||||
,,0,CC,HostA,18
|
||||
"
|
||||
|
||||
t_lowestAverage = (table=<-) =>
|
||||
table
|
||||
|> range(start: 2018-11-07T00:00:00Z)
|
||||
|> lowestAverage(n: 3, groupColumns: ["_measurement", "host"])
|
||||
|
||||
testingTest(name: "lowestAverage",
|
||||
input: testLoadStorage(csv: inData),
|
||||
want: testLoadMem(csv: outData),
|
||||
test: t_lowestAverage)
|
|
@ -0,0 +1,40 @@
|
|||
inData = "
|
||||
#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,dateTime:RFC3339,long,string,string,string
|
||||
#group,false,false,false,false,false,false,true,true,false
|
||||
#default,_result,,,,,,,,
|
||||
,result,table,_start,_stop,_time,_value,_field,_measurement,host
|
||||
,,1,2018-11-07T00:00:00Z,2018-11-08T00:00:00Z,2018-11-07T00:00:00Z,10,A,BB,HostA
|
||||
,,1,2018-11-07T00:00:00Z,2018-11-08T00:00:00Z,2018-11-07T01:00:00Z,20,A,BB,HostA
|
||||
,,1,2018-11-07T00:00:00Z,2018-11-08T00:00:00Z,2018-11-07T02:00:00Z,30,A,BB,HostA
|
||||
,,2,2018-11-07T00:00:00Z,2018-11-08T00:00:00Z,2018-11-07T03:00:00Z,15,A,CC,HostA
|
||||
,,2,2018-11-07T00:00:00Z,2018-11-08T00:00:00Z,2018-11-07T04:00:00Z,21,A,CC,HostA
|
||||
,,2,2018-11-07T00:00:00Z,2018-11-08T00:00:00Z,2018-11-07T05:00:00Z,33,A,CC,HostB
|
||||
,,3,2018-11-07T00:00:00Z,2018-11-08T00:00:00Z,2018-11-07T06:00:00Z,18,A,DD,HostC
|
||||
,,3,2018-11-07T00:00:00Z,2018-11-08T00:00:00Z,2018-11-07T07:00:00Z,12,A,DD,HostC
|
||||
,,3,2018-11-07T00:00:00Z,2018-11-08T00:00:00Z,2018-11-07T08:00:00Z,15,A,DD,HostC
|
||||
,,4,2018-11-07T00:00:00Z,2018-11-08T00:00:00Z,2018-11-07T09:00:00Z,25,B,CC,HostD
|
||||
,,4,2018-11-07T00:00:00Z,2018-11-08T00:00:00Z,2018-11-07T10:00:00Z,75,B,CC,HostD
|
||||
,,4,2018-11-07T00:00:00Z,2018-11-08T00:00:00Z,2018-11-07T11:00:00Z,50,B,CC,HostD
|
||||
,,5,2018-11-07T00:00:00Z,2018-11-08T00:00:00Z,2018-11-07T12:00:00Z,10,B,DD,HostD
|
||||
,,5,2018-11-07T00:00:00Z,2018-11-08T00:00:00Z,2018-11-07T13:00:00Z,13,B,DD,HostE
|
||||
,,5,2018-11-07T00:00:00Z,2018-11-08T00:00:00Z,2018-11-07T14:00:00Z,27,B,DD,HostE
|
||||
"
|
||||
outData = "
|
||||
#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,dateTime:RFC3339,long,string,string,string
|
||||
#group,false,false,false,false,false,false,false,false,false
|
||||
#default,_result,,,,,,,,
|
||||
,result,table,_start,_stop,_time,_value,_field,_measurement,host
|
||||
,,0,2018-11-07T00:00:00Z,2018-11-08T00:00:00Z,2018-11-07T12:00:00Z,10,B,DD,HostD
|
||||
,,0,2018-11-07T00:00:00Z,2018-11-08T00:00:00Z,2018-11-07T08:00:00Z,15,A,DD,HostC
|
||||
,,0,2018-11-07T00:00:00Z,2018-11-08T00:00:00Z,2018-11-07T04:00:00Z,21,A,CC,HostA
|
||||
"
|
||||
|
||||
t_lowestCurrent = (table=<-) =>
|
||||
table
|
||||
|> range(start: 2018-11-07T00:00:00Z)
|
||||
|> lowestCurrent(n: 3, groupColumns: ["_measurement", "host"])
|
||||
|
||||
testingTest(name: "lowestCurrent",
|
||||
input: testLoadStorage(csv: inData),
|
||||
want: testLoadMem(csv: outData),
|
||||
test: t_lowestCurrent)
|
|
@ -0,0 +1,40 @@
|
|||
inData = "
|
||||
#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,dateTime:RFC3339,long,string,string,string
|
||||
#group,false,false,false,false,false,false,true,true,false
|
||||
#default,_result,,,,,,,,
|
||||
,result,table,_start,_stop,_time,_value,_field,_measurement,host
|
||||
,,1,2018-11-07T00:00:00Z,2018-11-08T00:00:00Z,2018-11-07T00:00:00Z,10,A,BB,HostA
|
||||
,,1,2018-11-07T00:00:00Z,2018-11-08T00:00:00Z,2018-11-07T01:00:00Z,20,A,BB,HostA
|
||||
,,1,2018-11-07T00:00:00Z,2018-11-08T00:00:00Z,2018-11-07T02:00:00Z,30,A,BB,HostA
|
||||
,,2,2018-11-07T00:00:00Z,2018-11-08T00:00:00Z,2018-11-07T03:00:00Z,15,A,CC,HostA
|
||||
,,2,2018-11-07T00:00:00Z,2018-11-08T00:00:00Z,2018-11-07T04:00:00Z,21,A,CC,HostA
|
||||
,,2,2018-11-07T00:00:00Z,2018-11-08T00:00:00Z,2018-11-07T05:00:00Z,33,A,CC,HostB
|
||||
,,3,2018-11-07T00:00:00Z,2018-11-08T00:00:00Z,2018-11-07T06:00:00Z,18,A,DD,HostC
|
||||
,,3,2018-11-07T00:00:00Z,2018-11-08T00:00:00Z,2018-11-07T07:00:00Z,12,A,DD,HostC
|
||||
,,3,2018-11-07T00:00:00Z,2018-11-08T00:00:00Z,2018-11-07T08:00:00Z,15,A,DD,HostC
|
||||
,,4,2018-11-07T00:00:00Z,2018-11-08T00:00:00Z,2018-11-07T09:00:00Z,25,B,CC,HostD
|
||||
,,4,2018-11-07T00:00:00Z,2018-11-08T00:00:00Z,2018-11-07T10:00:00Z,75,B,CC,HostD
|
||||
,,4,2018-11-07T00:00:00Z,2018-11-08T00:00:00Z,2018-11-07T11:00:00Z,50,B,CC,HostD
|
||||
,,5,2018-11-07T00:00:00Z,2018-11-08T00:00:00Z,2018-11-07T12:00:00Z,10,B,DD,HostD
|
||||
,,5,2018-11-07T00:00:00Z,2018-11-08T00:00:00Z,2018-11-07T13:00:00Z,13,B,DD,HostE
|
||||
,,5,2018-11-07T00:00:00Z,2018-11-08T00:00:00Z,2018-11-07T14:00:00Z,27,B,DD,HostE
|
||||
"
|
||||
outData = "
|
||||
#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,dateTime:RFC3339,long,string,string,string
|
||||
#group,false,false,false,false,false,false,false,false,false
|
||||
#default,_result,,,,,,,,
|
||||
,result,table,_start,_stop,_time,_value,_field,_measurement,host
|
||||
,,0,2018-11-07T00:00:00Z,2018-11-08T00:00:00Z,2018-11-07T00:00:00Z,10,A,BB,HostA
|
||||
,,0,2018-11-07T00:00:00Z,2018-11-08T00:00:00Z,2018-11-07T12:00:00Z,10,B,DD,HostD
|
||||
,,0,2018-11-07T00:00:00Z,2018-11-08T00:00:00Z,2018-11-07T07:00:00Z,12,A,DD,HostC
|
||||
"
|
||||
|
||||
t_lowestMin = (table=<-) =>
|
||||
table
|
||||
|> range(start: 2018-11-07T00:00:00Z)
|
||||
|> lowestMin(n: 3, groupColumns: ["_measurement", "host"])
|
||||
|
||||
testingTest(name: "lowestMin",
|
||||
input: testLoadStorage(csv: inData),
|
||||
want: testLoadMem(csv: outData),
|
||||
test: t_lowestMin)
|
|
@ -0,0 +1,48 @@
|
|||
inData = "
|
||||
#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,dateTime:RFC3339,double,string,string,string
|
||||
#group,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
|
||||
,,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
|
||||
"
|
||||
outData = "
|
||||
#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,dateTime:RFC3339,double,string,string,string
|
||||
#group,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: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:26Z,1.98,load15,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:26Z,82.9833984375,used_percent,swap,host.local
|
||||
"
|
||||
|
||||
t_max = (table=<-) =>
|
||||
table
|
||||
|> max()
|
||||
testingTest(name: "max",
|
||||
input: testLoadStorage(csv: inData),
|
||||
want: testLoadMem(csv: outData),
|
||||
test: t_max)
|
|
@ -0,0 +1,54 @@
|
|||
inData = "
|
||||
#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,string,string,dateTime:RFC3339,unsignedLong
|
||||
#group,false,false,false,false,true,true,false,false
|
||||
#default,,,,,,,,
|
||||
,result,table,_start,_stop,_measurement,_field,_time,_value
|
||||
,,0,2018-12-18T22:11:05Z,2018-12-18T22:11:55Z,Sgf,DlXwgrw,2018-12-18T22:11:05Z,70
|
||||
,,0,2018-12-18T22:11:05Z,2018-12-18T22:11:55Z,Sgf,DlXwgrw,2018-12-18T22:11:15Z,48
|
||||
,,0,2018-12-18T22:11:05Z,2018-12-18T22:11:55Z,Sgf,DlXwgrw,2018-12-18T22:11:25Z,33
|
||||
,,0,2018-12-18T22:11:05Z,2018-12-18T22:11:55Z,Sgf,DlXwgrw,2018-12-18T22:11:35Z,24
|
||||
,,0,2018-12-18T22:11:05Z,2018-12-18T22:11:55Z,Sgf,DlXwgrw,2018-12-18T22:11:45Z,38
|
||||
,,0,2018-12-18T22:11:05Z,2018-12-18T22:11:55Z,Sgf,DlXwgrw,2018-12-18T22:11:55Z,75
|
||||
|
||||
#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,string,string,dateTime:RFC3339,long
|
||||
#group,false,false,false,false,true,true,false,false
|
||||
#default,,,,,,,,
|
||||
,result,table,_start,_stop,_measurement,_field,_time,_value
|
||||
,,1,2018-12-18T22:11:05Z,2018-12-18T22:11:55Z,Sgf,GxUPYq1,2018-12-18T22:11:05Z,96
|
||||
,,1,2018-12-18T22:11:05Z,2018-12-18T22:11:55Z,Sgf,GxUPYq1,2018-12-18T22:11:15Z,-44
|
||||
,,1,2018-12-18T22:11:05Z,2018-12-18T22:11:55Z,Sgf,GxUPYq1,2018-12-18T22:11:25Z,-25
|
||||
,,1,2018-12-18T22:11:05Z,2018-12-18T22:11:55Z,Sgf,GxUPYq1,2018-12-18T22:11:35Z,46
|
||||
,,1,2018-12-18T22:11:05Z,2018-12-18T22:11:55Z,Sgf,GxUPYq1,2018-12-18T22:11:45Z,-2
|
||||
,,1,2018-12-18T22:11:05Z,2018-12-18T22:11:55Z,Sgf,GxUPYq1,2018-12-18T22:11:55Z,-14
|
||||
|
||||
#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,string,string,dateTime:RFC3339,double
|
||||
#group,false,false,false,false,true,true,false,false
|
||||
#default,,,,,,,,
|
||||
,result,table,_start,_stop,_measurement,_field,_time,_value
|
||||
,,2,2018-12-18T22:11:05Z,2018-12-18T22:11:55Z,Sgf,qaOnnQc,2018-12-18T22:11:05Z,-61.68790887989735
|
||||
,,2,2018-12-18T22:11:05Z,2018-12-18T22:11:55Z,Sgf,qaOnnQc,2018-12-18T22:11:15Z,-6.3173755351186465
|
||||
,,2,2018-12-18T22:11:05Z,2018-12-18T22:11:55Z,Sgf,qaOnnQc,2018-12-18T22:11:25Z,-26.049728557657513
|
||||
,,2,2018-12-18T22:11:05Z,2018-12-18T22:11:55Z,Sgf,qaOnnQc,2018-12-18T22:11:35Z,114.285955884979
|
||||
,,2,2018-12-18T22:11:05Z,2018-12-18T22:11:55Z,Sgf,qaOnnQc,2018-12-18T22:11:45Z,16.140262630578995
|
||||
,,2,2018-12-18T22:11:05Z,2018-12-18T22:11:55Z,Sgf,qaOnnQc,2018-12-18T22:11:55Z,29.50336437998469
|
||||
"
|
||||
outData = "
|
||||
#datatype,string,long,string,string,double
|
||||
#group,false,false,true,true,false
|
||||
#default,_result,,,,
|
||||
,result,table,_measurement,_field,_value
|
||||
,,0,Sgf,DlXwgrw,48
|
||||
,,1,Sgf,GxUPYq1,9.5
|
||||
,,2,Sgf,qaOnnQc,10.979094987144862
|
||||
"
|
||||
|
||||
option now = () => 2018-12-18T22:12:00Z
|
||||
|
||||
t_mean = (table=<-) => table
|
||||
|> range(start: -5m)
|
||||
|> mean()
|
||||
|
||||
testingTest(name: "mean",
|
||||
input: testLoadStorage(csv: inData),
|
||||
want: testLoadMem(csv: outData),
|
||||
test: t_mean)
|
|
@ -0,0 +1,55 @@
|
|||
inData = "
|
||||
#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,dateTime:RFC3339,double,string,string,string,string
|
||||
#group,false,false,false,false,false,false,true,true,true,true
|
||||
#default,_result,,,,,,,,,
|
||||
,result,table,_start,_stop,_time,_value,_field,_measurement,cpu,host
|
||||
,,0,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:26Z,0,usage_guest,cpu,cpu-total,host.local
|
||||
,,0,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:36Z,0,usage_guest,cpu,cpu-total,host.local
|
||||
,,0,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:46Z,0,usage_guest,cpu,cpu-total,host.local
|
||||
,,0,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:56Z,0,usage_guest,cpu,cpu-total,host.local
|
||||
,,0,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:54:06Z,0,usage_guest,cpu,cpu-total,host.local
|
||||
,,0,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:54:16Z,0,usage_guest,cpu,cpu-total,host.local
|
||||
,,1,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:26Z,0,usage_guest_nice,cpu,cpu-total,host.local
|
||||
,,1,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:36Z,0,usage_guest_nice,cpu,cpu-total,host.local
|
||||
,,1,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:46Z,0,usage_guest_nice,cpu,cpu-total,host.local
|
||||
,,1,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:56Z,0,usage_guest_nice,cpu,cpu-total,host.local
|
||||
,,1,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:54:06Z,0,usage_guest_nice,cpu,cpu-total,host.local
|
||||
,,1,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:54:16Z,0,usage_guest_nice,cpu,cpu-total,host.local
|
||||
,,2,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:26Z,91.7364670583823,usage_idle,cpu,cpu-total,host.local
|
||||
,,2,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:36Z,89.51118889861233,usage_idle,cpu,cpu-total,host.local
|
||||
,,2,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:46Z,91.0977744436109,usage_idle,cpu,cpu-total,host.local
|
||||
,,2,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:56Z,91.02836436336374,usage_idle,cpu,cpu-total,host.local
|
||||
,,2,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:54:06Z,68.304576144036,usage_idle,cpu,cpu-total,host.local
|
||||
,,2,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:54:16Z,87.88598574821853,usage_idle,cpu,cpu-total,host.local
|
||||
,,3,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:26Z,0,usage_iowait,cpu,cpu-total,host.local
|
||||
,,3,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:36Z,0,usage_iowait,cpu,cpu-total,host.local
|
||||
,,3,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:46Z,0,usage_iowait,cpu,cpu-total,host.local
|
||||
,,3,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:56Z,0,usage_iowait,cpu,cpu-total,host.local
|
||||
,,3,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:54:06Z,0,usage_iowait,cpu,cpu-total,host.local
|
||||
,,3,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:54:16Z,0,usage_iowait,cpu,cpu-total,host.local
|
||||
,,4,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:26Z,0,usage_irq,cpu,cpu-total,host.local
|
||||
,,4,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:36Z,0,usage_irq,cpu,cpu-total,host.local
|
||||
"
|
||||
outData = "
|
||||
#datatype,string,long,string,string
|
||||
#group,false,false,false,false
|
||||
#default,_result,,,
|
||||
,result,table,_field,_value
|
||||
,,0,usage_guest,usage_guest
|
||||
,,0,usage_guest_nice,usage_guest_nice
|
||||
,,0,usage_idle,usage_idle
|
||||
,,0,usage_iowait,usage_iowait
|
||||
,,0,usage_irq,usage_irq
|
||||
"
|
||||
|
||||
t_meta_query_fields = (table=<-) =>
|
||||
table
|
||||
|> range(start:2018-05-22T19:53:26Z)
|
||||
|> filter(fn: (r) => r._measurement == "cpu")
|
||||
|> group(columns: ["_field"])
|
||||
|> distinct(column: "_field")
|
||||
|> group()
|
||||
testingTest(name: "meta_query_fields",
|
||||
input: testLoadStorage(csv: inData),
|
||||
want: testLoadMem(csv: outData),
|
||||
test: t_meta_query_fields)
|
|
@ -0,0 +1,95 @@
|
|||
inData = "
|
||||
#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,dateTime:RFC3339,double,string,string,string,string
|
||||
#group,false,false,false,false,false,false,true,true,true,true
|
||||
#default,_result,,,,,,,,,
|
||||
,result,table,_start,_stop,_time,_value,_field,_measurement,cpu,host
|
||||
,,0,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:26Z,0,usage_guest,cpu,cpu-total,host.local
|
||||
,,0,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:36Z,0,usage_guest,cpu,cpu-total,host.local
|
||||
,,0,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:46Z,0,usage_guest,cpu,cpu-total,host.local
|
||||
,,0,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:56Z,0,usage_guest,cpu,cpu-total,host.local
|
||||
,,0,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:54:06Z,0,usage_guest,cpu,cpu-total,host.local
|
||||
,,0,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:54:16Z,0,usage_guest,cpu,cpu-total,host.local
|
||||
,,1,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:26Z,0,usage_guest_nice,cpu,cpu-total,host.local
|
||||
,,1,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:36Z,0,usage_guest_nice,cpu,cpu-total,host.local
|
||||
,,1,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:46Z,0,usage_guest_nice,cpu,cpu-total,host.local
|
||||
,,1,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:56Z,0,usage_guest_nice,cpu,cpu-total,host.local
|
||||
,,1,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:54:06Z,0,usage_guest_nice,cpu,cpu-total,host.local
|
||||
,,1,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:54:16Z,0,usage_guest_nice,cpu,cpu-total,host.local
|
||||
,,2,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:26Z,91.7364670583823,usage_idle,cpu,cpu-total,host.local
|
||||
,,2,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:36Z,89.51118889861233,usage_idle,cpu,cpu-total,host.local
|
||||
,,2,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:46Z,91.0977744436109,usage_idle,cpu,cpu-total,host.local
|
||||
,,2,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:56Z,91.02836436336374,usage_idle,cpu,cpu-total,host.local
|
||||
,,2,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:54:06Z,68.304576144036,usage_idle,cpu,cpu-total,host.local
|
||||
,,2,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:54:16Z,87.88598574821853,usage_idle,cpu,cpu-total,host.local
|
||||
,,3,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:26Z,0,usage_iowait,cpu,cpu-total,host.local
|
||||
,,3,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:36Z,0,usage_iowait,cpu,cpu-total,host.local
|
||||
,,3,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:46Z,0,usage_iowait,cpu,cpu-total,host.local
|
||||
,,3,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:56Z,0,usage_iowait,cpu,cpu-total,host.local
|
||||
,,3,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:54:06Z,0,usage_iowait,cpu,cpu-total,host.local
|
||||
,,3,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:54:16Z,0,usage_iowait,cpu,cpu-total,host.local
|
||||
,,4,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:26Z,0,usage_irq,cpu,cpu-total,host.local
|
||||
,,4,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:36Z,0,usage_irq,cpu,cpu-total,host.local
|
||||
"
|
||||
outData = "
|
||||
#datatype,string,long,string,string,string,string,string
|
||||
#group,false,false,true,true,true,true,false
|
||||
#default,0,,,,,,
|
||||
,result,table,_field,_measurement,cpu,host,_value
|
||||
,,0,usage_guest,cpu,cpu-total,host.local,_field
|
||||
,,0,usage_guest,cpu,cpu-total,host.local,_measurement
|
||||
,,0,usage_guest,cpu,cpu-total,host.local,_start
|
||||
,,0,usage_guest,cpu,cpu-total,host.local,_stop
|
||||
,,0,usage_guest,cpu,cpu-total,host.local,cpu
|
||||
,,0,usage_guest,cpu,cpu-total,host.local,host
|
||||
,,1,usage_guest_nice,cpu,cpu-total,host.local,_field
|
||||
,,1,usage_guest_nice,cpu,cpu-total,host.local,_measurement
|
||||
,,1,usage_guest_nice,cpu,cpu-total,host.local,_start
|
||||
,,1,usage_guest_nice,cpu,cpu-total,host.local,_stop
|
||||
,,1,usage_guest_nice,cpu,cpu-total,host.local,cpu
|
||||
,,1,usage_guest_nice,cpu,cpu-total,host.local,host
|
||||
,,2,usage_idle,cpu,cpu-total,host.local,_field
|
||||
,,2,usage_idle,cpu,cpu-total,host.local,_measurement
|
||||
,,2,usage_idle,cpu,cpu-total,host.local,_start
|
||||
,,2,usage_idle,cpu,cpu-total,host.local,_stop
|
||||
,,2,usage_idle,cpu,cpu-total,host.local,cpu
|
||||
,,2,usage_idle,cpu,cpu-total,host.local,host
|
||||
,,3,usage_iowait,cpu,cpu-total,host.local,_field
|
||||
,,3,usage_iowait,cpu,cpu-total,host.local,_measurement
|
||||
,,3,usage_iowait,cpu,cpu-total,host.local,_start
|
||||
,,3,usage_iowait,cpu,cpu-total,host.local,_stop
|
||||
,,3,usage_iowait,cpu,cpu-total,host.local,cpu
|
||||
,,3,usage_iowait,cpu,cpu-total,host.local,host
|
||||
,,4,usage_irq,cpu,cpu-total,host.local,_field
|
||||
,,4,usage_irq,cpu,cpu-total,host.local,_measurement
|
||||
,,4,usage_irq,cpu,cpu-total,host.local,_start
|
||||
,,4,usage_irq,cpu,cpu-total,host.local,_stop
|
||||
,,4,usage_irq,cpu,cpu-total,host.local,cpu
|
||||
,,4,usage_irq,cpu,cpu-total,host.local,host
|
||||
|
||||
#datatype,string,long,string,string
|
||||
#group,false,false,false,false
|
||||
#default,1,,,
|
||||
,result,table,host,_value
|
||||
,,0,host.local,host.local
|
||||
"
|
||||
|
||||
t_meta_query_keys = (table=<-) => {
|
||||
zero = table
|
||||
|> range(start:2018-05-22T19:53:26Z)
|
||||
|> filter(fn: (r) => r._measurement == "cpu")
|
||||
|> keys()
|
||||
|> yield(name:"0")
|
||||
|
||||
one = table
|
||||
|> range(start:2018-05-22T19:53:26Z)
|
||||
|> filter(fn: (r) => r._measurement == "cpu")
|
||||
|> group(columns: ["host"])
|
||||
|> distinct(column: "host")
|
||||
|> group()
|
||||
|> yield(name:"1")
|
||||
return union(tables: [zero, one])
|
||||
}
|
||||
testingTest(name: "meta_query_keys",
|
||||
input: testLoadStorage(csv: inData),
|
||||
want: testLoadMem(csv: outData),
|
||||
test: t_meta_query_keys)
|
|
@ -0,0 +1,40 @@
|
|||
inData = "
|
||||
#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,dateTime:RFC3339,long,string,string,string,string,string,string
|
||||
#group,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
|
||||
,,90,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:26Z,318324641792,free,disk,disk1s1,apfs,host.local,/
|
||||
,,90,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:36Z,318324609024,free,disk,disk1s1,apfs,host.local,/
|
||||
,,90,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:46Z,318324129792,free,disk,disk1s1,apfs,host.local,/
|
||||
,,90,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:56Z,318324129792,free,disk,disk1s1,apfs,host.local,/
|
||||
,,90,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:54:06Z,318326116352,free,disk,disk1s1,apfs,host.local,/
|
||||
,,90,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:54:16Z,318325084160,free,disk,disk1s1,apfs,host.local,/
|
||||
,,91,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:26Z,9223372036853184345,inodes_free,disk1,disk1s1,apfs,host.local,/
|
||||
,,91,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:36Z,9223372036853184345,inodes_free,disk1,disk1s1,apfs,host.local,/
|
||||
,,91,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:46Z,9223372036853184344,inodes_free,disk1,disk1s1,apfs,host.local,/
|
||||
,,91,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:56Z,9223372036853184344,inodes_free,disk1,disk1s1,apfs,host.local,/
|
||||
,,91,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:54:06Z,9223372036853184344,inodes_free,disk1,disk1s1,apfs,host.local,/
|
||||
,,91,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:54:16Z,9223372036853184345,inodes_free,disk2,disk1s1,apfs,host.local,/
|
||||
,,92,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:26Z,9223372036854775807,inodes_total,disk2,disk1s1,apfs,host.local,/
|
||||
,,92,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:36Z,9223372036854775807,inodes_total,disk2,disk1s1,apfs,host.local,/
|
||||
"
|
||||
outData = "
|
||||
#datatype,string,long,string,string
|
||||
#group,false,false,false,false
|
||||
#default,_result,,,
|
||||
,result,table,_measurement,_value
|
||||
,,0,disk,disk
|
||||
,,0,disk1,disk1
|
||||
,,0,disk2,disk2
|
||||
"
|
||||
|
||||
t_meta_query_measurements = (table=<-) =>
|
||||
table
|
||||
|> range(start:2018-05-22T19:53:26Z)
|
||||
|> group(columns: ["_measurement"])
|
||||
|> distinct(column: "_measurement")
|
||||
|> group()
|
||||
testingTest(name: "meta_query_measurements",
|
||||
input: testLoadStorage(csv: inData),
|
||||
want: testLoadMem(csv: outData),
|
||||
test: t_meta_query_measurements)
|
|
@ -0,0 +1,48 @@
|
|||
inData = "
|
||||
#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,dateTime:RFC3339,double,string,string,string
|
||||
#group,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
|
||||
,,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
|
||||
"
|
||||
outData = "
|
||||
#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,dateTime:RFC3339,double,string,string,string
|
||||
#group,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
|
||||
,,1,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:56Z,1.96,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
|
||||
,,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
|
||||
"
|
||||
|
||||
t_min = (table=<-) =>
|
||||
table
|
||||
|> min()
|
||||
testingTest(name: "min",
|
||||
input: testLoadStorage(csv: inData),
|
||||
want: testLoadMem(csv: outData),
|
||||
test: t_min)
|
|
@ -0,0 +1,37 @@
|
|||
inData = "
|
||||
#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,dateTime:RFC3339,double,string,string,string,string
|
||||
#group,false,false,false,false,false,false,true,true,true,true
|
||||
#default,_result,,,,,,,,,
|
||||
,result,table,_start,_stop,_time,_value,_field,_measurement,cpu,host
|
||||
,,0,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:26Z,0,usage_guest,cpu,cpu-total,host.local
|
||||
,,0,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:36Z,0,usage_guest,cpu,cpu-total,host.local
|
||||
,,0,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:46Z,0,usage_guest,cpu,cpu-total,host.local
|
||||
,,0,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:56Z,0,usage_guest,cpu,cpu-total,host.local
|
||||
,,0,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:54:06Z,0,usage_guest,cpu,cpu-total,host.local
|
||||
,,0,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:54:16Z,0,usage_guest,cpu,cpu-total,host.local
|
||||
,,0,2018-05-22T19:53:24.421470485Z,2018-05-22T19:55:00.421470485Z,2018-05-22T19:54:26Z,0,usage_guest,cpu,cpu-total,host.local
|
||||
,,0,2018-05-22T19:53:24.421470485Z,2018-05-22T19:55:00.421470485Z,2018-05-22T19:54:36Z,0,usage_guest,cpu,cpu-total,host.local
|
||||
,,1,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:26Z,0,usage_guest_nice,cpu,cpu-total,host.local
|
||||
"
|
||||
outData = "
|
||||
#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,dateTime:RFC3339,double,string,string,string,string
|
||||
#group,false,false,false,false,false,false,true,true,true,true
|
||||
#default,_result,,,,,,,,,
|
||||
,result,table,_start,_stop,_time,_value,_field,_measurement,cpu,host
|
||||
,,0,2018-05-22T19:54:06Z,2018-05-22T19:54:16Z,2018-05-22T19:54:06Z,0,usage_guest,cpu,cpu-total,host.local
|
||||
|
||||
#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,dateTime:RFC3339,double,string,string,string,string
|
||||
#group,false,false,false,false,false,false,true,true,true,true
|
||||
#default,_result,1,,,,,usage_guest_nice,cpu,cpu-total,host.local
|
||||
,result,table,_start,_stop,_time,_value,_field,_measurement,cpu,host
|
||||
"
|
||||
|
||||
t_multiple_range = (table=<-) =>
|
||||
table
|
||||
|> range(start: 2018-05-22T19:53:26Z, stop: 2018-05-22T19:54:16Z)
|
||||
|> range(start: 2018-05-22T19:54:06Z)
|
||||
|
||||
testingTest(name: "multiple_range",
|
||||
input: testLoadStorage(csv: inData),
|
||||
want: testLoadMem(csv: outData),
|
||||
test: t_multiple_range)
|
|
@ -0,0 +1,15 @@
|
|||
inData = "
|
||||
|
||||
"
|
||||
outData = "err: error calling function "filter": name "null" does not exist in scope
|
||||
"
|
||||
|
||||
t_null_as_value = (table=<-) =>
|
||||
table
|
||||
|> range(start:2018-05-22T19:53:26Z)
|
||||
|> filter(fn: (r) => r._value == null)
|
||||
|
||||
testingTest(name: "null_as_value",
|
||||
input: testLoadStorage(csv: inData),
|
||||
want: testLoadMem(csv: outData),
|
||||
test: t_null_as_value)
|
|
@ -0,0 +1,39 @@
|
|||
inData = "
|
||||
#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,dateTime:RFC3339,long,string,string,string,string,string,string
|
||||
#group,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
|
||||
,,91,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:26Z,9223372036853184345,inodes_free,disk,disk1s1,apfs,host.local,/
|
||||
,,91,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:36Z,9223372036853184345,inodes_free,disk,disk1s1,apfs,host.local,/
|
||||
,,91,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:46Z,9223372036853184344,inodes_free,disk,disk1s1,apfs,host.local,/
|
||||
,,91,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:56Z,9223372036853184344,inodes_free,disk,disk1s1,apfs,host.local,/
|
||||
,,91,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:54:06Z,9223372036853184344,inodes_free,disk,disk1s1,apfs,host.local,/
|
||||
,,91,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:54:16Z,9223372036853184345,inodes_free,disk,disk1s1,apfs,host.local,/
|
||||
,,92,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:26Z,9223372036854775807,inodes_total,disk,disk1s1,apfs,host.local,/
|
||||
,,92,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:36Z,9223372036854775807,inodes_total,disk,disk1s1,apfs,host.local,/
|
||||
,,92,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:46Z,9223372036854775807,inodes_total,disk,disk1s1,apfs,host.local,/
|
||||
,,92,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:56Z,9223372036854775807,inodes_total,disk,disk1s1,apfs,host.local,/
|
||||
,,92,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:54:06Z,9223372036854775807,inodes_total,disk,disk1s1,apfs,host.local,/
|
||||
,,92,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:54:16Z,9223372036854775807,inodes_total,disk,disk1s1,apfs,host.local,/
|
||||
"
|
||||
outData = "
|
||||
#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,dateTime:RFC3339,long,string,string,string,string,string,string
|
||||
#group,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:26Z,9223372036853184345,inodes_free,disk,disk1s1,apfs,host.local,/
|
||||
,,1,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:26Z,9223372036854775807,inodes_total,disk,disk1s1,apfs,host.local,/
|
||||
"
|
||||
|
||||
filterRegex = /inodes*/
|
||||
|
||||
t_parse_regex = (table=<-) =>
|
||||
table
|
||||
|
||||
|> range(start:2018-05-20T19:53:26Z)
|
||||
|> filter(fn: (r) => r._field =~ filterRegex)
|
||||
|> max()
|
||||
testingTest(name: "parse_regex",
|
||||
input: testLoadStorage(csv: inData),
|
||||
want: testLoadMem(csv: outData),
|
||||
test: t_parse_regex)
|
|
@ -0,0 +1,32 @@
|
|||
inData = "
|
||||
#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,dateTime:RFC3339,double,string,string,string,string,string,string
|
||||
#group,false,false,true,true,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:26Z,2018-05-22T19:54:16Z,2018-05-22T19:53:26Z,34.98234271799806,used_percent,disk,disk1s1,apfs,host.local,/
|
||||
,,96,2018-05-22T19:53:26Z,2018-05-22T19:54:16Z,2018-05-22T19:53:36Z,34.98234941084654,used_percent,disk,disk1s1,apfs,host.local,/
|
||||
,,96,2018-05-22T19:53:26Z,2018-05-22T19:54:16Z,2018-05-22T19:53:46Z,34.982447293755506,used_percent,disk,disk1s1,apfs,host.local,/
|
||||
,,96,2018-05-22T19:53:26Z,2018-05-22T19:54:16Z,2018-05-22T19:53:56Z,34.982447293755506,used_percent,disk,disk1s1,apfs,host.local,/
|
||||
,,96,2018-05-22T19:53:26Z,2018-05-22T19:54:16Z,2018-05-22T19:54:06Z,34.98204153981662,used_percent,disk,disk1s1,apfs,host.local,/
|
||||
,,96,2018-05-22T19:53:26Z,2018-05-22T19:54:16Z,2018-05-22T19:54:16Z,34.982252364543626,used_percent,disk,disk1s1,apfs,host.local,/
|
||||
"
|
||||
outData = "
|
||||
#datatype,string,long,dateTime:RFC3339,string,dateTime:RFC3339,double
|
||||
#group,false,false,true,true,false,false
|
||||
#default,0,,,,,
|
||||
,result,table,_start,_measurement,_time,percentile
|
||||
,,0,2018-05-22T19:53:26Z,disk,2018-05-22T19:53:46Z,34.982447293755506
|
||||
"
|
||||
|
||||
t_percentile = (table=<-) =>
|
||||
table
|
||||
|> range(start: 2018-05-22T19:50:26Z)
|
||||
|> group(columns: ["_measurement", "_start"])
|
||||
|> percentile(percentile:0.75, method:"exact_selector")
|
||||
|> map(fn: (r) => ({_time: r._time, percentile: r._value}))
|
||||
|> yield(name:"0")
|
||||
|
||||
testingTest(name: "percentile",
|
||||
input: testLoadStorage(csv: inData),
|
||||
want: testLoadMem(csv: outData),
|
||||
test: t_percentile)
|
|
@ -0,0 +1,30 @@
|
|||
inData = "
|
||||
#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,string,string,dateTime:RFC3339,double
|
||||
#group,false,false,false,false,true,true,false,false
|
||||
#default,,,,,,,,
|
||||
,result,table,_start,_stop,_measurement,_field,_time,_value
|
||||
,,0,2018-12-18T21:12:45Z,2018-12-18T21:13:35Z,SOYcRk,NC7N,2018-12-18T21:12:45Z,-61.68790887989735
|
||||
,,0,2018-12-18T21:12:45Z,2018-12-18T21:13:35Z,SOYcRk,NC7N,2018-12-18T21:12:55Z,-6.3173755351186465
|
||||
,,0,2018-12-18T21:12:45Z,2018-12-18T21:13:35Z,SOYcRk,NC7N,2018-12-18T21:13:05Z,-26.049728557657513
|
||||
,,0,2018-12-18T21:12:45Z,2018-12-18T21:13:35Z,SOYcRk,NC7N,2018-12-18T21:13:15Z,114.285955884979
|
||||
,,0,2018-12-18T21:12:45Z,2018-12-18T21:13:35Z,SOYcRk,NC7N,2018-12-18T21:13:25Z,16.140262630578995
|
||||
,,0,2018-12-18T21:12:45Z,2018-12-18T21:13:35Z,SOYcRk,NC7N,2018-12-18T21:13:35Z,29.50336437998469
|
||||
"
|
||||
outData = "
|
||||
#datatype,string,long,string,string,double
|
||||
#group,false,false,true,true,false
|
||||
#default,_result,,,,
|
||||
,result,table,_measurement,_field,_value
|
||||
,,0,SOYcRk,NC7N,26.162588942633263
|
||||
"
|
||||
|
||||
option now = () => 2018-12-18T21:14:00Z
|
||||
|
||||
t_percentile = (table=<-) => table
|
||||
|> range(start: -2m)
|
||||
|> percentile(percentile: 0.75, method: "exact_mean")
|
||||
|
||||
testingTest(name: "percentile_aggregate",
|
||||
input: testLoadStorage(csv: inData),
|
||||
want: testLoadMem(csv: outData),
|
||||
test: t_percentile)
|
|
@ -0,0 +1,30 @@
|
|||
inData = "
|
||||
#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,string,string,dateTime:RFC3339,double
|
||||
#group,false,false,false,false,true,true,false,false
|
||||
#default,,,,,,,,
|
||||
,result,table,_start,_stop,_measurement,_field,_time,_value
|
||||
,,0,2018-12-18T21:12:45Z,2018-12-18T21:13:35Z,SOYcRk,NC7N,2018-12-18T21:12:45Z,-61.68790887989735
|
||||
,,0,2018-12-18T21:12:45Z,2018-12-18T21:13:35Z,SOYcRk,NC7N,2018-12-18T21:12:55Z,-6.3173755351186465
|
||||
,,0,2018-12-18T21:12:45Z,2018-12-18T21:13:35Z,SOYcRk,NC7N,2018-12-18T21:13:05Z,-26.049728557657513
|
||||
,,0,2018-12-18T21:12:45Z,2018-12-18T21:13:35Z,SOYcRk,NC7N,2018-12-18T21:13:15Z,114.285955884979
|
||||
,,0,2018-12-18T21:12:45Z,2018-12-18T21:13:35Z,SOYcRk,NC7N,2018-12-18T21:13:25Z,16.140262630578995
|
||||
,,0,2018-12-18T21:12:45Z,2018-12-18T21:13:35Z,SOYcRk,NC7N,2018-12-18T21:13:35Z,29.50336437998469
|
||||
"
|
||||
outData = "
|
||||
#datatype,string,long,string,string,double
|
||||
#group,false,false,true,true,false
|
||||
#default,_result,,,,
|
||||
,result,table,_measurement,_field,_value
|
||||
,,0,SOYcRk,NC7N,29.50336437998469
|
||||
"
|
||||
|
||||
option now = () => 2018-12-18T21:14:00Z
|
||||
|
||||
t_percentile = (table=<-) => table
|
||||
|> range(start: -2m)
|
||||
|> percentile(percentile: 0.75, method: "estimate_tdigest")
|
||||
|
||||
testingTest(name: "percentile_tdigest",
|
||||
input: testLoadStorage(csv: inData),
|
||||
want: testLoadMem(csv: outData),
|
||||
test: t_percentile)
|
|
@ -0,0 +1,53 @@
|
|||
inData = "
|
||||
#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,dateTime:RFC3339,double,string,string,string
|
||||
#group,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:26Z,2018-05-22T19:54:16Z,2018-05-22T19:53:26Z,82.9833984375,used_percent,swap,host.local
|
||||
,,161,2018-05-22T19:53:26Z,2018-05-22T19:54:16Z,2018-05-22T19:53:36Z,82.598876953125,used_percent,swap,host.local
|
||||
,,161,2018-05-22T19:53:26Z,2018-05-22T19:54:16Z,2018-05-22T19:53:46Z,82.598876953125,used_percent,swap,host.local
|
||||
,,161,2018-05-22T19:53:26Z,2018-05-22T19:54:16Z,2018-05-22T19:53:56Z,82.598876953125,used_percent,swap,host.local
|
||||
,,161,2018-05-22T19:53:26Z,2018-05-22T19:54:16Z,2018-05-22T19:54:06Z,82.598876953125,used_percent,swap,host.local
|
||||
,,161,2018-05-22T19:53:26Z,2018-05-22T19:54:16Z,2018-05-22T19:54:16Z,82.6416015625,used_percent,swap,host.local
|
||||
,,162,2018-05-22T19:53:26Z,2018-05-22T19:54:16Z,2018-05-22T19:53:26Z,1.83,load1,system,host.local
|
||||
,,162,2018-05-22T19:53:26Z,2018-05-22T19:54:16Z,2018-05-22T19:53:36Z,1.7,load1,system,host.local
|
||||
,,162,2018-05-22T19:53:26Z,2018-05-22T19:54:16Z,2018-05-22T19:53:46Z,1.74,load1,system,host.local
|
||||
,,162,2018-05-22T19:53:26Z,2018-05-22T19:54:16Z,2018-05-22T19:53:56Z,1.63,load1,system,host.local
|
||||
,,162,2018-05-22T19:53:26Z,2018-05-22T19:54:16Z,2018-05-22T19:54:06Z,1.91,load1,system,host.local
|
||||
,,162,2018-05-22T19:53:26Z,2018-05-22T19:54:16Z,2018-05-22T19:54:16Z,1.84,load1,system,host.local
|
||||
,,163,2018-05-22T19:53:26Z,2018-05-22T19:54:16Z,2018-05-22T19:53:26Z,1.98,load15,system,host.local
|
||||
,,163,2018-05-22T19:53:26Z,2018-05-22T19:54:16Z,2018-05-22T19:53:36Z,1.97,load15,system,host.local
|
||||
,,163,2018-05-22T19:53:26Z,2018-05-22T19:54:16Z,2018-05-22T19:53:46Z,1.97,load15,system,host.local
|
||||
,,163,2018-05-22T19:53:26Z,2018-05-22T19:54:16Z,2018-05-22T19:53:56Z,1.96,load15,system,host.local
|
||||
,,163,2018-05-22T19:53:26Z,2018-05-22T19:54:16Z,2018-05-22T19:54:06Z,1.98,load15,system,host.local
|
||||
,,163,2018-05-22T19:53:26Z,2018-05-22T19:54:16Z,2018-05-22T19:54:16Z,1.97,load15,system,host.local
|
||||
,,164,2018-05-22T19:53:26Z,2018-05-22T19:54:16Z,2018-05-22T19:53:26Z,1.95,load5,system,host.local
|
||||
,,164,2018-05-22T19:53:26Z,2018-05-22T19:54:16Z,2018-05-22T19:53:36Z,1.92,load5,system,host.local
|
||||
,,164,2018-05-22T19:53:26Z,2018-05-22T19:54:16Z,2018-05-22T19:53:46Z,1.92,load5,system,host.local
|
||||
,,164,2018-05-22T19:53:26Z,2018-05-22T19:54:16Z,2018-05-22T19:53:56Z,1.89,load5,system,host.local
|
||||
,,164,2018-05-22T19:53:26Z,2018-05-22T19:54:16Z,2018-05-22T19:54:06Z,1.94,load5,system,host.local
|
||||
,,164,2018-05-22T19:53:26Z,2018-05-22T19:54:16Z,2018-05-22T19:54:16Z,1.93,load5,system,host.local
|
||||
"
|
||||
outData = "
|
||||
#datatype,string,long,dateTime:RFC3339,string,double,double,double,double
|
||||
#group,false,false,false,true,false,false,false,false
|
||||
#default,0,,,,,,,
|
||||
,result,table,_time,host,load1_system,load15_system,load5_system,used_percent_swap
|
||||
,,0,2018-05-22T19:53:26Z,host.local,1.83,1.98,1.95,82.9833984375
|
||||
,,0,2018-05-22T19:53:36Z,host.local,1.7,1.97,1.92,82.598876953125
|
||||
,,0,2018-05-22T19:53:46Z,host.local,1.74,1.97,1.92,82.598876953125
|
||||
,,0,2018-05-22T19:53:56Z,host.local,1.63,1.96,1.89,82.598876953125
|
||||
,,0,2018-05-22T19:54:06Z,host.local,1.91,1.98,1.94,82.598876953125
|
||||
,,0,2018-05-22T19:54:16Z,host.local,1.84,1.97,1.93,82.6416015625
|
||||
"
|
||||
|
||||
t_pivot = (table=<-) =>
|
||||
table
|
||||
|> range(start: 2018-05-22T19:53:26Z)
|
||||
|> pivot(rowKey: ["_time"], columnKey: ["_measurement", "_field"], valueColumn: "_value")
|
||||
|> yield(name:"0")
|
||||
|
||||
testingTest(name: "pivot",
|
||||
input: testLoadStorage(csv: inData),
|
||||
want: testLoadMem(csv: outData),
|
||||
test: t_pivot)
|
|
@ -0,0 +1,64 @@
|
|||
inData = "
|
||||
#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,dateTime:RFC3339,double,string,string,string
|
||||
#group,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:26Z,2018-05-22T19:54:16Z,2018-05-22T19:53:26Z,82.9833984375,used_percent,swap,host.local
|
||||
,,161,2018-05-22T19:53:26Z,2018-05-22T19:54:16Z,2018-05-22T19:53:36Z,82.598876953125,used_percent,swap,host.local
|
||||
,,161,2018-05-22T19:53:26Z,2018-05-22T19:54:16Z,2018-05-22T19:53:46Z,82.598876953125,used_percent,swap,host.local
|
||||
,,161,2018-05-22T19:53:26Z,2018-05-22T19:54:16Z,2018-05-22T19:53:56Z,82.598876953125,used_percent,swap,host.local
|
||||
,,161,2018-05-22T19:53:26Z,2018-05-22T19:54:16Z,2018-05-22T19:54:06Z,82.598876953125,used_percent,swap,host.local
|
||||
,,161,2018-05-22T19:53:26Z,2018-05-22T19:54:16Z,2018-05-22T19:54:16Z,82.6416015625,used_percent,swap,host.local
|
||||
,,162,2018-05-22T19:53:26Z,2018-05-22T19:54:16Z,2018-05-22T19:53:26Z,1.83,load1,system,host.local
|
||||
,,162,2018-05-22T19:53:26Z,2018-05-22T19:54:16Z,2018-05-22T19:53:36Z,1.7,load1,system,host.local
|
||||
,,162,2018-05-22T19:53:26Z,2018-05-22T19:54:16Z,2018-05-22T19:53:46Z,1.74,load1,system,host.local
|
||||
,,162,2018-05-22T19:53:26Z,2018-05-22T19:54:16Z,2018-05-22T19:53:56Z,1.63,load1,system,host.local
|
||||
,,162,2018-05-22T19:53:26Z,2018-05-22T19:54:16Z,2018-05-22T19:54:06Z,1.91,load1,system,host.local
|
||||
,,162,2018-05-22T19:53:26Z,2018-05-22T19:54:16Z,2018-05-22T19:54:16Z,1.84,load1,system,host.local
|
||||
,,163,2018-05-22T19:53:26Z,2018-05-22T19:54:16Z,2018-05-22T19:53:26Z,1.98,load15,system,host.local
|
||||
,,163,2018-05-22T19:53:26Z,2018-05-22T19:54:16Z,2018-05-22T19:53:36Z,1.97,load15,system,host.local
|
||||
,,163,2018-05-22T19:53:26Z,2018-05-22T19:54:16Z,2018-05-22T19:53:46Z,1.97,load15,system,host.local
|
||||
,,163,2018-05-22T19:53:26Z,2018-05-22T19:54:16Z,2018-05-22T19:53:56Z,1.96,load15,system,host.local
|
||||
,,163,2018-05-22T19:53:26Z,2018-05-22T19:54:16Z,2018-05-22T19:54:06Z,1.98,load15,system,host.local
|
||||
,,163,2018-05-22T19:53:26Z,2018-05-22T19:54:16Z,2018-05-22T19:54:16Z,1.97,load15,system,host.local
|
||||
,,164,2018-05-22T19:53:26Z,2018-05-22T19:54:16Z,2018-05-22T19:53:26Z,1.95,load5,system,host.local
|
||||
,,164,2018-05-22T19:53:26Z,2018-05-22T19:54:16Z,2018-05-22T19:53:36Z,1.92,load5,system,host.local
|
||||
,,164,2018-05-22T19:53:26Z,2018-05-22T19:54:16Z,2018-05-22T19:53:46Z,1.92,load5,system,host.local
|
||||
,,164,2018-05-22T19:53:26Z,2018-05-22T19:54:16Z,2018-05-22T19:53:56Z,1.89,load5,system,host.local
|
||||
,,164,2018-05-22T19:53:26Z,2018-05-22T19:54:16Z,2018-05-22T19:54:06Z,1.94,load5,system,host.local
|
||||
,,164,2018-05-22T19:53:26Z,2018-05-22T19:54:16Z,2018-05-22T19:54:16Z,1.93,load5,system,host.local
|
||||
"
|
||||
outData = "
|
||||
#datatype,string,long,dateTime:RFC3339,string,string,double
|
||||
#group,false,false,false,true,true,false
|
||||
#default,0,,,,,
|
||||
,result,table,_time,_measurement,host,used_percent
|
||||
,,0,2018-05-22T19:53:26Z,swap,host.local,82.9833984375
|
||||
,,0,2018-05-22T19:53:36Z,swap,host.local,82.598876953125
|
||||
,,0,2018-05-22T19:53:46Z,swap,host.local,82.598876953125
|
||||
,,0,2018-05-22T19:53:56Z,swap,host.local,82.598876953125
|
||||
,,0,2018-05-22T19:54:06Z,swap,host.local,82.598876953125
|
||||
,,0,2018-05-22T19:54:16Z,swap,host.local,82.6416015625
|
||||
|
||||
#datatype,string,long,dateTime:RFC3339,string,string,double,double,double
|
||||
#group,false,false,false,true,true,false,false,false
|
||||
#default,0,,,,,,,
|
||||
,result,table,_time,_measurement,host,load1,load15,load5
|
||||
,,1,2018-05-22T19:53:26Z,system,host.local,1.83,1.98,1.95
|
||||
,,1,2018-05-22T19:53:36Z,system,host.local,1.7,1.97,1.92
|
||||
,,1,2018-05-22T19:53:46Z,system,host.local,1.74,1.97,1.92
|
||||
,,1,2018-05-22T19:53:56Z,system,host.local,1.63,1.96,1.89
|
||||
,,1,2018-05-22T19:54:06Z,system,host.local,1.91,1.98,1.94
|
||||
,,1,2018-05-22T19:54:16Z,system,host.local,1.84,1.97,1.93
|
||||
"
|
||||
|
||||
t_pivot_fields = (table=<-) =>
|
||||
table
|
||||
|> range(start: 2018-05-22T19:53:26Z)
|
||||
|> pivot(rowKey: ["_time"], columnKey: ["_field"], valueColumn: "_value")
|
||||
|> yield(name:"0")
|
||||
|
||||
testingTest(name: "pivot_fields",
|
||||
input: testLoadStorage(csv: inData),
|
||||
want: testLoadMem(csv: outData),
|
||||
test: t_pivot_fields)
|
|
@ -0,0 +1,32 @@
|
|||
inData = "
|
||||
#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,dateTime:RFC3339,double,string,string,string,string,string,string
|
||||
#group,false,false,true,true,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:26Z,2018-05-22T19:54:16Z,2018-05-22T19:53:26Z,34.98234271799806,used_percent,disk,disk1s1,apfs,host.local,/
|
||||
,,96,2018-05-22T19:53:26Z,2018-05-22T19:54:16Z,2018-05-22T19:53:36Z,34.98234941084654,used_percent,disk,disk1s1,apfs,host.local,/
|
||||
,,96,2018-05-22T19:53:26Z,2018-05-22T19:54:16Z,2018-05-22T19:53:46Z,34.982447293755506,used_percent,disk,disk1s1,apfs,host.local,/
|
||||
,,96,2018-05-22T19:53:26Z,2018-05-22T19:54:16Z,2018-05-22T19:53:56Z,34.982447293755506,used_percent,disk,disk1s1,apfs,host.remote,/
|
||||
,,96,2018-05-22T19:53:26Z,2018-05-22T19:54:16Z,2018-05-22T19:54:06Z,34.98204153981662,used_percent,disk,disk1s1,apfs,host.remote,/
|
||||
,,96,2018-05-22T19:53:26Z,2018-05-22T19:54:16Z,2018-05-22T19:54:16Z,34.982252364543626,used_percent,disk,disk1s1,apfs,host.remote,/
|
||||
"
|
||||
outData = "
|
||||
#datatype,string,long,dateTime:RFC3339,string,string,double,double
|
||||
#group,false,false,true,true,true,false,false
|
||||
#default,0,,,,,,
|
||||
,result,table,_stop,_field,_measurement,host.local,host.remote
|
||||
,,0,2018-05-22T19:54:16Z,used_percent,disk,34.98237980753337,34.98224706603858
|
||||
"
|
||||
|
||||
t_pivot_mean = (table=<-) =>
|
||||
table
|
||||
|> range(start: 2018-05-22T19:53:26Z)
|
||||
|> group(columns: ["_stop", "_measurement", "_field", "host"])
|
||||
|> mean()
|
||||
|> pivot(rowKey: ["_stop"], columnKey: ["host"], valueColumn: "_value")
|
||||
|> yield(name:"0")
|
||||
|
||||
testingTest(name: "pivot_mean",
|
||||
input: testLoadStorage(csv: inData),
|
||||
want: testLoadMem(csv: outData),
|
||||
test: t_pivot_mean)
|
|
@ -0,0 +1,44 @@
|
|||
inData = "
|
||||
#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,dateTime:RFC3339,string,string,string,string,string,string
|
||||
#group,false,false,true,true,false,false,true,true,true,true,true
|
||||
#default,_result,,,,,,,,,,
|
||||
,result,table,_start,_stop,_time,_value,_field,taskID,orgID,state,_measurement
|
||||
,,0,2018-10-02T17:55:11.520461Z,2018-10-03T17:55:11.520461Z,2018-10-03T17:55:11.01114Z,02bac3c908f37000,runID,02bac3c8f0f37000,02bac3c8d6c5b000,started,records
|
||||
,,0,2018-10-02T17:55:11.520461Z,2018-10-03T17:55:11.520461Z,2018-10-03T17:55:11.113222Z,02bac3c922737000,runID,02bac3c8f0f37000,02bac3c8d6c5b000,started,records
|
||||
,,1,2018-10-02T17:55:11.520461Z,2018-10-03T17:55:11.520461Z,2018-10-03T17:55:10.920529Z,02bac3c8f1737000,runID,02bac3c8f0f37000,02bac3c8d6c5b000,success,records
|
||||
,,1,2018-10-02T17:55:11.520461Z,2018-10-03T17:55:11.520461Z,2018-10-03T17:55:11.01435Z,02bac3c908f37000,runID,02bac3c8f0f37000,02bac3c8d6c5b000,success,records
|
||||
,,1,2018-10-02T17:55:11.520461Z,2018-10-03T17:55:11.520461Z,2018-10-03T17:55:11.115415Z,02bac3c922737000,runID,02bac3c8f0f37000,02bac3c8d6c5b000,success,records
|
||||
,,2,2018-10-02T17:55:11.520461Z,2018-10-03T17:55:11.520461Z,2018-10-03T17:55:11.01114Z,2018-10-03T17:55:12Z,scheduledFor,02bac3c8f0f37000,02bac3c8d6c5b000,started,records
|
||||
,,2,2018-10-02T17:55:11.520461Z,2018-10-03T17:55:11.520461Z,2018-10-03T17:55:11.113222Z,2018-10-03T17:55:13Z,scheduledFor,02bac3c8f0f37000,02bac3c8d6c5b000,started,records
|
||||
,,3,2018-10-02T17:55:11.520461Z,2018-10-03T17:55:11.520461Z,2018-10-03T17:55:10.920529Z,2018-10-03T17:55:11Z,scheduledFor,02bac3c8f0f37000,02bac3c8d6c5b000,success,records
|
||||
,,3,2018-10-02T17:55:11.520461Z,2018-10-03T17:55:11.520461Z,2018-10-03T17:55:11.01435Z,2018-10-03T17:55:12Z,scheduledFor,02bac3c8f0f37000,02bac3c8d6c5b000,success,records
|
||||
,,3,2018-10-02T17:55:11.520461Z,2018-10-03T17:55:11.520461Z,2018-10-03T17:55:11.115415Z,2018-10-03T17:55:13Z,scheduledFor,02bac3c8f0f37000,02bac3c8d6c5b000,success,records
|
||||
,,4,2018-10-02T17:55:11.520461Z,2018-10-03T17:55:11.520461Z,2018-10-03T17:55:11.01114Z,1970-01-01T00:00:01Z,requestedAt,02bac3c8f0f37000,02bac3c8d6c5b000,started,records
|
||||
"
|
||||
outData = "
|
||||
#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,dateTime:RFC3339,string,string,string,string,string,string,string
|
||||
#group,false,false,true,true,false,true,true,true,true,false,false,false
|
||||
#default,_result,,,,,,,,,,,
|
||||
,result,table,_start,_stop,_time,taskID,orgID,state,_measurement,requestedAt,runID,scheduledFor
|
||||
,,0,2018-10-02T17:55:11.520461Z,2018-10-03T17:55:11.520461Z,2018-10-03T17:55:11.01114Z,02bac3c8f0f37000,02bac3c8d6c5b000,started,records,1970-01-01T00:00:01Z,02bac3c908f37000,2018-10-03T17:55:12Z
|
||||
,,0,2018-10-02T17:55:11.520461Z,2018-10-03T17:55:11.520461Z,2018-10-03T17:55:11.113222Z,02bac3c8f0f37000,02bac3c8d6c5b000,started,records,,02bac3c922737000,2018-10-03T17:55:13Z
|
||||
|
||||
#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,dateTime:RFC3339,string,string,string,string,string,string
|
||||
#group,false,false,true,true,false,true,true,true,true,false,false
|
||||
#default,_result,,,,,,,,,,
|
||||
,result,table,_start,_stop,_time,taskID,orgID,state,_measurement,runID,scheduledFor
|
||||
,,1,2018-10-02T17:55:11.520461Z,2018-10-03T17:55:11.520461Z,2018-10-03T17:55:10.920529Z,02bac3c8f0f37000,02bac3c8d6c5b000,success,records,02bac3c8f1737000,2018-10-03T17:55:11Z
|
||||
,,1,2018-10-02T17:55:11.520461Z,2018-10-03T17:55:11.520461Z,2018-10-03T17:55:11.01435Z,02bac3c8f0f37000,02bac3c8d6c5b000,success,records,02bac3c908f37000,2018-10-03T17:55:12Z
|
||||
,,1,2018-10-02T17:55:11.520461Z,2018-10-03T17:55:11.520461Z,2018-10-03T17:55:11.115415Z,02bac3c8f0f37000,02bac3c8d6c5b000,success,records,02bac3c922737000,2018-10-03T17:55:13Z
|
||||
"
|
||||
|
||||
t_pivot_task_test = (table=<-) =>
|
||||
table
|
||||
|> range(start: 2018-10-02T17:55:11.520461Z)
|
||||
|> filter(fn: (r) => r._measurement == "records" and r.taskID == "02bac3c8f0f37000" )
|
||||
|> pivot(rowKey: ["_time"], columnKey: ["_field"], valueColumn: "_value")
|
||||
|
||||
testingTest(name: "pivot_task_test",
|
||||
input: testLoadStorage(csv: inData),
|
||||
want: testLoadMem(csv: outData),
|
||||
test: t_pivot_task_test)
|
|
@ -0,0 +1,44 @@
|
|||
inData = "
|
||||
#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,dateTime:RFC3339,double,string,string,string,string
|
||||
#group,false,false,false,false,false,false,true,true,true,true
|
||||
#default,_result,,,,,,,,,
|
||||
,result,table,_start,_stop,_time,_value,_field,_measurement,cpu,host
|
||||
,,0,2018-05-22T19:52:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:50:26Z,0,usage_guest,cpu,cpu-total,host.local
|
||||
,,0,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:36Z,0,usage_guest,cpu,cpu-total,host.local
|
||||
,,0,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:46Z,0,usage_guest,cpu,cpu-total,host.local
|
||||
,,0,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:56Z,0,usage_guest,cpu,cpu-total,host.local
|
||||
,,0,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:54:06Z,0,usage_guest,cpu,cpu-total,host.local
|
||||
,,0,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:54:16Z,0,usage_guest,cpu,cpu-total,host.local
|
||||
,,1,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:26Z,0,usage_guest_nice,cpu,cpu-total,host.local
|
||||
,,1,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:36Z,0,usage_guest_nice,cpu,cpu-total,host.local
|
||||
,,1,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:46Z,0,usage_guest_nice,cpu,cpu-total,host.local
|
||||
,,1,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:56Z,0,usage_guest_nice,cpu,cpu-total,host.local
|
||||
,,1,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:54:06Z,0,usage_guest_nice,cpu,cpu-total,host.local
|
||||
,,1,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:54:16Z,0,usage_guest_nice,cpu,cpu-total,host.local
|
||||
"
|
||||
outData = "
|
||||
#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,dateTime:RFC3339,double,string,string,string,string
|
||||
#group,false,false,false,false,false,false,true,true,true,true
|
||||
#default,_result,,,,,,,,,
|
||||
,result,table,_start,_stop,_time,_value,_field,_measurement,cpu,host
|
||||
,,0,2018-05-22T19:53:36Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:36Z,0,usage_guest,cpu,cpu-total,host.local
|
||||
,,0,2018-05-22T19:53:36Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:46Z,0,usage_guest,cpu,cpu-total,host.local
|
||||
,,0,2018-05-22T19:53:36Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:56Z,0,usage_guest,cpu,cpu-total,host.local
|
||||
,,0,2018-05-22T19:53:36Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:54:06Z,0,usage_guest,cpu,cpu-total,host.local
|
||||
,,0,2018-05-22T19:53:36Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:54:16Z,0,usage_guest,cpu,cpu-total,host.local
|
||||
,,1,2018-05-22T19:53:36Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:36Z,0,usage_guest_nice,cpu,cpu-total,host.local
|
||||
,,1,2018-05-22T19:53:36Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:46Z,0,usage_guest_nice,cpu,cpu-total,host.local
|
||||
,,1,2018-05-22T19:53:36Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:56Z,0,usage_guest_nice,cpu,cpu-total,host.local
|
||||
,,1,2018-05-22T19:53:36Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:54:06Z,0,usage_guest_nice,cpu,cpu-total,host.local
|
||||
,,1,2018-05-22T19:53:36Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:54:16Z,0,usage_guest_nice,cpu,cpu-total,host.local
|
||||
"
|
||||
|
||||
t_range = (table=<-) =>
|
||||
table
|
||||
|> range(start:2018-05-22T19:53:36Z)
|
||||
|
||||
|
||||
testingTest(name: "range",
|
||||
input: testLoadStorage(csv: inData),
|
||||
want: testLoadMem(csv: outData),
|
||||
test: t_range)
|
|
@ -0,0 +1,60 @@
|
|||
inData = "
|
||||
#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,dateTime:RFC3339,double,string,string,string,string
|
||||
#group,false,false,false,false,false,false,true,true,true,true
|
||||
#default,_result,,,,,,,,,
|
||||
,result,table,_start,_stop,_time,_value,_field,_measurement,cpu,host
|
||||
,,0,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:26Z,0,usage_guest,cpu,cpu-total,host.local
|
||||
,,0,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:36Z,0,usage_guest,cpu,cpu-total,host.local
|
||||
,,0,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:46Z,0,usage_guest,cpu,cpu-total,host.local
|
||||
,,0,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:56Z,0,usage_guest,cpu,cpu-total,host.local
|
||||
,,0,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:54:06Z,0,usage_guest,cpu,cpu-total,host.local
|
||||
,,0,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:54:16Z,0,usage_guest,cpu,cpu-total,host.local
|
||||
,,1,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:26Z,0,usage_guest_nice,cpu,cpu-total,host.local
|
||||
,,1,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:36Z,0,usage_guest_nice,cpu,cpu-total,host.local
|
||||
,,1,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:46Z,0,usage_guest_nice,cpu,cpu-total,host.local
|
||||
,,1,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:56Z,0,usage_guest_nice,cpu,cpu-total,host.local
|
||||
,,1,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:54:06Z,0,usage_guest_nice,cpu,cpu-total,host.local
|
||||
,,1,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:54:16Z,0,usage_guest_nice,cpu,cpu-total,host.local
|
||||
,,2,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:26Z,91.7364670583823,usage_idle,cpu,cpu-total,host.local
|
||||
,,2,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:36Z,89.51118889861233,usage_idle,cpu,cpu-total,host.local
|
||||
,,2,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:46Z,91.0977744436109,usage_idle,cpu,cpu-total,host.local
|
||||
,,2,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:56Z,91.02836436336374,usage_idle,cpu,cpu-total,host.local
|
||||
,,2,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:54:06Z,68.304576144036,usage_idle,cpu,cpu-total,host.local
|
||||
,,2,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:54:16Z,87.88598574821853,usage_idle,cpu,cpu-total,host.local
|
||||
"
|
||||
outData = "
|
||||
#datatype,string,long,dateTime:RFC3339,double,string,string,string,string
|
||||
#group,false,false,false,false,true,true,true,true
|
||||
#default,_result,,,,,,,
|
||||
,result,table,_time,_value,_field,_measurement,cpu,server
|
||||
,,0,2018-05-22T19:53:26Z,0,usage_guest,cpu,cpu-total,host.local
|
||||
,,0,2018-05-22T19:53:36Z,0,usage_guest,cpu,cpu-total,host.local
|
||||
,,0,2018-05-22T19:53:46Z,0,usage_guest,cpu,cpu-total,host.local
|
||||
,,0,2018-05-22T19:53:56Z,0,usage_guest,cpu,cpu-total,host.local
|
||||
,,0,2018-05-22T19:54:06Z,0,usage_guest,cpu,cpu-total,host.local
|
||||
,,0,2018-05-22T19:54:16Z,0,usage_guest,cpu,cpu-total,host.local
|
||||
,,1,2018-05-22T19:53:26Z,0,usage_guest_nice,cpu,cpu-total,host.local
|
||||
,,1,2018-05-22T19:53:36Z,0,usage_guest_nice,cpu,cpu-total,host.local
|
||||
,,1,2018-05-22T19:53:46Z,0,usage_guest_nice,cpu,cpu-total,host.local
|
||||
,,1,2018-05-22T19:53:56Z,0,usage_guest_nice,cpu,cpu-total,host.local
|
||||
,,1,2018-05-22T19:54:06Z,0,usage_guest_nice,cpu,cpu-total,host.local
|
||||
,,1,2018-05-22T19:54:16Z,0,usage_guest_nice,cpu,cpu-total,host.local
|
||||
,,2,2018-05-22T19:53:26Z,91.7364670583823,usage_idle,cpu,cpu-total,host.local
|
||||
,,2,2018-05-22T19:53:36Z,89.51118889861233,usage_idle,cpu,cpu-total,host.local
|
||||
,,2,2018-05-22T19:53:46Z,91.0977744436109,usage_idle,cpu,cpu-total,host.local
|
||||
,,2,2018-05-22T19:53:56Z,91.02836436336374,usage_idle,cpu,cpu-total,host.local
|
||||
,,2,2018-05-22T19:54:06Z,68.304576144036,usage_idle,cpu,cpu-total,host.local
|
||||
,,2,2018-05-22T19:54:16Z,87.88598574821853,usage_idle,cpu,cpu-total,host.local
|
||||
"
|
||||
|
||||
t_rename = (table=<-) =>
|
||||
table
|
||||
|> range(start:2018-05-22T19:53:26Z)
|
||||
|> rename(columns:{host:"server"})
|
||||
|> drop(columns:["_start", "_stop"])
|
||||
|
||||
|
||||
testingTest(name: "rename",
|
||||
input: testLoadStorage(csv: inData),
|
||||
want: testLoadMem(csv: outData),
|
||||
test: t_rename)
|
|
@ -0,0 +1,57 @@
|
|||
inData = "
|
||||
#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,dateTime:RFC3339,double,string,string,string,string
|
||||
#group,false,false,false,false,false,false,true,true,true,true
|
||||
#default,_result,,,,,,,,,
|
||||
,result,table,_start,_stop,_time,_value,_field,_measurement,cpu,host
|
||||
,,0,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:26Z,0,usage_guest,cpu,cpu-total,host.local
|
||||
,,0,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:36Z,0,usage_guest,cpu,cpu-total,host.local
|
||||
,,0,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:46Z,0,usage_guest,cpu,cpu-total,host.local
|
||||
,,0,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:56Z,0,usage_guest,cpu,cpu-total,host.local
|
||||
,,0,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:54:06Z,0,usage_guest,cpu,cpu-total,host.local
|
||||
,,0,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:54:16Z,0,usage_guest,cpu,cpu-total,host.local
|
||||
,,1,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:26Z,0,usage_guest_nice,cpu,cpu-total,host.local
|
||||
,,1,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:36Z,0,usage_guest_nice,cpu,cpu-total,host.local
|
||||
,,1,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:46Z,0,usage_guest_nice,cpu,cpu-total,host.local
|
||||
,,1,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:56Z,0,usage_guest_nice,cpu,cpu-total,host.local
|
||||
,,1,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:54:06Z,0,usage_guest_nice,cpu,cpu-total,host.local
|
||||
,,1,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:54:16Z,0,usage_guest_nice,cpu,cpu-total,host.local
|
||||
,,2,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:26Z,91.7364670583823,usage_idle,cpu,cpu-total,host.local
|
||||
,,2,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:36Z,89.51118889861233,usage_idle,cpu,cpu-total,host.local
|
||||
,,2,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:46Z,91.0977744436109,usage_idle,cpu,cpu-total,host.local
|
||||
,,2,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:56Z,91.02836436336374,usage_idle,cpu,cpu-total,host.local
|
||||
,,2,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:54:06Z,68.304576144036,usage_idle,cpu,cpu-total,host.local
|
||||
"
|
||||
outData = "
|
||||
#datatype,string,long,dateTime:RFC3339,double,string,string,string,string
|
||||
#group,false,false,false,false,true,true,true,true
|
||||
#default,_result,,,,,,,
|
||||
,result,table,_time,_value,_field,_measurement,cpu,host
|
||||
,,0,2018-05-22T19:53:26Z,0,usage_guest,cpu,cpu-total,host.local
|
||||
,,0,2018-05-22T19:53:36Z,0,usage_guest,cpu,cpu-total,host.local
|
||||
,,0,2018-05-22T19:53:46Z,0,usage_guest,cpu,cpu-total,host.local
|
||||
,,0,2018-05-22T19:53:56Z,0,usage_guest,cpu,cpu-total,host.local
|
||||
,,0,2018-05-22T19:54:06Z,0,usage_guest,cpu,cpu-total,host.local
|
||||
,,0,2018-05-22T19:54:16Z,0,usage_guest,cpu,cpu-total,host.local
|
||||
,,1,2018-05-22T19:53:26Z,0,usage_guest_nice,cpu,cpu-total,host.local
|
||||
,,1,2018-05-22T19:53:36Z,0,usage_guest_nice,cpu,cpu-total,host.local
|
||||
,,1,2018-05-22T19:53:46Z,0,usage_guest_nice,cpu,cpu-total,host.local
|
||||
,,1,2018-05-22T19:53:56Z,0,usage_guest_nice,cpu,cpu-total,host.local
|
||||
,,1,2018-05-22T19:54:06Z,0,usage_guest_nice,cpu,cpu-total,host.local
|
||||
,,1,2018-05-22T19:54:16Z,0,usage_guest_nice,cpu,cpu-total,host.local
|
||||
,,2,2018-05-22T19:53:26Z,91.7364670583823,usage_idle,cpu,cpu-total,host.local
|
||||
,,2,2018-05-22T19:53:36Z,89.51118889861233,usage_idle,cpu,cpu-total,host.local
|
||||
,,2,2018-05-22T19:53:46Z,91.0977744436109,usage_idle,cpu,cpu-total,host.local
|
||||
,,2,2018-05-22T19:53:56Z,91.02836436336374,usage_idle,cpu,cpu-total,host.local
|
||||
,,2,2018-05-22T19:54:06Z,68.304576144036,usage_idle,cpu,cpu-total,host.local
|
||||
"
|
||||
|
||||
t_rename_fn = (table=<-) =>
|
||||
table
|
||||
|> range(start:2018-05-22T19:53:26Z)
|
||||
|> rename(fn: (column) => column)
|
||||
|> drop(fn: (column) => column == "_start" or column == "_stop")
|
||||
|
||||
testingTest(name: "rename_fn",
|
||||
input: testLoadStorage(csv: inData),
|
||||
want: testLoadMem(csv: outData),
|
||||
test: t_rename_fn)
|
|
@ -0,0 +1,59 @@
|
|||
inData = "
|
||||
#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,dateTime:RFC3339,double,string,string,string,string
|
||||
#group,false,false,false,false,false,false,true,true,true,true
|
||||
#default,_result,,,,,,,,,
|
||||
,result,table,_start,_stop,_time,_value,_field,_measurement,old,host
|
||||
,,0,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:26Z,0,usage_guest,cpu,cpu-total,host.local
|
||||
,,0,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:36Z,0,usage_guest,cpu,cpu-total,host.local
|
||||
,,0,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:46Z,0,usage_guest,cpu,cpu-total,host.local
|
||||
,,0,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:56Z,0,usage_guest,cpu,cpu-total,host.local
|
||||
,,0,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:54:06Z,0,usage_guest,cpu,cpu-total,host.local
|
||||
,,0,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:54:16Z,0,usage_guest,cpu,cpu-total,host.local
|
||||
,,1,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:26Z,0,usage_guest_nice,cpu,cpu-total,host.local
|
||||
,,1,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:36Z,0,usage_guest_nice,cpu,cpu-total,host.local
|
||||
,,1,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:46Z,0,usage_guest_nice,cpu,cpu-total,host.local
|
||||
,,1,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:56Z,0,usage_guest_nice,cpu,cpu-total,host.local
|
||||
,,1,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:54:06Z,0,usage_guest_nice,cpu,cpu-total,host.local
|
||||
,,1,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:54:16Z,0,usage_guest_nice,cpu,cpu-total,host.local
|
||||
,,2,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:26Z,91.7364670583823,usage_idle,cpu,cpu-total,host.local
|
||||
,,2,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:36Z,89.51118889861233,usage_idle,cpu,cpu-total,host.local
|
||||
,,2,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:46Z,91.0977744436109,usage_idle,cpu,cpu-total,host.local
|
||||
,,2,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:56Z,91.02836436336374,usage_idle,cpu,cpu-total,host.local
|
||||
,,2,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:54:06Z,68.304576144036,usage_idle,cpu,cpu-total,host.local
|
||||
,,2,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:54:16Z,87.88598574821853,usage_idle,cpu,cpu-total,host.local
|
||||
"
|
||||
outData = "
|
||||
#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,dateTime:RFC3339,double,string,string,string,string
|
||||
#group,false,false,false,false,false,false,true,true,true,true
|
||||
#default,_result,,,,,,,,,
|
||||
,result,table,_start,_stop,_time,_value,_field,_measurement,new1,host
|
||||
,,0,2018-05-22T19:53:26Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:26Z,0,usage_guest,cpu,cpu-total,host.local
|
||||
,,0,2018-05-22T19:53:26Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:36Z,0,usage_guest,cpu,cpu-total,host.local
|
||||
,,0,2018-05-22T19:53:26Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:46Z,0,usage_guest,cpu,cpu-total,host.local
|
||||
,,0,2018-05-22T19:53:26Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:56Z,0,usage_guest,cpu,cpu-total,host.local
|
||||
,,0,2018-05-22T19:53:26Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:54:06Z,0,usage_guest,cpu,cpu-total,host.local
|
||||
,,0,2018-05-22T19:53:26Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:54:16Z,0,usage_guest,cpu,cpu-total,host.local
|
||||
,,1,2018-05-22T19:53:26Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:26Z,0,usage_guest_nice,cpu,cpu-total,host.local
|
||||
,,1,2018-05-22T19:53:26Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:36Z,0,usage_guest_nice,cpu,cpu-total,host.local
|
||||
,,1,2018-05-22T19:53:26Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:46Z,0,usage_guest_nice,cpu,cpu-total,host.local
|
||||
,,1,2018-05-22T19:53:26Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:56Z,0,usage_guest_nice,cpu,cpu-total,host.local
|
||||
,,1,2018-05-22T19:53:26Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:54:06Z,0,usage_guest_nice,cpu,cpu-total,host.local
|
||||
,,1,2018-05-22T19:53:26Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:54:16Z,0,usage_guest_nice,cpu,cpu-total,host.local
|
||||
,,2,2018-05-22T19:53:26Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:26Z,91.7364670583823,usage_idle,cpu,cpu-total,host.local
|
||||
,,2,2018-05-22T19:53:26Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:36Z,89.51118889861233,usage_idle,cpu,cpu-total,host.local
|
||||
,,2,2018-05-22T19:53:26Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:46Z,91.0977744436109,usage_idle,cpu,cpu-total,host.local
|
||||
,,2,2018-05-22T19:53:26Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:56Z,91.02836436336374,usage_idle,cpu,cpu-total,host.local
|
||||
,,2,2018-05-22T19:53:26Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:54:06Z,68.304576144036,usage_idle,cpu,cpu-total,host.local
|
||||
,,2,2018-05-22T19:53:26Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:54:16Z,87.88598574821853,usage_idle,cpu,cpu-total,host.local
|
||||
"
|
||||
|
||||
t_rename_multiple = (table=<-) =>
|
||||
table
|
||||
|> range(start:2018-05-22T19:53:26Z)
|
||||
|> rename(columns: {old:"new"})
|
||||
|> rename(columns: {new: "new1"})
|
||||
|
||||
testingTest(name: "rename_multiple",
|
||||
input: testLoadStorage(csv: inData),
|
||||
want: testLoadMem(csv: outData),
|
||||
test: t_rename_multiple)
|
|
@ -0,0 +1,56 @@
|
|||
inData = "
|
||||
#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,dateTime:RFC3339,double,string,string,string
|
||||
#group,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
|
||||
,,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
|
||||
,,162,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:54:18Z,1.85,load1,system,host.local
|
||||
,,162,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:54:21Z,1.86,load1,system,host.local
|
||||
,,162,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:54:22Z,1.87,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
|
||||
"
|
||||
outData = "
|
||||
#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,dateTime:RFC3339,double,string,string,string
|
||||
#group,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:36Z,1.7,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:21Z,1.86,load1,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: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:36Z,1.92,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
|
||||
,,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:54:06Z,82.598876953125,used_percent,swap,host.local
|
||||
"
|
||||
|
||||
t_sample = (table=<-) =>
|
||||
table
|
||||
|> sample(n: 3, pos: 1)
|
||||
testingTest(name: "sample",
|
||||
input: testLoadStorage(csv: inData),
|
||||
want: testLoadMem(csv: outData),
|
||||
test: t_sample)
|
|
@ -0,0 +1,55 @@
|
|||
inData = "
|
||||
#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,dateTime:RFC3339,double,string,string,string
|
||||
#group,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
|
||||
,,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
|
||||
"
|
||||
outData = "
|
||||
#datatype,string,long,dateTime:RFC3339,string,dateTime:RFC3339,double
|
||||
#group,false,false,true,true,false,false
|
||||
#default,0,,,,,
|
||||
,result,table,_start,_measurement,_time,used_percent
|
||||
,,0,2018-05-22T19:53:24.421470485Z,swap,2018-05-22T19:53:26Z,82.9833984375
|
||||
,,0,2018-05-22T19:53:24.421470485Z,swap,2018-05-22T19:53:36Z,82.598876953125
|
||||
,,0,2018-05-22T19:53:24.421470485Z,swap,2018-05-22T19:53:46Z,82.598876953125
|
||||
,,0,2018-05-22T19:53:24.421470485Z,swap,2018-05-22T19:53:56Z,82.598876953125
|
||||
,,0,2018-05-22T19:53:24.421470485Z,swap,2018-05-22T19:54:06Z,82.598876953125
|
||||
,,0,2018-05-22T19:53:24.421470485Z,swap,2018-05-22T19:54:16Z,82.6416015625
|
||||
"
|
||||
|
||||
t_select_measurement = (table=<-) =>
|
||||
table
|
||||
|> range(start: 2018-05-21T13:09:22.885021542Z)
|
||||
|> filter(fn: (r) => r._measurement == "swap")
|
||||
|> group(columns: ["_measurement", "_start"])
|
||||
|> map(fn: (r) => ({_time: r._time, used_percent:r._value}))
|
||||
|> yield(name:"0")
|
||||
|
||||
testingTest(name: "select_measurement",
|
||||
input: testLoadStorage(csv: inData),
|
||||
want: testLoadMem(csv: outData),
|
||||
test: t_select_measurement)
|
|
@ -0,0 +1 @@
|
|||
{"results":[{"statement_id":0,"series":[{"name":"swap","columns":["time","used_percent"],"values":[["2018-05-22T19:53:26Z",82.9833984375],["2018-05-22T19:53:36Z",82.598876953125],["2018-05-22T19:53:46Z",82.598876953125],["2018-05-22T19:53:56Z",82.598876953125],["2018-05-22T19:54:06Z",82.598876953125],["2018-05-22T19:54:16Z",82.6416015625]]}]}]}
|
|
@ -0,0 +1,61 @@
|
|||
inData = "
|
||||
#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,dateTime:RFC3339,double,string,string,string
|
||||
#group,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:26Z,2018-05-22T19:54:16Z,2018-05-22T19:53:26Z,82.9833984375,used_percent,swap,host.local
|
||||
,,161,2018-05-22T19:53:26Z,2018-05-22T19:54:16Z,2018-05-22T19:53:36Z,82.598876953125,used_percent,swap,host.local
|
||||
,,161,2018-05-22T19:53:26Z,2018-05-22T19:54:16Z,2018-05-22T19:53:46Z,82.598876953125,used_percent,swap,host.local
|
||||
,,161,2018-05-22T19:53:26Z,2018-05-22T19:54:16Z,2018-05-22T19:53:56Z,82.598876953125,used_percent,swap,host.local
|
||||
,,161,2018-05-22T19:53:26Z,2018-05-22T19:54:16Z,2018-05-22T19:54:06Z,82.598876953125,used_percent,swap,host.local
|
||||
,,161,2018-05-22T19:53:26Z,2018-05-22T19:54:16Z,2018-05-22T19:54:16Z,82.6416015625,used_percent,swap,host.local
|
||||
,,161,2018-05-22T19:53:26Z,2018-05-22T19:54:16Z,2018-05-22T19:53:26Z,2.9833984375,used_percent,swap,host1.local
|
||||
,,161,2018-05-22T19:53:26Z,2018-05-22T19:54:16Z,2018-05-22T19:53:36Z,2.598876953125,used_percent,swap,host1.local
|
||||
,,161,2018-05-22T19:53:26Z,2018-05-22T19:54:16Z,2018-05-22T19:53:46Z,2.598876953125,used_percent,swap,host1.local
|
||||
,,161,2018-05-22T19:53:26Z,2018-05-22T19:54:16Z,2018-05-22T19:53:56Z,2.598876953125,used_percent,swap,host1.local
|
||||
,,161,2018-05-22T19:53:26Z,2018-05-22T19:54:16Z,2018-05-22T19:54:06Z,2.598876953125,used_percent,swap,host1.local
|
||||
,,161,2018-05-22T19:53:26Z,2018-05-22T19:54:16Z,2018-05-22T19:54:16Z,2.6416015625,used_percent,swap,host1.local
|
||||
,,162,2018-05-22T19:53:26Z,2018-05-22T19:54:16Z,2018-05-22T19:53:26Z,1.83,load1,system,host.local
|
||||
,,162,2018-05-22T19:53:26Z,2018-05-22T19:54:16Z,2018-05-22T19:53:36Z,1.7,load1,system,host.local
|
||||
,,162,2018-05-22T19:53:26Z,2018-05-22T19:54:16Z,2018-05-22T19:53:46Z,1.74,load1,system,host.local
|
||||
,,162,2018-05-22T19:53:26Z,2018-05-22T19:54:16Z,2018-05-22T19:53:56Z,1.63,load1,system,host.local
|
||||
,,162,2018-05-22T19:53:26Z,2018-05-22T19:54:16Z,2018-05-22T19:54:06Z,1.91,load1,system,host.local
|
||||
,,162,2018-05-22T19:53:26Z,2018-05-22T19:54:16Z,2018-05-22T19:54:16Z,1.84,load1,system,host.local
|
||||
,,163,2018-05-22T19:53:26Z,2018-05-22T19:54:16Z,2018-05-22T19:53:26Z,1.98,load15,system,host.local
|
||||
,,163,2018-05-22T19:53:26Z,2018-05-22T19:54:16Z,2018-05-22T19:53:36Z,1.97,load15,system,host.local
|
||||
,,163,2018-05-22T19:53:26Z,2018-05-22T19:54:16Z,2018-05-22T19:53:46Z,1.97,load15,system,host.local
|
||||
,,163,2018-05-22T19:53:26Z,2018-05-22T19:54:16Z,2018-05-22T19:53:56Z,1.96,load15,system,host.local
|
||||
,,163,2018-05-22T19:53:26Z,2018-05-22T19:54:16Z,2018-05-22T19:54:06Z,1.98,load15,system,host.local
|
||||
,,163,2018-05-22T19:53:26Z,2018-05-22T19:54:16Z,2018-05-22T19:54:16Z,1.97,load15,system,host.local
|
||||
,,164,2018-05-22T19:53:26Z,2018-05-22T19:54:16Z,2018-05-22T19:53:26Z,1.95,load5,system,host.local
|
||||
,,164,2018-05-22T19:53:26Z,2018-05-22T19:54:16Z,2018-05-22T19:53:36Z,1.92,load5,system,host.local
|
||||
,,164,2018-05-22T19:53:26Z,2018-05-22T19:54:16Z,2018-05-22T19:53:46Z,1.92,load5,system,host.local
|
||||
,,164,2018-05-22T19:53:26Z,2018-05-22T19:54:16Z,2018-05-22T19:53:56Z,1.89,load5,system,host.local
|
||||
,,164,2018-05-22T19:53:26Z,2018-05-22T19:54:16Z,2018-05-22T19:54:06Z,1.94,load5,system,host.local
|
||||
,,164,2018-05-22T19:53:26Z,2018-05-22T19:54:16Z,2018-05-22T19:54:16Z,1.93,load5,system,host.local
|
||||
"
|
||||
outData = "
|
||||
#datatype,string,long,dateTime:RFC3339,string,dateTime:RFC3339,double
|
||||
#group,false,false,true,true,false,false
|
||||
#default,0,,,,,
|
||||
,result,table,_start,_measurement,_time,load1
|
||||
,,0,2018-05-22T19:53:26Z,system,2018-05-22T19:53:26Z,1.83
|
||||
,,0,2018-05-22T19:53:26Z,system,2018-05-22T19:53:36Z,1.7
|
||||
,,0,2018-05-22T19:53:26Z,system,2018-05-22T19:53:46Z,1.74
|
||||
,,0,2018-05-22T19:53:26Z,system,2018-05-22T19:53:56Z,1.63
|
||||
,,0,2018-05-22T19:53:26Z,system,2018-05-22T19:54:06Z,1.91
|
||||
,,0,2018-05-22T19:53:26Z,system,2018-05-22T19:54:16Z,1.84
|
||||
"
|
||||
|
||||
t_select_measurement_field = (table=<-) =>
|
||||
table
|
||||
|> range(start: 2018-05-22T19:53:26Z)
|
||||
|> filter(fn: (r) => r._measurement == "system" and r._field == "load1")
|
||||
|> group(columns: ["_measurement", "_start"])
|
||||
|> map(fn: (r) => ({_time: r._time, load1:r._value}))
|
||||
|> yield(name:"0")
|
||||
|
||||
testingTest(name: "select_measurement_field",
|
||||
input: testLoadStorage(csv: inData),
|
||||
want: testLoadMem(csv: outData),
|
||||
test: t_select_measurement_field)
|
|
@ -0,0 +1 @@
|
|||
{"results":[{"statement_id":0,"series":[{"name":"system","columns":["time","load1"],"values":[["2018-05-22T19:53:26Z",1.83],["2018-05-22T19:53:36Z",1.7],["2018-05-22T19:53:46Z",1.74],["2018-05-22T19:53:56Z",1.63],["2018-05-22T19:54:06Z",1.91],["2018-05-22T19:54:16Z",1.84]]}]}]}
|
|
@ -0,0 +1,32 @@
|
|||
inData = "
|
||||
#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,dateTime:RFC3339,double,string,string,string
|
||||
#group,false,false,false,false,false,false,true,true,true
|
||||
#default,_result,,,,,,,,
|
||||
,result,table,_start,_stop,_time,_value,_field,_measurement,host
|
||||
,,140,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:26Z,36.946678161621094,available_percent,mem,host1
|
||||
,,140,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:36Z,37.28463649749756,available_percent,mem,host2
|
||||
,,140,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:46Z,37.61239051818848,available_percent,mem,host3
|
||||
,,140,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:56Z,37.25404739379883,available_percent,mem,host4
|
||||
,,140,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:54:06Z,37.21816539764404,available_percent,mem,host5
|
||||
,,140,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:54:16Z,37.53254413604736,available_percent,mem,host5
|
||||
"
|
||||
outData = "
|
||||
#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,dateTime:RFC3339,double,string,string,string
|
||||
#group,false,false,false,false,false,false,false,false,true
|
||||
#default,_result,,,,,,,,
|
||||
,result,table,_start,_stop,_time,_value,_field,_measurement,host
|
||||
,,0,2018-05-22T19:53:26Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:36Z,37.28463649749756,available_percent,mem,host2
|
||||
,,1,2018-05-22T19:53:26Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:46Z,37.61239051818848,available_percent,mem,host3
|
||||
,,2,2018-05-22T19:53:26Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:54:16Z,37.53254413604736,available_percent,mem,host5
|
||||
"
|
||||
|
||||
t_selector_preserve_time = (table=<-) =>
|
||||
table
|
||||
|> range(start:2018-05-22T19:53:26Z)
|
||||
|> top(n:3)
|
||||
|> group(columns:["host"])
|
||||
|
||||
testingTest(name: "selector_preserve_time",
|
||||
input: testLoadStorage(csv: inData),
|
||||
want: testLoadMem(csv: outData),
|
||||
test: t_selector_preserve_time)
|
|
@ -0,0 +1,183 @@
|
|||
inData = "
|
||||
#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,string,string,string,dateTime:RFC3339,boolean
|
||||
#group,false,false,false,false,true,true,true,false,false
|
||||
#default,,,,,,,,,
|
||||
,result,table,_start,_stop,_measurement,_field,t0,_time,_value
|
||||
,,0,2018-12-19T22:13:30Z,2018-12-19T22:14:20Z,thmWJ,GK1Ji,SbkiNS9,2018-12-19T22:13:30Z,false
|
||||
,,0,2018-12-19T22:13:30Z,2018-12-19T22:14:20Z,thmWJ,GK1Ji,SbkiNS9,2018-12-19T22:13:40Z,true
|
||||
,,0,2018-12-19T22:13:30Z,2018-12-19T22:14:20Z,thmWJ,GK1Ji,SbkiNS9,2018-12-19T22:13:50Z,false
|
||||
,,0,2018-12-19T22:13:30Z,2018-12-19T22:14:20Z,thmWJ,GK1Ji,SbkiNS9,2018-12-19T22:14:00Z,false
|
||||
,,0,2018-12-19T22:13:30Z,2018-12-19T22:14:20Z,thmWJ,GK1Ji,SbkiNS9,2018-12-19T22:14:10Z,true
|
||||
,,0,2018-12-19T22:13:30Z,2018-12-19T22:14:20Z,thmWJ,GK1Ji,SbkiNS9,2018-12-19T22:14:20Z,true
|
||||
,,1,2018-12-19T22:13:30Z,2018-12-19T22:14:20Z,thmWJ,GK1Ji,gpmhNEw,2018-12-19T22:13:30Z,false
|
||||
,,1,2018-12-19T22:13:30Z,2018-12-19T22:14:20Z,thmWJ,GK1Ji,gpmhNEw,2018-12-19T22:13:40Z,true
|
||||
,,1,2018-12-19T22:13:30Z,2018-12-19T22:14:20Z,thmWJ,GK1Ji,gpmhNEw,2018-12-19T22:13:50Z,false
|
||||
,,1,2018-12-19T22:13:30Z,2018-12-19T22:14:20Z,thmWJ,GK1Ji,gpmhNEw,2018-12-19T22:14:00Z,true
|
||||
,,1,2018-12-19T22:13:30Z,2018-12-19T22:14:20Z,thmWJ,GK1Ji,gpmhNEw,2018-12-19T22:14:10Z,true
|
||||
,,1,2018-12-19T22:13:30Z,2018-12-19T22:14:20Z,thmWJ,GK1Ji,gpmhNEw,2018-12-19T22:14:20Z,true
|
||||
|
||||
#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,string,string,string,dateTime:RFC3339,double
|
||||
#group,false,false,false,false,true,true,true,false,false
|
||||
#default,,,,,,,,,
|
||||
,result,table,_start,_stop,_measurement,_field,t0,_time,_value
|
||||
,,2,2018-12-19T22:13:30Z,2018-12-19T22:14:20Z,thmWJ,c9wjx7r,SbkiNS9,2018-12-19T22:13:30Z,-61.68790887989735
|
||||
,,2,2018-12-19T22:13:30Z,2018-12-19T22:14:20Z,thmWJ,c9wjx7r,SbkiNS9,2018-12-19T22:13:40Z,-6.3173755351186465
|
||||
,,2,2018-12-19T22:13:30Z,2018-12-19T22:14:20Z,thmWJ,c9wjx7r,SbkiNS9,2018-12-19T22:13:50Z,-26.049728557657513
|
||||
,,2,2018-12-19T22:13:30Z,2018-12-19T22:14:20Z,thmWJ,c9wjx7r,SbkiNS9,2018-12-19T22:14:00Z,114.285955884979
|
||||
,,2,2018-12-19T22:13:30Z,2018-12-19T22:14:20Z,thmWJ,c9wjx7r,SbkiNS9,2018-12-19T22:14:10Z,16.140262630578995
|
||||
,,2,2018-12-19T22:13:30Z,2018-12-19T22:14:20Z,thmWJ,c9wjx7r,SbkiNS9,2018-12-19T22:14:20Z,29.50336437998469
|
||||
,,3,2018-12-19T22:13:30Z,2018-12-19T22:14:20Z,thmWJ,c9wjx7r,gpmhNEw,2018-12-19T22:13:30Z,7.940387008821781
|
||||
,,3,2018-12-19T22:13:30Z,2018-12-19T22:14:20Z,thmWJ,c9wjx7r,gpmhNEw,2018-12-19T22:13:40Z,49.460104214779086
|
||||
,,3,2018-12-19T22:13:30Z,2018-12-19T22:14:20Z,thmWJ,c9wjx7r,gpmhNEw,2018-12-19T22:13:50Z,-36.564150808873954
|
||||
,,3,2018-12-19T22:13:30Z,2018-12-19T22:14:20Z,thmWJ,c9wjx7r,gpmhNEw,2018-12-19T22:14:00Z,34.319039251798635
|
||||
,,3,2018-12-19T22:13:30Z,2018-12-19T22:14:20Z,thmWJ,c9wjx7r,gpmhNEw,2018-12-19T22:14:10Z,79.27019811403116
|
||||
,,3,2018-12-19T22:13:30Z,2018-12-19T22:14:20Z,thmWJ,c9wjx7r,gpmhNEw,2018-12-19T22:14:20Z,41.91029522104053
|
||||
|
||||
#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,string,string,string,dateTime:RFC3339,long
|
||||
#group,false,false,false,false,true,true,true,false,false
|
||||
#default,,,,,,,,,
|
||||
,result,table,_start,_stop,_measurement,_field,t0,_time,_value
|
||||
,,4,2018-12-19T22:13:30Z,2018-12-19T22:14:20Z,thmWJ,iUcIq,SbkiNS9,2018-12-19T22:13:30Z,-44
|
||||
,,4,2018-12-19T22:13:30Z,2018-12-19T22:14:20Z,thmWJ,iUcIq,SbkiNS9,2018-12-19T22:13:40Z,-25
|
||||
,,4,2018-12-19T22:13:30Z,2018-12-19T22:14:20Z,thmWJ,iUcIq,SbkiNS9,2018-12-19T22:13:50Z,46
|
||||
,,4,2018-12-19T22:13:30Z,2018-12-19T22:14:20Z,thmWJ,iUcIq,SbkiNS9,2018-12-19T22:14:00Z,-2
|
||||
,,4,2018-12-19T22:13:30Z,2018-12-19T22:14:20Z,thmWJ,iUcIq,SbkiNS9,2018-12-19T22:14:10Z,-14
|
||||
,,4,2018-12-19T22:13:30Z,2018-12-19T22:14:20Z,thmWJ,iUcIq,SbkiNS9,2018-12-19T22:14:20Z,-53
|
||||
,,5,2018-12-19T22:13:30Z,2018-12-19T22:14:20Z,thmWJ,iUcIq,gpmhNEw,2018-12-19T22:13:30Z,17
|
||||
,,5,2018-12-19T22:13:30Z,2018-12-19T22:14:20Z,thmWJ,iUcIq,gpmhNEw,2018-12-19T22:13:40Z,-44
|
||||
,,5,2018-12-19T22:13:30Z,2018-12-19T22:14:20Z,thmWJ,iUcIq,gpmhNEw,2018-12-19T22:13:50Z,-99
|
||||
,,5,2018-12-19T22:13:30Z,2018-12-19T22:14:20Z,thmWJ,iUcIq,gpmhNEw,2018-12-19T22:14:00Z,-85
|
||||
,,5,2018-12-19T22:13:30Z,2018-12-19T22:14:20Z,thmWJ,iUcIq,gpmhNEw,2018-12-19T22:14:10Z,18
|
||||
,,5,2018-12-19T22:13:30Z,2018-12-19T22:14:20Z,thmWJ,iUcIq,gpmhNEw,2018-12-19T22:14:20Z,99
|
||||
|
||||
#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,string,string,string,dateTime:RFC3339,string
|
||||
#group,false,false,false,false,true,true,true,false,false
|
||||
#default,,,,,,,,,
|
||||
,result,table,_start,_stop,_measurement,_field,t0,_time,_value
|
||||
,,6,2018-12-19T22:13:30Z,2018-12-19T22:14:20Z,thmWJ,urO72,SbkiNS9,2018-12-19T22:13:30Z,xRbS
|
||||
,,6,2018-12-19T22:13:30Z,2018-12-19T22:14:20Z,thmWJ,urO72,SbkiNS9,2018-12-19T22:13:40Z,PtTh
|
||||
,,6,2018-12-19T22:13:30Z,2018-12-19T22:14:20Z,thmWJ,urO72,SbkiNS9,2018-12-19T22:13:50Z,ZjN2je
|
||||
,,6,2018-12-19T22:13:30Z,2018-12-19T22:14:20Z,thmWJ,urO72,SbkiNS9,2018-12-19T22:14:00Z,YZNBh
|
||||
,,6,2018-12-19T22:13:30Z,2018-12-19T22:14:20Z,thmWJ,urO72,SbkiNS9,2018-12-19T22:14:10Z,pu08
|
||||
,,6,2018-12-19T22:13:30Z,2018-12-19T22:14:20Z,thmWJ,urO72,SbkiNS9,2018-12-19T22:14:20Z,ixlOdT
|
||||
,,7,2018-12-19T22:13:30Z,2018-12-19T22:14:20Z,thmWJ,urO72,gpmhNEw,2018-12-19T22:13:30Z,YqV
|
||||
,,7,2018-12-19T22:13:30Z,2018-12-19T22:14:20Z,thmWJ,urO72,gpmhNEw,2018-12-19T22:13:40Z,GjbWF
|
||||
,,7,2018-12-19T22:13:30Z,2018-12-19T22:14:20Z,thmWJ,urO72,gpmhNEw,2018-12-19T22:13:50Z,GiX1Bb
|
||||
,,7,2018-12-19T22:13:30Z,2018-12-19T22:14:20Z,thmWJ,urO72,gpmhNEw,2018-12-19T22:14:00Z,DQCZXZ
|
||||
,,7,2018-12-19T22:13:30Z,2018-12-19T22:14:20Z,thmWJ,urO72,gpmhNEw,2018-12-19T22:14:10Z,atopRR2
|
||||
,,7,2018-12-19T22:13:30Z,2018-12-19T22:14:20Z,thmWJ,urO72,gpmhNEw,2018-12-19T22:14:20Z,TNKKB
|
||||
|
||||
#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,string,string,string,dateTime:RFC3339,unsignedLong
|
||||
#group,false,false,false,false,true,true,true,false,false
|
||||
#default,,,,,,,,,
|
||||
,result,table,_start,_stop,_measurement,_field,t0,_time,_value
|
||||
,,8,2018-12-19T22:13:30Z,2018-12-19T22:14:20Z,thmWJ,zmk1YWi,SbkiNS9,2018-12-19T22:13:30Z,84
|
||||
,,8,2018-12-19T22:13:30Z,2018-12-19T22:14:20Z,thmWJ,zmk1YWi,SbkiNS9,2018-12-19T22:13:40Z,52
|
||||
,,8,2018-12-19T22:13:30Z,2018-12-19T22:14:20Z,thmWJ,zmk1YWi,SbkiNS9,2018-12-19T22:13:50Z,23
|
||||
,,8,2018-12-19T22:13:30Z,2018-12-19T22:14:20Z,thmWJ,zmk1YWi,SbkiNS9,2018-12-19T22:14:00Z,62
|
||||
,,8,2018-12-19T22:13:30Z,2018-12-19T22:14:20Z,thmWJ,zmk1YWi,SbkiNS9,2018-12-19T22:14:10Z,22
|
||||
,,8,2018-12-19T22:13:30Z,2018-12-19T22:14:20Z,thmWJ,zmk1YWi,SbkiNS9,2018-12-19T22:14:20Z,78
|
||||
,,9,2018-12-19T22:13:30Z,2018-12-19T22:14:20Z,thmWJ,zmk1YWi,gpmhNEw,2018-12-19T22:13:30Z,79
|
||||
,,9,2018-12-19T22:13:30Z,2018-12-19T22:14:20Z,thmWJ,zmk1YWi,gpmhNEw,2018-12-19T22:13:40Z,33
|
||||
,,9,2018-12-19T22:13:30Z,2018-12-19T22:14:20Z,thmWJ,zmk1YWi,gpmhNEw,2018-12-19T22:13:50Z,97
|
||||
,,9,2018-12-19T22:13:30Z,2018-12-19T22:14:20Z,thmWJ,zmk1YWi,gpmhNEw,2018-12-19T22:14:00Z,90
|
||||
,,9,2018-12-19T22:13:30Z,2018-12-19T22:14:20Z,thmWJ,zmk1YWi,gpmhNEw,2018-12-19T22:14:10Z,96
|
||||
,,9,2018-12-19T22:13:30Z,2018-12-19T22:14:20Z,thmWJ,zmk1YWi,gpmhNEw,2018-12-19T22:14:20Z,10
|
||||
"
|
||||
outData = "
|
||||
#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,string,string,string,dateTime:RFC3339,boolean
|
||||
#group,false,false,false,false,true,true,true,false,false
|
||||
#default,_result,,,,,,,,
|
||||
,result,table,_start,_stop,_measurement,_field,t0,_time,_value
|
||||
,,0,2018-12-19T22:13:30Z,2018-12-19T22:14:20Z,thmWJ,GK1Ji,server01,2018-12-19T22:13:30Z,false
|
||||
,,0,2018-12-19T22:13:30Z,2018-12-19T22:14:20Z,thmWJ,GK1Ji,server01,2018-12-19T22:13:40Z,true
|
||||
,,0,2018-12-19T22:13:30Z,2018-12-19T22:14:20Z,thmWJ,GK1Ji,server01,2018-12-19T22:13:50Z,false
|
||||
,,0,2018-12-19T22:13:30Z,2018-12-19T22:14:20Z,thmWJ,GK1Ji,server01,2018-12-19T22:14:00Z,false
|
||||
,,0,2018-12-19T22:13:30Z,2018-12-19T22:14:20Z,thmWJ,GK1Ji,server01,2018-12-19T22:14:10Z,true
|
||||
,,0,2018-12-19T22:13:30Z,2018-12-19T22:14:20Z,thmWJ,GK1Ji,server01,2018-12-19T22:14:20Z,true
|
||||
,,0,2018-12-19T22:13:30Z,2018-12-19T22:14:20Z,thmWJ,GK1Ji,server01,2018-12-19T22:13:30Z,false
|
||||
,,0,2018-12-19T22:13:30Z,2018-12-19T22:14:20Z,thmWJ,GK1Ji,server01,2018-12-19T22:13:40Z,true
|
||||
,,0,2018-12-19T22:13:30Z,2018-12-19T22:14:20Z,thmWJ,GK1Ji,server01,2018-12-19T22:13:50Z,false
|
||||
,,0,2018-12-19T22:13:30Z,2018-12-19T22:14:20Z,thmWJ,GK1Ji,server01,2018-12-19T22:14:00Z,true
|
||||
,,0,2018-12-19T22:13:30Z,2018-12-19T22:14:20Z,thmWJ,GK1Ji,server01,2018-12-19T22:14:10Z,true
|
||||
,,0,2018-12-19T22:13:30Z,2018-12-19T22:14:20Z,thmWJ,GK1Ji,server01,2018-12-19T22:14:20Z,true
|
||||
|
||||
#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,string,string,string,dateTime:RFC3339,double
|
||||
#group,false,false,false,false,true,true,true,false,false
|
||||
#default,_result,,,,,,,,
|
||||
,result,table,_start,_stop,_measurement,_field,t0,_time,_value
|
||||
,,1,2018-12-19T22:13:30Z,2018-12-19T22:14:20Z,thmWJ,c9wjx7r,server01,2018-12-19T22:13:30Z,-61.68790887989735
|
||||
,,1,2018-12-19T22:13:30Z,2018-12-19T22:14:20Z,thmWJ,c9wjx7r,server01,2018-12-19T22:13:40Z,-6.3173755351186465
|
||||
,,1,2018-12-19T22:13:30Z,2018-12-19T22:14:20Z,thmWJ,c9wjx7r,server01,2018-12-19T22:13:50Z,-26.049728557657513
|
||||
,,1,2018-12-19T22:13:30Z,2018-12-19T22:14:20Z,thmWJ,c9wjx7r,server01,2018-12-19T22:14:00Z,114.285955884979
|
||||
,,1,2018-12-19T22:13:30Z,2018-12-19T22:14:20Z,thmWJ,c9wjx7r,server01,2018-12-19T22:14:10Z,16.140262630578995
|
||||
,,1,2018-12-19T22:13:30Z,2018-12-19T22:14:20Z,thmWJ,c9wjx7r,server01,2018-12-19T22:14:20Z,29.50336437998469
|
||||
,,1,2018-12-19T22:13:30Z,2018-12-19T22:14:20Z,thmWJ,c9wjx7r,server01,2018-12-19T22:13:30Z,7.940387008821781
|
||||
,,1,2018-12-19T22:13:30Z,2018-12-19T22:14:20Z,thmWJ,c9wjx7r,server01,2018-12-19T22:13:40Z,49.460104214779086
|
||||
,,1,2018-12-19T22:13:30Z,2018-12-19T22:14:20Z,thmWJ,c9wjx7r,server01,2018-12-19T22:13:50Z,-36.564150808873954
|
||||
,,1,2018-12-19T22:13:30Z,2018-12-19T22:14:20Z,thmWJ,c9wjx7r,server01,2018-12-19T22:14:00Z,34.319039251798635
|
||||
,,1,2018-12-19T22:13:30Z,2018-12-19T22:14:20Z,thmWJ,c9wjx7r,server01,2018-12-19T22:14:10Z,79.27019811403116
|
||||
,,1,2018-12-19T22:13:30Z,2018-12-19T22:14:20Z,thmWJ,c9wjx7r,server01,2018-12-19T22:14:20Z,41.91029522104053
|
||||
|
||||
#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,string,string,string,dateTime:RFC3339,long
|
||||
#group,false,false,false,false,true,true,true,false,false
|
||||
#default,_result,,,,,,,,
|
||||
,result,table,_start,_stop,_measurement,_field,t0,_time,_value
|
||||
,,2,2018-12-19T22:13:30Z,2018-12-19T22:14:20Z,thmWJ,iUcIq,server01,2018-12-19T22:13:30Z,-44
|
||||
,,2,2018-12-19T22:13:30Z,2018-12-19T22:14:20Z,thmWJ,iUcIq,server01,2018-12-19T22:13:40Z,-25
|
||||
,,2,2018-12-19T22:13:30Z,2018-12-19T22:14:20Z,thmWJ,iUcIq,server01,2018-12-19T22:13:50Z,46
|
||||
,,2,2018-12-19T22:13:30Z,2018-12-19T22:14:20Z,thmWJ,iUcIq,server01,2018-12-19T22:14:00Z,-2
|
||||
,,2,2018-12-19T22:13:30Z,2018-12-19T22:14:20Z,thmWJ,iUcIq,server01,2018-12-19T22:14:10Z,-14
|
||||
,,2,2018-12-19T22:13:30Z,2018-12-19T22:14:20Z,thmWJ,iUcIq,server01,2018-12-19T22:14:20Z,-53
|
||||
,,2,2018-12-19T22:13:30Z,2018-12-19T22:14:20Z,thmWJ,iUcIq,server01,2018-12-19T22:13:30Z,17
|
||||
,,2,2018-12-19T22:13:30Z,2018-12-19T22:14:20Z,thmWJ,iUcIq,server01,2018-12-19T22:13:40Z,-44
|
||||
,,2,2018-12-19T22:13:30Z,2018-12-19T22:14:20Z,thmWJ,iUcIq,server01,2018-12-19T22:13:50Z,-99
|
||||
,,2,2018-12-19T22:13:30Z,2018-12-19T22:14:20Z,thmWJ,iUcIq,server01,2018-12-19T22:14:00Z,-85
|
||||
,,2,2018-12-19T22:13:30Z,2018-12-19T22:14:20Z,thmWJ,iUcIq,server01,2018-12-19T22:14:10Z,18
|
||||
,,2,2018-12-19T22:13:30Z,2018-12-19T22:14:20Z,thmWJ,iUcIq,server01,2018-12-19T22:14:20Z,99
|
||||
|
||||
#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,string,string,string,dateTime:RFC3339,string
|
||||
#group,false,false,false,false,true,true,true,false,false
|
||||
#default,_result,,,,,,,,
|
||||
,result,table,_start,_stop,_measurement,_field,t0,_time,_value
|
||||
,,3,2018-12-19T22:13:30Z,2018-12-19T22:14:20Z,thmWJ,urO72,server01,2018-12-19T22:13:30Z,xRbS
|
||||
,,3,2018-12-19T22:13:30Z,2018-12-19T22:14:20Z,thmWJ,urO72,server01,2018-12-19T22:13:40Z,PtTh
|
||||
,,3,2018-12-19T22:13:30Z,2018-12-19T22:14:20Z,thmWJ,urO72,server01,2018-12-19T22:13:50Z,ZjN2je
|
||||
,,3,2018-12-19T22:13:30Z,2018-12-19T22:14:20Z,thmWJ,urO72,server01,2018-12-19T22:14:00Z,YZNBh
|
||||
,,3,2018-12-19T22:13:30Z,2018-12-19T22:14:20Z,thmWJ,urO72,server01,2018-12-19T22:14:10Z,pu08
|
||||
,,3,2018-12-19T22:13:30Z,2018-12-19T22:14:20Z,thmWJ,urO72,server01,2018-12-19T22:14:20Z,ixlOdT
|
||||
,,3,2018-12-19T22:13:30Z,2018-12-19T22:14:20Z,thmWJ,urO72,server01,2018-12-19T22:13:30Z,YqV
|
||||
,,3,2018-12-19T22:13:30Z,2018-12-19T22:14:20Z,thmWJ,urO72,server01,2018-12-19T22:13:40Z,GjbWF
|
||||
,,3,2018-12-19T22:13:30Z,2018-12-19T22:14:20Z,thmWJ,urO72,server01,2018-12-19T22:13:50Z,GiX1Bb
|
||||
,,3,2018-12-19T22:13:30Z,2018-12-19T22:14:20Z,thmWJ,urO72,server01,2018-12-19T22:14:00Z,DQCZXZ
|
||||
,,3,2018-12-19T22:13:30Z,2018-12-19T22:14:20Z,thmWJ,urO72,server01,2018-12-19T22:14:10Z,atopRR2
|
||||
,,3,2018-12-19T22:13:30Z,2018-12-19T22:14:20Z,thmWJ,urO72,server01,2018-12-19T22:14:20Z,TNKKB
|
||||
|
||||
#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,string,string,string,dateTime:RFC3339,unsignedLong
|
||||
#group,false,false,false,false,true,true,true,false,false
|
||||
#default,_result,,,,,,,,
|
||||
,result,table,_start,_stop,_measurement,_field,t0,_time,_value
|
||||
,,4,2018-12-19T22:13:30Z,2018-12-19T22:14:20Z,thmWJ,zmk1YWi,server01,2018-12-19T22:13:30Z,84
|
||||
,,4,2018-12-19T22:13:30Z,2018-12-19T22:14:20Z,thmWJ,zmk1YWi,server01,2018-12-19T22:13:40Z,52
|
||||
,,4,2018-12-19T22:13:30Z,2018-12-19T22:14:20Z,thmWJ,zmk1YWi,server01,2018-12-19T22:13:50Z,23
|
||||
,,4,2018-12-19T22:13:30Z,2018-12-19T22:14:20Z,thmWJ,zmk1YWi,server01,2018-12-19T22:14:00Z,62
|
||||
,,4,2018-12-19T22:13:30Z,2018-12-19T22:14:20Z,thmWJ,zmk1YWi,server01,2018-12-19T22:14:10Z,22
|
||||
,,4,2018-12-19T22:13:30Z,2018-12-19T22:14:20Z,thmWJ,zmk1YWi,server01,2018-12-19T22:14:20Z,78
|
||||
,,4,2018-12-19T22:13:30Z,2018-12-19T22:14:20Z,thmWJ,zmk1YWi,server01,2018-12-19T22:13:30Z,79
|
||||
,,4,2018-12-19T22:13:30Z,2018-12-19T22:14:20Z,thmWJ,zmk1YWi,server01,2018-12-19T22:13:40Z,33
|
||||
,,4,2018-12-19T22:13:30Z,2018-12-19T22:14:20Z,thmWJ,zmk1YWi,server01,2018-12-19T22:13:50Z,97
|
||||
,,4,2018-12-19T22:13:30Z,2018-12-19T22:14:20Z,thmWJ,zmk1YWi,server01,2018-12-19T22:14:00Z,90
|
||||
,,4,2018-12-19T22:13:30Z,2018-12-19T22:14:20Z,thmWJ,zmk1YWi,server01,2018-12-19T22:14:10Z,96
|
||||
,,4,2018-12-19T22:13:30Z,2018-12-19T22:14:20Z,thmWJ,zmk1YWi,server01,2018-12-19T22:14:20Z,10
|
||||
"
|
||||
|
||||
option now = () => 2018-12-19T22:15:00Z
|
||||
|
||||
t_set = (table=<-) => table
|
||||
|> range(start: -5m)
|
||||
|> set(key: "t0", value: "server01")
|
||||
|
||||
testingTest(name: "set",
|
||||
input: testLoadStorage(csv: inData),
|
||||
want: testLoadMem(csv: outData),
|
||||
test: t_set)
|
|
@ -0,0 +1,183 @@
|
|||
inData = "
|
||||
#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,string,string,string,dateTime:RFC3339,boolean
|
||||
#group,false,false,false,false,true,true,true,false,false
|
||||
#default,,,,,,,,,
|
||||
,result,table,_start,_stop,_measurement,_field,t0,_time,_value
|
||||
,,0,2018-12-19T22:13:30Z,2018-12-19T22:14:20Z,thmWJ,GK1Ji,SbkiNS9,2018-12-19T22:13:30Z,false
|
||||
,,0,2018-12-19T22:13:30Z,2018-12-19T22:14:20Z,thmWJ,GK1Ji,SbkiNS9,2018-12-19T22:13:40Z,true
|
||||
,,0,2018-12-19T22:13:30Z,2018-12-19T22:14:20Z,thmWJ,GK1Ji,SbkiNS9,2018-12-19T22:13:50Z,false
|
||||
,,0,2018-12-19T22:13:30Z,2018-12-19T22:14:20Z,thmWJ,GK1Ji,SbkiNS9,2018-12-19T22:14:00Z,false
|
||||
,,0,2018-12-19T22:13:30Z,2018-12-19T22:14:20Z,thmWJ,GK1Ji,SbkiNS9,2018-12-19T22:14:10Z,true
|
||||
,,0,2018-12-19T22:13:30Z,2018-12-19T22:14:20Z,thmWJ,GK1Ji,SbkiNS9,2018-12-19T22:14:20Z,true
|
||||
,,1,2018-12-19T22:13:30Z,2018-12-19T22:14:20Z,thmWJ,GK1Ji,gpmhNEw,2018-12-19T22:13:30Z,false
|
||||
,,1,2018-12-19T22:13:30Z,2018-12-19T22:14:20Z,thmWJ,GK1Ji,gpmhNEw,2018-12-19T22:13:40Z,true
|
||||
,,1,2018-12-19T22:13:30Z,2018-12-19T22:14:20Z,thmWJ,GK1Ji,gpmhNEw,2018-12-19T22:13:50Z,false
|
||||
,,1,2018-12-19T22:13:30Z,2018-12-19T22:14:20Z,thmWJ,GK1Ji,gpmhNEw,2018-12-19T22:14:00Z,true
|
||||
,,1,2018-12-19T22:13:30Z,2018-12-19T22:14:20Z,thmWJ,GK1Ji,gpmhNEw,2018-12-19T22:14:10Z,true
|
||||
,,1,2018-12-19T22:13:30Z,2018-12-19T22:14:20Z,thmWJ,GK1Ji,gpmhNEw,2018-12-19T22:14:20Z,true
|
||||
|
||||
#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,string,string,string,dateTime:RFC3339,double
|
||||
#group,false,false,false,false,true,true,true,false,false
|
||||
#default,,,,,,,,,
|
||||
,result,table,_start,_stop,_measurement,_field,t0,_time,_value
|
||||
,,2,2018-12-19T22:13:30Z,2018-12-19T22:14:20Z,thmWJ,c9wjx7r,SbkiNS9,2018-12-19T22:13:30Z,-61.68790887989735
|
||||
,,2,2018-12-19T22:13:30Z,2018-12-19T22:14:20Z,thmWJ,c9wjx7r,SbkiNS9,2018-12-19T22:13:40Z,-6.3173755351186465
|
||||
,,2,2018-12-19T22:13:30Z,2018-12-19T22:14:20Z,thmWJ,c9wjx7r,SbkiNS9,2018-12-19T22:13:50Z,-26.049728557657513
|
||||
,,2,2018-12-19T22:13:30Z,2018-12-19T22:14:20Z,thmWJ,c9wjx7r,SbkiNS9,2018-12-19T22:14:00Z,114.285955884979
|
||||
,,2,2018-12-19T22:13:30Z,2018-12-19T22:14:20Z,thmWJ,c9wjx7r,SbkiNS9,2018-12-19T22:14:10Z,16.140262630578995
|
||||
,,2,2018-12-19T22:13:30Z,2018-12-19T22:14:20Z,thmWJ,c9wjx7r,SbkiNS9,2018-12-19T22:14:20Z,29.50336437998469
|
||||
,,3,2018-12-19T22:13:30Z,2018-12-19T22:14:20Z,thmWJ,c9wjx7r,gpmhNEw,2018-12-19T22:13:30Z,7.940387008821781
|
||||
,,3,2018-12-19T22:13:30Z,2018-12-19T22:14:20Z,thmWJ,c9wjx7r,gpmhNEw,2018-12-19T22:13:40Z,49.460104214779086
|
||||
,,3,2018-12-19T22:13:30Z,2018-12-19T22:14:20Z,thmWJ,c9wjx7r,gpmhNEw,2018-12-19T22:13:50Z,-36.564150808873954
|
||||
,,3,2018-12-19T22:13:30Z,2018-12-19T22:14:20Z,thmWJ,c9wjx7r,gpmhNEw,2018-12-19T22:14:00Z,34.319039251798635
|
||||
,,3,2018-12-19T22:13:30Z,2018-12-19T22:14:20Z,thmWJ,c9wjx7r,gpmhNEw,2018-12-19T22:14:10Z,79.27019811403116
|
||||
,,3,2018-12-19T22:13:30Z,2018-12-19T22:14:20Z,thmWJ,c9wjx7r,gpmhNEw,2018-12-19T22:14:20Z,41.91029522104053
|
||||
|
||||
#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,string,string,string,dateTime:RFC3339,long
|
||||
#group,false,false,false,false,true,true,true,false,false
|
||||
#default,,,,,,,,,
|
||||
,result,table,_start,_stop,_measurement,_field,t0,_time,_value
|
||||
,,4,2018-12-19T22:13:30Z,2018-12-19T22:14:20Z,thmWJ,iUcIq,SbkiNS9,2018-12-19T22:13:30Z,-44
|
||||
,,4,2018-12-19T22:13:30Z,2018-12-19T22:14:20Z,thmWJ,iUcIq,SbkiNS9,2018-12-19T22:13:40Z,-25
|
||||
,,4,2018-12-19T22:13:30Z,2018-12-19T22:14:20Z,thmWJ,iUcIq,SbkiNS9,2018-12-19T22:13:50Z,46
|
||||
,,4,2018-12-19T22:13:30Z,2018-12-19T22:14:20Z,thmWJ,iUcIq,SbkiNS9,2018-12-19T22:14:00Z,-2
|
||||
,,4,2018-12-19T22:13:30Z,2018-12-19T22:14:20Z,thmWJ,iUcIq,SbkiNS9,2018-12-19T22:14:10Z,-14
|
||||
,,4,2018-12-19T22:13:30Z,2018-12-19T22:14:20Z,thmWJ,iUcIq,SbkiNS9,2018-12-19T22:14:20Z,-53
|
||||
,,5,2018-12-19T22:13:30Z,2018-12-19T22:14:20Z,thmWJ,iUcIq,gpmhNEw,2018-12-19T22:13:30Z,17
|
||||
,,5,2018-12-19T22:13:30Z,2018-12-19T22:14:20Z,thmWJ,iUcIq,gpmhNEw,2018-12-19T22:13:40Z,-44
|
||||
,,5,2018-12-19T22:13:30Z,2018-12-19T22:14:20Z,thmWJ,iUcIq,gpmhNEw,2018-12-19T22:13:50Z,-99
|
||||
,,5,2018-12-19T22:13:30Z,2018-12-19T22:14:20Z,thmWJ,iUcIq,gpmhNEw,2018-12-19T22:14:00Z,-85
|
||||
,,5,2018-12-19T22:13:30Z,2018-12-19T22:14:20Z,thmWJ,iUcIq,gpmhNEw,2018-12-19T22:14:10Z,18
|
||||
,,5,2018-12-19T22:13:30Z,2018-12-19T22:14:20Z,thmWJ,iUcIq,gpmhNEw,2018-12-19T22:14:20Z,99
|
||||
|
||||
#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,string,string,string,dateTime:RFC3339,string
|
||||
#group,false,false,false,false,true,true,true,false,false
|
||||
#default,,,,,,,,,
|
||||
,result,table,_start,_stop,_measurement,_field,t0,_time,_value
|
||||
,,6,2018-12-19T22:13:30Z,2018-12-19T22:14:20Z,thmWJ,urO72,SbkiNS9,2018-12-19T22:13:30Z,xRbS
|
||||
,,6,2018-12-19T22:13:30Z,2018-12-19T22:14:20Z,thmWJ,urO72,SbkiNS9,2018-12-19T22:13:40Z,PtTh
|
||||
,,6,2018-12-19T22:13:30Z,2018-12-19T22:14:20Z,thmWJ,urO72,SbkiNS9,2018-12-19T22:13:50Z,ZjN2je
|
||||
,,6,2018-12-19T22:13:30Z,2018-12-19T22:14:20Z,thmWJ,urO72,SbkiNS9,2018-12-19T22:14:00Z,YZNBh
|
||||
,,6,2018-12-19T22:13:30Z,2018-12-19T22:14:20Z,thmWJ,urO72,SbkiNS9,2018-12-19T22:14:10Z,pu08
|
||||
,,6,2018-12-19T22:13:30Z,2018-12-19T22:14:20Z,thmWJ,urO72,SbkiNS9,2018-12-19T22:14:20Z,ixlOdT
|
||||
,,7,2018-12-19T22:13:30Z,2018-12-19T22:14:20Z,thmWJ,urO72,gpmhNEw,2018-12-19T22:13:30Z,YqV
|
||||
,,7,2018-12-19T22:13:30Z,2018-12-19T22:14:20Z,thmWJ,urO72,gpmhNEw,2018-12-19T22:13:40Z,GjbWF
|
||||
,,7,2018-12-19T22:13:30Z,2018-12-19T22:14:20Z,thmWJ,urO72,gpmhNEw,2018-12-19T22:13:50Z,GiX1Bb
|
||||
,,7,2018-12-19T22:13:30Z,2018-12-19T22:14:20Z,thmWJ,urO72,gpmhNEw,2018-12-19T22:14:00Z,DQCZXZ
|
||||
,,7,2018-12-19T22:13:30Z,2018-12-19T22:14:20Z,thmWJ,urO72,gpmhNEw,2018-12-19T22:14:10Z,atopRR2
|
||||
,,7,2018-12-19T22:13:30Z,2018-12-19T22:14:20Z,thmWJ,urO72,gpmhNEw,2018-12-19T22:14:20Z,TNKKB
|
||||
|
||||
#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,string,string,string,dateTime:RFC3339,unsignedLong
|
||||
#group,false,false,false,false,true,true,true,false,false
|
||||
#default,,,,,,,,,
|
||||
,result,table,_start,_stop,_measurement,_field,t0,_time,_value
|
||||
,,8,2018-12-19T22:13:30Z,2018-12-19T22:14:20Z,thmWJ,zmk1YWi,SbkiNS9,2018-12-19T22:13:30Z,84
|
||||
,,8,2018-12-19T22:13:30Z,2018-12-19T22:14:20Z,thmWJ,zmk1YWi,SbkiNS9,2018-12-19T22:13:40Z,52
|
||||
,,8,2018-12-19T22:13:30Z,2018-12-19T22:14:20Z,thmWJ,zmk1YWi,SbkiNS9,2018-12-19T22:13:50Z,23
|
||||
,,8,2018-12-19T22:13:30Z,2018-12-19T22:14:20Z,thmWJ,zmk1YWi,SbkiNS9,2018-12-19T22:14:00Z,62
|
||||
,,8,2018-12-19T22:13:30Z,2018-12-19T22:14:20Z,thmWJ,zmk1YWi,SbkiNS9,2018-12-19T22:14:10Z,22
|
||||
,,8,2018-12-19T22:13:30Z,2018-12-19T22:14:20Z,thmWJ,zmk1YWi,SbkiNS9,2018-12-19T22:14:20Z,78
|
||||
,,9,2018-12-19T22:13:30Z,2018-12-19T22:14:20Z,thmWJ,zmk1YWi,gpmhNEw,2018-12-19T22:13:30Z,79
|
||||
,,9,2018-12-19T22:13:30Z,2018-12-19T22:14:20Z,thmWJ,zmk1YWi,gpmhNEw,2018-12-19T22:13:40Z,33
|
||||
,,9,2018-12-19T22:13:30Z,2018-12-19T22:14:20Z,thmWJ,zmk1YWi,gpmhNEw,2018-12-19T22:13:50Z,97
|
||||
,,9,2018-12-19T22:13:30Z,2018-12-19T22:14:20Z,thmWJ,zmk1YWi,gpmhNEw,2018-12-19T22:14:00Z,90
|
||||
,,9,2018-12-19T22:13:30Z,2018-12-19T22:14:20Z,thmWJ,zmk1YWi,gpmhNEw,2018-12-19T22:14:10Z,96
|
||||
,,9,2018-12-19T22:13:30Z,2018-12-19T22:14:20Z,thmWJ,zmk1YWi,gpmhNEw,2018-12-19T22:14:20Z,10
|
||||
"
|
||||
outData = "
|
||||
#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,string,string,string,dateTime:RFC3339,boolean,string
|
||||
#group,false,false,false,false,true,true,true,false,false,false
|
||||
#default,_result,,,,,,,,,
|
||||
,result,table,_start,_stop,_measurement,_field,t0,_time,_value,t1
|
||||
,,0,2018-12-19T22:13:30Z,2018-12-19T22:14:20Z,thmWJ,GK1Ji,SbkiNS9,2018-12-19T22:13:30Z,false,server01
|
||||
,,0,2018-12-19T22:13:30Z,2018-12-19T22:14:20Z,thmWJ,GK1Ji,SbkiNS9,2018-12-19T22:13:40Z,true,server01
|
||||
,,0,2018-12-19T22:13:30Z,2018-12-19T22:14:20Z,thmWJ,GK1Ji,SbkiNS9,2018-12-19T22:13:50Z,false,server01
|
||||
,,0,2018-12-19T22:13:30Z,2018-12-19T22:14:20Z,thmWJ,GK1Ji,SbkiNS9,2018-12-19T22:14:00Z,false,server01
|
||||
,,0,2018-12-19T22:13:30Z,2018-12-19T22:14:20Z,thmWJ,GK1Ji,SbkiNS9,2018-12-19T22:14:10Z,true,server01
|
||||
,,0,2018-12-19T22:13:30Z,2018-12-19T22:14:20Z,thmWJ,GK1Ji,SbkiNS9,2018-12-19T22:14:20Z,true,server01
|
||||
,,1,2018-12-19T22:13:30Z,2018-12-19T22:14:20Z,thmWJ,GK1Ji,gpmhNEw,2018-12-19T22:13:30Z,false,server01
|
||||
,,1,2018-12-19T22:13:30Z,2018-12-19T22:14:20Z,thmWJ,GK1Ji,gpmhNEw,2018-12-19T22:13:40Z,true,server01
|
||||
,,1,2018-12-19T22:13:30Z,2018-12-19T22:14:20Z,thmWJ,GK1Ji,gpmhNEw,2018-12-19T22:13:50Z,false,server01
|
||||
,,1,2018-12-19T22:13:30Z,2018-12-19T22:14:20Z,thmWJ,GK1Ji,gpmhNEw,2018-12-19T22:14:00Z,true,server01
|
||||
,,1,2018-12-19T22:13:30Z,2018-12-19T22:14:20Z,thmWJ,GK1Ji,gpmhNEw,2018-12-19T22:14:10Z,true,server01
|
||||
,,1,2018-12-19T22:13:30Z,2018-12-19T22:14:20Z,thmWJ,GK1Ji,gpmhNEw,2018-12-19T22:14:20Z,true,server01
|
||||
|
||||
#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,string,string,string,dateTime:RFC3339,double,string
|
||||
#group,false,false,false,false,true,true,true,false,false,false
|
||||
#default,_result,,,,,,,,,
|
||||
,result,table,_start,_stop,_measurement,_field,t0,_time,_value,t1
|
||||
,,2,2018-12-19T22:13:30Z,2018-12-19T22:14:20Z,thmWJ,c9wjx7r,SbkiNS9,2018-12-19T22:13:30Z,-61.68790887989735,server01
|
||||
,,2,2018-12-19T22:13:30Z,2018-12-19T22:14:20Z,thmWJ,c9wjx7r,SbkiNS9,2018-12-19T22:13:40Z,-6.3173755351186465,server01
|
||||
,,2,2018-12-19T22:13:30Z,2018-12-19T22:14:20Z,thmWJ,c9wjx7r,SbkiNS9,2018-12-19T22:13:50Z,-26.049728557657513,server01
|
||||
,,2,2018-12-19T22:13:30Z,2018-12-19T22:14:20Z,thmWJ,c9wjx7r,SbkiNS9,2018-12-19T22:14:00Z,114.285955884979,server01
|
||||
,,2,2018-12-19T22:13:30Z,2018-12-19T22:14:20Z,thmWJ,c9wjx7r,SbkiNS9,2018-12-19T22:14:10Z,16.140262630578995,server01
|
||||
,,2,2018-12-19T22:13:30Z,2018-12-19T22:14:20Z,thmWJ,c9wjx7r,SbkiNS9,2018-12-19T22:14:20Z,29.50336437998469,server01
|
||||
,,3,2018-12-19T22:13:30Z,2018-12-19T22:14:20Z,thmWJ,c9wjx7r,gpmhNEw,2018-12-19T22:13:30Z,7.940387008821781,server01
|
||||
,,3,2018-12-19T22:13:30Z,2018-12-19T22:14:20Z,thmWJ,c9wjx7r,gpmhNEw,2018-12-19T22:13:40Z,49.460104214779086,server01
|
||||
,,3,2018-12-19T22:13:30Z,2018-12-19T22:14:20Z,thmWJ,c9wjx7r,gpmhNEw,2018-12-19T22:13:50Z,-36.564150808873954,server01
|
||||
,,3,2018-12-19T22:13:30Z,2018-12-19T22:14:20Z,thmWJ,c9wjx7r,gpmhNEw,2018-12-19T22:14:00Z,34.319039251798635,server01
|
||||
,,3,2018-12-19T22:13:30Z,2018-12-19T22:14:20Z,thmWJ,c9wjx7r,gpmhNEw,2018-12-19T22:14:10Z,79.27019811403116,server01
|
||||
,,3,2018-12-19T22:13:30Z,2018-12-19T22:14:20Z,thmWJ,c9wjx7r,gpmhNEw,2018-12-19T22:14:20Z,41.91029522104053,server01
|
||||
|
||||
#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,string,string,string,dateTime:RFC3339,long,string
|
||||
#group,false,false,false,false,true,true,true,false,false,false
|
||||
#default,_result,,,,,,,,,
|
||||
,result,table,_start,_stop,_measurement,_field,t0,_time,_value,t1
|
||||
,,4,2018-12-19T22:13:30Z,2018-12-19T22:14:20Z,thmWJ,iUcIq,SbkiNS9,2018-12-19T22:13:30Z,-44,server01
|
||||
,,4,2018-12-19T22:13:30Z,2018-12-19T22:14:20Z,thmWJ,iUcIq,SbkiNS9,2018-12-19T22:13:40Z,-25,server01
|
||||
,,4,2018-12-19T22:13:30Z,2018-12-19T22:14:20Z,thmWJ,iUcIq,SbkiNS9,2018-12-19T22:13:50Z,46,server01
|
||||
,,4,2018-12-19T22:13:30Z,2018-12-19T22:14:20Z,thmWJ,iUcIq,SbkiNS9,2018-12-19T22:14:00Z,-2,server01
|
||||
,,4,2018-12-19T22:13:30Z,2018-12-19T22:14:20Z,thmWJ,iUcIq,SbkiNS9,2018-12-19T22:14:10Z,-14,server01
|
||||
,,4,2018-12-19T22:13:30Z,2018-12-19T22:14:20Z,thmWJ,iUcIq,SbkiNS9,2018-12-19T22:14:20Z,-53,server01
|
||||
,,5,2018-12-19T22:13:30Z,2018-12-19T22:14:20Z,thmWJ,iUcIq,gpmhNEw,2018-12-19T22:13:30Z,17,server01
|
||||
,,5,2018-12-19T22:13:30Z,2018-12-19T22:14:20Z,thmWJ,iUcIq,gpmhNEw,2018-12-19T22:13:40Z,-44,server01
|
||||
,,5,2018-12-19T22:13:30Z,2018-12-19T22:14:20Z,thmWJ,iUcIq,gpmhNEw,2018-12-19T22:13:50Z,-99,server01
|
||||
,,5,2018-12-19T22:13:30Z,2018-12-19T22:14:20Z,thmWJ,iUcIq,gpmhNEw,2018-12-19T22:14:00Z,-85,server01
|
||||
,,5,2018-12-19T22:13:30Z,2018-12-19T22:14:20Z,thmWJ,iUcIq,gpmhNEw,2018-12-19T22:14:10Z,18,server01
|
||||
,,5,2018-12-19T22:13:30Z,2018-12-19T22:14:20Z,thmWJ,iUcIq,gpmhNEw,2018-12-19T22:14:20Z,99,server01
|
||||
|
||||
#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,string,string,string,dateTime:RFC3339,string,string
|
||||
#group,false,false,false,false,true,true,true,false,false,false
|
||||
#default,_result,,,,,,,,,
|
||||
,result,table,_start,_stop,_measurement,_field,t0,_time,_value,t1
|
||||
,,6,2018-12-19T22:13:30Z,2018-12-19T22:14:20Z,thmWJ,urO72,SbkiNS9,2018-12-19T22:13:30Z,xRbS,server01
|
||||
,,6,2018-12-19T22:13:30Z,2018-12-19T22:14:20Z,thmWJ,urO72,SbkiNS9,2018-12-19T22:13:40Z,PtTh,server01
|
||||
,,6,2018-12-19T22:13:30Z,2018-12-19T22:14:20Z,thmWJ,urO72,SbkiNS9,2018-12-19T22:13:50Z,ZjN2je,server01
|
||||
,,6,2018-12-19T22:13:30Z,2018-12-19T22:14:20Z,thmWJ,urO72,SbkiNS9,2018-12-19T22:14:00Z,YZNBh,server01
|
||||
,,6,2018-12-19T22:13:30Z,2018-12-19T22:14:20Z,thmWJ,urO72,SbkiNS9,2018-12-19T22:14:10Z,pu08,server01
|
||||
,,6,2018-12-19T22:13:30Z,2018-12-19T22:14:20Z,thmWJ,urO72,SbkiNS9,2018-12-19T22:14:20Z,ixlOdT,server01
|
||||
,,7,2018-12-19T22:13:30Z,2018-12-19T22:14:20Z,thmWJ,urO72,gpmhNEw,2018-12-19T22:13:30Z,YqV,server01
|
||||
,,7,2018-12-19T22:13:30Z,2018-12-19T22:14:20Z,thmWJ,urO72,gpmhNEw,2018-12-19T22:13:40Z,GjbWF,server01
|
||||
,,7,2018-12-19T22:13:30Z,2018-12-19T22:14:20Z,thmWJ,urO72,gpmhNEw,2018-12-19T22:13:50Z,GiX1Bb,server01
|
||||
,,7,2018-12-19T22:13:30Z,2018-12-19T22:14:20Z,thmWJ,urO72,gpmhNEw,2018-12-19T22:14:00Z,DQCZXZ,server01
|
||||
,,7,2018-12-19T22:13:30Z,2018-12-19T22:14:20Z,thmWJ,urO72,gpmhNEw,2018-12-19T22:14:10Z,atopRR2,server01
|
||||
,,7,2018-12-19T22:13:30Z,2018-12-19T22:14:20Z,thmWJ,urO72,gpmhNEw,2018-12-19T22:14:20Z,TNKKB,server01
|
||||
|
||||
#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,string,string,string,dateTime:RFC3339,unsignedLong,string
|
||||
#group,false,false,false,false,true,true,true,false,false,false
|
||||
#default,_result,,,,,,,,,
|
||||
,result,table,_start,_stop,_measurement,_field,t0,_time,_value,t1
|
||||
,,8,2018-12-19T22:13:30Z,2018-12-19T22:14:20Z,thmWJ,zmk1YWi,SbkiNS9,2018-12-19T22:13:30Z,84,server01
|
||||
,,8,2018-12-19T22:13:30Z,2018-12-19T22:14:20Z,thmWJ,zmk1YWi,SbkiNS9,2018-12-19T22:13:40Z,52,server01
|
||||
,,8,2018-12-19T22:13:30Z,2018-12-19T22:14:20Z,thmWJ,zmk1YWi,SbkiNS9,2018-12-19T22:13:50Z,23,server01
|
||||
,,8,2018-12-19T22:13:30Z,2018-12-19T22:14:20Z,thmWJ,zmk1YWi,SbkiNS9,2018-12-19T22:14:00Z,62,server01
|
||||
,,8,2018-12-19T22:13:30Z,2018-12-19T22:14:20Z,thmWJ,zmk1YWi,SbkiNS9,2018-12-19T22:14:10Z,22,server01
|
||||
,,8,2018-12-19T22:13:30Z,2018-12-19T22:14:20Z,thmWJ,zmk1YWi,SbkiNS9,2018-12-19T22:14:20Z,78,server01
|
||||
,,9,2018-12-19T22:13:30Z,2018-12-19T22:14:20Z,thmWJ,zmk1YWi,gpmhNEw,2018-12-19T22:13:30Z,79,server01
|
||||
,,9,2018-12-19T22:13:30Z,2018-12-19T22:14:20Z,thmWJ,zmk1YWi,gpmhNEw,2018-12-19T22:13:40Z,33,server01
|
||||
,,9,2018-12-19T22:13:30Z,2018-12-19T22:14:20Z,thmWJ,zmk1YWi,gpmhNEw,2018-12-19T22:13:50Z,97,server01
|
||||
,,9,2018-12-19T22:13:30Z,2018-12-19T22:14:20Z,thmWJ,zmk1YWi,gpmhNEw,2018-12-19T22:14:00Z,90,server01
|
||||
,,9,2018-12-19T22:13:30Z,2018-12-19T22:14:20Z,thmWJ,zmk1YWi,gpmhNEw,2018-12-19T22:14:10Z,96,server01
|
||||
,,9,2018-12-19T22:13:30Z,2018-12-19T22:14:20Z,thmWJ,zmk1YWi,gpmhNEw,2018-12-19T22:14:20Z,10,server01
|
||||
"
|
||||
|
||||
option now = () => 2018-12-19T22:15:00Z
|
||||
|
||||
t_set_new_column = (table=<-) => table
|
||||
|> range(start: -5m)
|
||||
|> set(key: "t1", value: "server01")
|
||||
|
||||
testingTest(name: "set_new_column",
|
||||
input: testLoadStorage(csv: inData),
|
||||
want: testLoadMem(csv: outData),
|
||||
test: t_set_new_column)
|
|
@ -0,0 +1,64 @@
|
|||
inData = "
|
||||
#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,dateTime:RFC3339,string,string,long
|
||||
#group,false,false,true,true,false,true,true,false
|
||||
#default,,,,,,,,
|
||||
,result,table,_start,_stop,_time,_measurement,_field,_value
|
||||
,,0,2018-05-22T19:53:00Z,2018-05-22T19:54:50Z,2018-05-22T19:53:30Z,_m,FF,10
|
||||
,,0,2018-05-22T19:53:00Z,2018-05-22T19:54:50Z,2018-05-22T19:53:40Z,_m,FF,16
|
||||
,,0,2018-05-22T19:53:00Z,2018-05-22T19:54:50Z,2018-05-22T19:53:50Z,_m,FF,93
|
||||
,,0,2018-05-22T19:53:00Z,2018-05-22T19:54:50Z,2018-05-22T19:53:00Z,_m,FF,56
|
||||
,,0,2018-05-22T19:53:00Z,2018-05-22T19:54:50Z,2018-05-22T19:53:10Z,_m,FF,11
|
||||
,,0,2018-05-22T19:53:00Z,2018-05-22T19:54:50Z,2018-05-22T19:53:20Z,_m,FF,29
|
||||
,,1,2018-05-22T19:53:00Z,2018-05-22T19:54:50Z,2018-05-22T19:53:30Z,_m,QQ,26
|
||||
,,1,2018-05-22T19:53:00Z,2018-05-22T19:54:50Z,2018-05-22T19:53:40Z,_m,QQ,88
|
||||
,,1,2018-05-22T19:53:00Z,2018-05-22T19:54:50Z,2018-05-22T19:53:50Z,_m,QQ,47
|
||||
,,1,2018-05-22T19:53:00Z,2018-05-22T19:54:50Z,2018-05-22T19:54:00Z,_m,QQ,78
|
||||
,,1,2018-05-22T19:53:00Z,2018-05-22T19:54:50Z,2018-05-22T19:54:10Z,_m,QQ,51
|
||||
,,1,2018-05-22T19:53:00Z,2018-05-22T19:54:50Z,2018-05-22T19:54:30Z,_m,QQ,22
|
||||
,,1,2018-05-22T19:53:00Z,2018-05-22T19:54:50Z,2018-05-22T19:54:40Z,_m,QQ,19
|
||||
,,1,2018-05-22T19:53:00Z,2018-05-22T19:54:50Z,2018-05-22T19:53:50Z,_m,QQ,69
|
||||
,,1,2018-05-22T19:53:00Z,2018-05-22T19:54:50Z,2018-05-22T19:54:00Z,_m,QQ,63
|
||||
,,2,2018-05-22T19:53:00Z,2018-05-22T19:54:50Z,2018-05-22T19:53:10Z,_m,RR,62
|
||||
,,2,2018-05-22T19:53:00Z,2018-05-22T19:54:50Z,2018-05-22T19:53:30Z,_m,RR,18
|
||||
,,2,2018-05-22T19:53:00Z,2018-05-22T19:54:50Z,2018-05-22T19:54:40Z,_m,RR,19
|
||||
,,2,2018-05-22T19:53:00Z,2018-05-22T19:54:50Z,2018-05-22T19:53:50Z,_m,RR,90
|
||||
,,3,2018-05-22T19:53:00Z,2018-05-22T19:54:50Z,2018-05-22T19:54:00Z,_m,SR,36
|
||||
,,3,2018-05-22T19:53:00Z,2018-05-22T19:54:50Z,2018-05-22T19:54:10Z,_m,SR,72
|
||||
,,3,2018-05-22T19:53:00Z,2018-05-22T19:54:50Z,2018-05-22T19:54:20Z,_m,SR,88
|
||||
"
|
||||
outData = "
|
||||
#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,dateTime:RFC3339,string,string,long
|
||||
#group,false,false,true,true,false,true,true,false
|
||||
#default,_result,,,,,,,
|
||||
,result,table,_start,_stop,_time,_measurement,_field,_value
|
||||
,,0,2018-05-22T19:55:00Z,2018-05-22T19:56:50Z,2018-05-22T19:55:30Z,_m,FF,10
|
||||
,,0,2018-05-22T19:55:00Z,2018-05-22T19:56:50Z,2018-05-22T19:55:40Z,_m,FF,16
|
||||
,,0,2018-05-22T19:55:00Z,2018-05-22T19:56:50Z,2018-05-22T19:55:50Z,_m,FF,93
|
||||
,,0,2018-05-22T19:55:00Z,2018-05-22T19:56:50Z,2018-05-22T19:55:00Z,_m,FF,56
|
||||
,,0,2018-05-22T19:55:00Z,2018-05-22T19:56:50Z,2018-05-22T19:55:10Z,_m,FF,11
|
||||
,,0,2018-05-22T19:55:00Z,2018-05-22T19:56:50Z,2018-05-22T19:55:20Z,_m,FF,29
|
||||
,,1,2018-05-22T19:55:00Z,2018-05-22T19:56:50Z,2018-05-22T19:55:30Z,_m,QQ,26
|
||||
,,1,2018-05-22T19:55:00Z,2018-05-22T19:56:50Z,2018-05-22T19:55:40Z,_m,QQ,88
|
||||
,,1,2018-05-22T19:55:00Z,2018-05-22T19:56:50Z,2018-05-22T19:55:50Z,_m,QQ,47
|
||||
,,1,2018-05-22T19:55:00Z,2018-05-22T19:56:50Z,2018-05-22T19:56:00Z,_m,QQ,78
|
||||
,,1,2018-05-22T19:55:00Z,2018-05-22T19:56:50Z,2018-05-22T19:56:10Z,_m,QQ,51
|
||||
,,1,2018-05-22T19:55:00Z,2018-05-22T19:56:50Z,2018-05-22T19:56:30Z,_m,QQ,22
|
||||
,,1,2018-05-22T19:55:00Z,2018-05-22T19:56:50Z,2018-05-22T19:56:40Z,_m,QQ,19
|
||||
,,1,2018-05-22T19:55:00Z,2018-05-22T19:56:50Z,2018-05-22T19:55:50Z,_m,QQ,69
|
||||
,,1,2018-05-22T19:55:00Z,2018-05-22T19:56:50Z,2018-05-22T19:56:00Z,_m,QQ,63
|
||||
,,2,2018-05-22T19:55:00Z,2018-05-22T19:56:50Z,2018-05-22T19:55:10Z,_m,RR,62
|
||||
,,2,2018-05-22T19:55:00Z,2018-05-22T19:56:50Z,2018-05-22T19:55:30Z,_m,RR,18
|
||||
,,2,2018-05-22T19:55:00Z,2018-05-22T19:56:50Z,2018-05-22T19:56:40Z,_m,RR,19
|
||||
,,2,2018-05-22T19:55:00Z,2018-05-22T19:56:50Z,2018-05-22T19:55:50Z,_m,RR,90
|
||||
,,3,2018-05-22T19:55:00Z,2018-05-22T19:56:50Z,2018-05-22T19:56:00Z,_m,SR,36
|
||||
,,3,2018-05-22T19:55:00Z,2018-05-22T19:56:50Z,2018-05-22T19:56:10Z,_m,SR,72
|
||||
,,3,2018-05-22T19:55:00Z,2018-05-22T19:56:50Z,2018-05-22T19:56:20Z,_m,SR,88
|
||||
"
|
||||
|
||||
t_shift = (table=<-) => table
|
||||
|> shift(shift: 120s)
|
||||
|
||||
testingTest(name: "shift",
|
||||
input: testLoadStorage(csv: inData),
|
||||
want: testLoadMem(csv: outData),
|
||||
test: t_shift)
|
|
@ -0,0 +1,64 @@
|
|||
inData = "
|
||||
#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,dateTime:RFC3339,string,string,long
|
||||
#group,false,false,true,true,false,true,true,false
|
||||
#default,,,,,,,,
|
||||
,result,table,_start,_stop,_time,_measurement,_field,_value
|
||||
,,0,2018-05-22T19:53:00Z,2018-05-22T19:54:50Z,2018-05-22T19:53:30Z,_m,FF,10
|
||||
,,0,2018-05-22T19:53:00Z,2018-05-22T19:54:50Z,2018-05-22T19:53:40Z,_m,FF,16
|
||||
,,0,2018-05-22T19:53:00Z,2018-05-22T19:54:50Z,2018-05-22T19:53:50Z,_m,FF,93
|
||||
,,0,2018-05-22T19:53:00Z,2018-05-22T19:54:50Z,2018-05-22T19:53:00Z,_m,FF,56
|
||||
,,0,2018-05-22T19:53:00Z,2018-05-22T19:54:50Z,2018-05-22T19:53:10Z,_m,FF,11
|
||||
,,0,2018-05-22T19:53:00Z,2018-05-22T19:54:50Z,2018-05-22T19:53:20Z,_m,FF,29
|
||||
,,1,2018-05-22T19:53:00Z,2018-05-22T19:54:50Z,2018-05-22T19:53:30Z,_m,QQ,26
|
||||
,,1,2018-05-22T19:53:00Z,2018-05-22T19:54:50Z,2018-05-22T19:53:40Z,_m,QQ,88
|
||||
,,1,2018-05-22T19:53:00Z,2018-05-22T19:54:50Z,2018-05-22T19:53:50Z,_m,QQ,47
|
||||
,,1,2018-05-22T19:53:00Z,2018-05-22T19:54:50Z,2018-05-22T19:54:00Z,_m,QQ,78
|
||||
,,1,2018-05-22T19:53:00Z,2018-05-22T19:54:50Z,2018-05-22T19:54:10Z,_m,QQ,51
|
||||
,,1,2018-05-22T19:53:00Z,2018-05-22T19:54:50Z,2018-05-22T19:54:30Z,_m,QQ,22
|
||||
,,1,2018-05-22T19:53:00Z,2018-05-22T19:54:50Z,2018-05-22T19:54:40Z,_m,QQ,19
|
||||
,,1,2018-05-22T19:53:00Z,2018-05-22T19:54:50Z,2018-05-22T19:53:50Z,_m,QQ,69
|
||||
,,1,2018-05-22T19:53:00Z,2018-05-22T19:54:50Z,2018-05-22T19:54:00Z,_m,QQ,63
|
||||
,,2,2018-05-22T19:53:00Z,2018-05-22T19:54:50Z,2018-05-22T19:53:10Z,_m,RR,62
|
||||
,,2,2018-05-22T19:53:00Z,2018-05-22T19:54:50Z,2018-05-22T19:53:30Z,_m,RR,18
|
||||
,,2,2018-05-22T19:53:00Z,2018-05-22T19:54:50Z,2018-05-22T19:54:40Z,_m,RR,19
|
||||
,,2,2018-05-22T19:53:00Z,2018-05-22T19:54:50Z,2018-05-22T19:53:50Z,_m,RR,90
|
||||
,,3,2018-05-22T19:53:00Z,2018-05-22T19:54:50Z,2018-05-22T19:54:00Z,_m,SR,36
|
||||
,,3,2018-05-22T19:53:00Z,2018-05-22T19:54:50Z,2018-05-22T19:54:10Z,_m,SR,72
|
||||
,,3,2018-05-22T19:53:00Z,2018-05-22T19:54:50Z,2018-05-22T19:54:20Z,_m,SR,88
|
||||
"
|
||||
outData = "
|
||||
#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,dateTime:RFC3339,string,string,long
|
||||
#group,false,false,true,true,false,true,true,false
|
||||
#default,_result,,,,,,,
|
||||
,result,table,_start,_stop,_time,_measurement,_field,_value
|
||||
,,0,2018-05-22T19:48:00Z,2018-05-22T19:49:50Z,2018-05-22T19:48:30Z,_m,FF,10
|
||||
,,0,2018-05-22T19:48:00Z,2018-05-22T19:49:50Z,2018-05-22T19:48:40Z,_m,FF,16
|
||||
,,0,2018-05-22T19:48:00Z,2018-05-22T19:49:50Z,2018-05-22T19:48:50Z,_m,FF,93
|
||||
,,0,2018-05-22T19:48:00Z,2018-05-22T19:49:50Z,2018-05-22T19:48:00Z,_m,FF,56
|
||||
,,0,2018-05-22T19:48:00Z,2018-05-22T19:49:50Z,2018-05-22T19:48:10Z,_m,FF,11
|
||||
,,0,2018-05-22T19:48:00Z,2018-05-22T19:49:50Z,2018-05-22T19:48:20Z,_m,FF,29
|
||||
,,1,2018-05-22T19:48:00Z,2018-05-22T19:49:50Z,2018-05-22T19:48:30Z,_m,QQ,26
|
||||
,,1,2018-05-22T19:48:00Z,2018-05-22T19:49:50Z,2018-05-22T19:48:40Z,_m,QQ,88
|
||||
,,1,2018-05-22T19:48:00Z,2018-05-22T19:49:50Z,2018-05-22T19:48:50Z,_m,QQ,47
|
||||
,,1,2018-05-22T19:48:00Z,2018-05-22T19:49:50Z,2018-05-22T19:49:00Z,_m,QQ,78
|
||||
,,1,2018-05-22T19:48:00Z,2018-05-22T19:49:50Z,2018-05-22T19:49:10Z,_m,QQ,51
|
||||
,,1,2018-05-22T19:48:00Z,2018-05-22T19:49:50Z,2018-05-22T19:49:30Z,_m,QQ,22
|
||||
,,1,2018-05-22T19:48:00Z,2018-05-22T19:49:50Z,2018-05-22T19:49:40Z,_m,QQ,19
|
||||
,,1,2018-05-22T19:48:00Z,2018-05-22T19:49:50Z,2018-05-22T19:48:50Z,_m,QQ,69
|
||||
,,1,2018-05-22T19:48:00Z,2018-05-22T19:49:50Z,2018-05-22T19:49:00Z,_m,QQ,63
|
||||
,,2,2018-05-22T19:48:00Z,2018-05-22T19:49:50Z,2018-05-22T19:48:10Z,_m,RR,62
|
||||
,,2,2018-05-22T19:48:00Z,2018-05-22T19:49:50Z,2018-05-22T19:48:30Z,_m,RR,18
|
||||
,,2,2018-05-22T19:48:00Z,2018-05-22T19:49:50Z,2018-05-22T19:49:40Z,_m,RR,19
|
||||
,,2,2018-05-22T19:48:00Z,2018-05-22T19:49:50Z,2018-05-22T19:48:50Z,_m,RR,90
|
||||
,,3,2018-05-22T19:48:00Z,2018-05-22T19:49:50Z,2018-05-22T19:49:00Z,_m,SR,36
|
||||
,,3,2018-05-22T19:48:00Z,2018-05-22T19:49:50Z,2018-05-22T19:49:10Z,_m,SR,72
|
||||
,,3,2018-05-22T19:48:00Z,2018-05-22T19:49:50Z,2018-05-22T19:49:20Z,_m,SR,88
|
||||
"
|
||||
|
||||
t_shift_negative_duration = (table=<-) => table
|
||||
|> shift(shift: -5m)
|
||||
|
||||
testingTest(name: "shift_negative_duration",
|
||||
input: testLoadStorage(csv: inData),
|
||||
want: testLoadMem(csv: outData),
|
||||
test: t_shift_negative_duration)
|
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,27 @@
|
|||
inData = "
|
||||
#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,dateTime:RFC3339,string,string,double
|
||||
#group,false,false,true,true,false,true,true,false
|
||||
#default,_result,,,,,,,
|
||||
,result,table,_start,_stop,_time,_measurement,_field,_value
|
||||
,,0,2018-04-17T00:00:00Z,2018-04-17T00:05:00Z,2018-04-17T00:00:00Z,m1,f1,42.0
|
||||
,,0,2018-04-17T00:00:00Z,2018-04-17T00:05:00Z,2018-04-17T00:00:01Z,m1,f1,43.0
|
||||
"
|
||||
outData = "
|
||||
#datatype,string,long,dateTime:RFC3339,string,dateTime:RFC3339,double
|
||||
#group,false,false,true,true,false,false
|
||||
#default,_result,,,,,
|
||||
,result,table,_start,_measurement,_time,max
|
||||
,,0,2018-04-17T00:00:00Z,m1,2018-04-17T00:00:01Z,43
|
||||
"
|
||||
|
||||
simple_max = (table=<-) =>
|
||||
table
|
||||
|> range(start:2018-04-17T00:00:00Z)
|
||||
|> group(columns: ["_measurement", "_start"])
|
||||
|> max(column: "_value")
|
||||
|> map(fn: (r) => ({_time: r._time,max:r._value}))
|
||||
|
||||
testingTest(name: "simple_max",
|
||||
input: testLoadStorage(csv: inData),
|
||||
want: testLoadMem(csv: outData),
|
||||
test: simple_max)
|
|
@ -0,0 +1 @@
|
|||
{"results":[{"statement_id":0,"series":[{"name":"m1","columns":["time","max"],"values":[["2018-04-17T00:00:01Z",43]]}]}]}
|
|
@ -0,0 +1,54 @@
|
|||
inData = "
|
||||
#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,string,string,dateTime:RFC3339,unsignedLong
|
||||
#group,false,false,false,false,true,true,false,false
|
||||
#default,,,,,,,,
|
||||
,result,table,_start,_stop,_measurement,_field,_time,_value
|
||||
,,0,2018-12-18T22:11:05Z,2018-12-18T22:11:55Z,Sgf,DlXwgrw,2018-12-18T22:11:05Z,70
|
||||
,,0,2018-12-18T22:11:05Z,2018-12-18T22:11:55Z,Sgf,DlXwgrw,2018-12-18T22:11:15Z,48
|
||||
,,0,2018-12-18T22:11:05Z,2018-12-18T22:11:55Z,Sgf,DlXwgrw,2018-12-18T22:11:25Z,33
|
||||
,,0,2018-12-18T22:11:05Z,2018-12-18T22:11:55Z,Sgf,DlXwgrw,2018-12-18T22:11:35Z,24
|
||||
,,0,2018-12-18T22:11:05Z,2018-12-18T22:11:55Z,Sgf,DlXwgrw,2018-12-18T22:11:45Z,38
|
||||
,,0,2018-12-18T22:11:05Z,2018-12-18T22:11:55Z,Sgf,DlXwgrw,2018-12-18T22:11:55Z,75
|
||||
|
||||
#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,string,string,dateTime:RFC3339,long
|
||||
#group,false,false,false,false,true,true,false,false
|
||||
#default,,,,,,,,
|
||||
,result,table,_start,_stop,_measurement,_field,_time,_value
|
||||
,,1,2018-12-18T22:11:05Z,2018-12-18T22:11:55Z,Sgf,GxUPYq1,2018-12-18T22:11:05Z,96
|
||||
,,1,2018-12-18T22:11:05Z,2018-12-18T22:11:55Z,Sgf,GxUPYq1,2018-12-18T22:11:15Z,-44
|
||||
,,1,2018-12-18T22:11:05Z,2018-12-18T22:11:55Z,Sgf,GxUPYq1,2018-12-18T22:11:25Z,-25
|
||||
,,1,2018-12-18T22:11:05Z,2018-12-18T22:11:55Z,Sgf,GxUPYq1,2018-12-18T22:11:35Z,46
|
||||
,,1,2018-12-18T22:11:05Z,2018-12-18T22:11:55Z,Sgf,GxUPYq1,2018-12-18T22:11:45Z,-2
|
||||
,,1,2018-12-18T22:11:05Z,2018-12-18T22:11:55Z,Sgf,GxUPYq1,2018-12-18T22:11:55Z,-14
|
||||
|
||||
#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,string,string,dateTime:RFC3339,double
|
||||
#group,false,false,false,false,true,true,false,false
|
||||
#default,,,,,,,,
|
||||
,result,table,_start,_stop,_measurement,_field,_time,_value
|
||||
,,2,2018-12-18T22:11:05Z,2018-12-18T22:11:55Z,Sgf,qaOnnQc,2018-12-18T22:11:05Z,-61.68790887989735
|
||||
,,2,2018-12-18T22:11:05Z,2018-12-18T22:11:55Z,Sgf,qaOnnQc,2018-12-18T22:11:15Z,-6.3173755351186465
|
||||
,,2,2018-12-18T22:11:05Z,2018-12-18T22:11:55Z,Sgf,qaOnnQc,2018-12-18T22:11:25Z,-26.049728557657513
|
||||
,,2,2018-12-18T22:11:05Z,2018-12-18T22:11:55Z,Sgf,qaOnnQc,2018-12-18T22:11:35Z,114.285955884979
|
||||
,,2,2018-12-18T22:11:05Z,2018-12-18T22:11:55Z,Sgf,qaOnnQc,2018-12-18T22:11:45Z,16.140262630578995
|
||||
,,2,2018-12-18T22:11:05Z,2018-12-18T22:11:55Z,Sgf,qaOnnQc,2018-12-18T22:11:55Z,29.50336437998469
|
||||
"
|
||||
outData = "
|
||||
#datatype,string,long,string,string,double
|
||||
#group,false,false,true,true,false
|
||||
#default,_result,,,,
|
||||
,result,table,_measurement,_field,_value
|
||||
,,0,Sgf,DlXwgrw,0.3057387969724791
|
||||
,,1,Sgf,GxUPYq1,0.7564084754909545
|
||||
,,2,Sgf,qaOnnQc,0.6793279546139146
|
||||
"
|
||||
|
||||
option now = () => 2018-12-18T22:12:00Z
|
||||
|
||||
t_skew = (table=<-) => table
|
||||
|> range(start: -5m)
|
||||
|> skew()
|
||||
|
||||
testingTest(name: "skew",
|
||||
input: testLoadStorage(csv: inData),
|
||||
want: testLoadMem(csv: outData),
|
||||
test: t_skew)
|
|
@ -0,0 +1,82 @@
|
|||
inData = "
|
||||
#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,dateTime:RFC3339,double,string,string,string
|
||||
#group,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.4214704Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:26Z,82.9833984375,used_percent,swap,host.local
|
||||
,,161,2018-05-22T19:53:24.4214704Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:36Z,82.598876953125,used_percent,swap,host.local
|
||||
,,161,2018-05-22T19:53:24.4214704Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:46Z,82.598876953125,used_percent,swap,host.local
|
||||
,,161,2018-05-22T19:53:24.4214704Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:56Z,82.598876953125,used_percent,swap,host.local
|
||||
,,161,2018-05-22T19:53:24.4214704Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:54:06Z,82.598876953125,used_percent,swap,host.local
|
||||
,,161,2018-05-22T19:53:24.4214704Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:54:16Z,82.6416015625,used_percent,swap,host.local
|
||||
,,161,2018-05-22T19:53:24.4214704Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:26Z,2.9833984375,used_percent,swap,host1.local
|
||||
,,161,2018-05-22T19:53:24.4214704Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:36Z,2.598876953125,used_percent,swap,host1.local
|
||||
,,161,2018-05-22T19:53:24.4214704Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:46Z,2.598876953125,used_percent,swap,host1.local
|
||||
,,161,2018-05-22T19:53:24.4214704Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:56Z,2.598876953125,used_percent,swap,host1.local
|
||||
,,161,2018-05-22T19:53:24.4214704Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:54:06Z,2.598876953125,used_percent,swap,host1.local
|
||||
,,161,2018-05-22T19:53:24.4214704Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:54:16Z,2.6416015625,used_percent,swap,host1.local
|
||||
,,162,2018-05-22T19:53:24.4214704Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:26Z,1.83,load1,system,host.local
|
||||
,,162,2018-05-22T19:53:24.4214704Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:36Z,1.7,load1,system,host.local
|
||||
,,162,2018-05-22T19:53:24.4214704Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:46Z,1.74,load1,system,host.local
|
||||
,,162,2018-05-22T19:53:24.4214704Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:56Z,1.63,load1,system,host.local
|
||||
,,162,2018-05-22T19:53:24.4214704Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:54:06Z,1.91,load1,system,host.local
|
||||
,,162,2018-05-22T19:53:24.4214704Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:54:16Z,1.84,load1,system,host.local
|
||||
,,163,2018-05-22T19:53:24.4214704Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:26Z,1.98,load15,system,host.local
|
||||
,,163,2018-05-22T19:53:24.4214704Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:36Z,1.97,load15,system,host.local
|
||||
,,163,2018-05-22T19:53:24.4214704Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:46Z,1.97,load15,system,host.local
|
||||
,,163,2018-05-22T19:53:24.4214704Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:56Z,1.96,load15,system,host.local
|
||||
,,163,2018-05-22T19:53:24.4214704Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:54:06Z,1.98,load15,system,host.local
|
||||
,,163,2018-05-22T19:53:24.4214704Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:54:16Z,1.97,load15,system,host.local
|
||||
,,164,2018-05-22T19:53:24.4214704Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:26Z,1.95,load5,system,host.local
|
||||
,,164,2018-05-22T19:53:24.4214704Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:36Z,1.92,load5,system,host.local
|
||||
,,164,2018-05-22T19:53:24.4214704Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:46Z,1.92,load5,system,host.local
|
||||
,,164,2018-05-22T19:53:24.4214704Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:56Z,1.89,load5,system,host.local
|
||||
,,164,2018-05-22T19:53:24.4214704Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:54:06Z,1.94,load5,system,host.local
|
||||
,,164,2018-05-22T19:53:24.4214704Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:54:16Z,1.93,load5,system,host.local
|
||||
"
|
||||
outData = "
|
||||
#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,dateTime:RFC3339,double,string,string,string
|
||||
#group,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:26Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:56Z,1.63,load1,system,host.local
|
||||
,,0,2018-05-22T19:53:26Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:36Z,1.7,load1,system,host.local
|
||||
,,0,2018-05-22T19:53:26Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:46Z,1.74,load1,system,host.local
|
||||
,,0,2018-05-22T19:53:26Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:26Z,1.83,load1,system,host.local
|
||||
,,0,2018-05-22T19:53:26Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:54:16Z,1.84,load1,system,host.local
|
||||
,,0,2018-05-22T19:53:26Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:54:06Z,1.91,load1,system,host.local
|
||||
,,1,2018-05-22T19:53:26Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:56Z,1.96,load15,system,host.local
|
||||
,,1,2018-05-22T19:53:26Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:36Z,1.97,load15,system,host.local
|
||||
,,1,2018-05-22T19:53:26Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:46Z,1.97,load15,system,host.local
|
||||
,,1,2018-05-22T19:53:26Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:54:16Z,1.97,load15,system,host.local
|
||||
,,1,2018-05-22T19:53:26Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:26Z,1.98,load15,system,host.local
|
||||
,,1,2018-05-22T19:53:26Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:54:06Z,1.98,load15,system,host.local
|
||||
,,2,2018-05-22T19:53:26Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:56Z,1.89,load5,system,host.local
|
||||
,,2,2018-05-22T19:53:26Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:36Z,1.92,load5,system,host.local
|
||||
,,2,2018-05-22T19:53:26Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:46Z,1.92,load5,system,host.local
|
||||
,,2,2018-05-22T19:53:26Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:54:16Z,1.93,load5,system,host.local
|
||||
,,2,2018-05-22T19:53:26Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:54:06Z,1.94,load5,system,host.local
|
||||
,,2,2018-05-22T19:53:26Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:26Z,1.95,load5,system,host.local
|
||||
,,3,2018-05-22T19:53:26Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:36Z,2.598876953125,used_percent,swap,host1.local
|
||||
,,3,2018-05-22T19:53:26Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:46Z,2.598876953125,used_percent,swap,host1.local
|
||||
,,3,2018-05-22T19:53:26Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:56Z,2.598876953125,used_percent,swap,host1.local
|
||||
,,3,2018-05-22T19:53:26Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:54:06Z,2.598876953125,used_percent,swap,host1.local
|
||||
,,3,2018-05-22T19:53:26Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:54:16Z,2.6416015625,used_percent,swap,host1.local
|
||||
,,3,2018-05-22T19:53:26Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:26Z,2.9833984375,used_percent,swap,host1.local
|
||||
,,3,2018-05-22T19:53:26Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:36Z,82.598876953125,used_percent,swap,host.local
|
||||
,,3,2018-05-22T19:53:26Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:46Z,82.598876953125,used_percent,swap,host.local
|
||||
,,3,2018-05-22T19:53:26Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:56Z,82.598876953125,used_percent,swap,host.local
|
||||
,,3,2018-05-22T19:53:26Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:54:06Z,82.598876953125,used_percent,swap,host.local
|
||||
,,3,2018-05-22T19:53:26Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:54:16Z,82.6416015625,used_percent,swap,host.local
|
||||
,,3,2018-05-22T19:53:26Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:26Z,82.9833984375,used_percent,swap,host.local
|
||||
"
|
||||
|
||||
t_sort = (table=<-) =>
|
||||
table
|
||||
|> range(start: 2018-05-22T19:53:26Z)
|
||||
|> sort(columns:["_value", "_time"])
|
||||
|
||||
testingTest(name: "sort",
|
||||
input: testLoadStorage(csv: inData),
|
||||
want: testLoadMem(csv: outData),
|
||||
test: t_sort)
|
|
@ -0,0 +1,64 @@
|
|||
inData = "
|
||||
#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,string,string,dateTime:RFC3339,unsignedLong
|
||||
#group,false,false,false,false,true,true,false,false
|
||||
#default,,,,,,,,
|
||||
,result,table,_start,_stop,_measurement,_field,_time,_value
|
||||
,,0,2018-12-18T22:11:05Z,2018-12-18T22:11:55Z,Sgf,DlXwgrw,2018-12-18T22:11:05Z,70
|
||||
,,0,2018-12-18T22:11:05Z,2018-12-18T22:11:55Z,Sgf,DlXwgrw,2018-12-18T22:11:15Z,48
|
||||
,,0,2018-12-18T22:11:05Z,2018-12-18T22:11:55Z,Sgf,DlXwgrw,2018-12-18T22:11:25Z,33
|
||||
,,0,2018-12-18T22:11:05Z,2018-12-18T22:11:55Z,Sgf,DlXwgrw,2018-12-18T22:11:35Z,24
|
||||
,,0,2018-12-18T22:11:05Z,2018-12-18T22:11:55Z,Sgf,DlXwgrw,2018-12-18T22:11:45Z,38
|
||||
,,0,2018-12-18T22:11:05Z,2018-12-18T22:11:55Z,Sgf,DlXwgrw,2018-12-18T22:11:55Z,75
|
||||
|
||||
#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,string,string,dateTime:RFC3339,long
|
||||
#group,false,false,false,false,true,true,false,false
|
||||
#default,,,,,,,,
|
||||
,result,table,_start,_stop,_measurement,_field,_time,_value
|
||||
,,1,2018-12-18T22:11:05Z,2018-12-18T22:11:55Z,Sgf,GxUPYq1,2018-12-18T22:11:05Z,96
|
||||
,,1,2018-12-18T22:11:05Z,2018-12-18T22:11:55Z,Sgf,GxUPYq1,2018-12-18T22:11:15Z,-44
|
||||
,,1,2018-12-18T22:11:05Z,2018-12-18T22:11:55Z,Sgf,GxUPYq1,2018-12-18T22:11:25Z,-25
|
||||
,,1,2018-12-18T22:11:05Z,2018-12-18T22:11:55Z,Sgf,GxUPYq1,2018-12-18T22:11:35Z,46
|
||||
,,1,2018-12-18T22:11:05Z,2018-12-18T22:11:55Z,Sgf,GxUPYq1,2018-12-18T22:11:45Z,-2
|
||||
,,1,2018-12-18T22:11:05Z,2018-12-18T22:11:55Z,Sgf,GxUPYq1,2018-12-18T22:11:55Z,-14
|
||||
|
||||
#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,string,string,dateTime:RFC3339,double
|
||||
#group,false,false,false,false,true,true,false,false
|
||||
#default,,,,,,,,
|
||||
,result,table,_start,_stop,_measurement,_field,_time,_value
|
||||
,,2,2018-12-18T22:11:05Z,2018-12-18T22:11:55Z,Sgf,qaOnnQc,2018-12-18T22:11:05Z,-61.68790887989735
|
||||
,,2,2018-12-18T22:11:05Z,2018-12-18T22:11:55Z,Sgf,qaOnnQc,2018-12-18T22:11:15Z,-6.3173755351186465
|
||||
,,2,2018-12-18T22:11:05Z,2018-12-18T22:11:55Z,Sgf,qaOnnQc,2018-12-18T22:11:25Z,-26.049728557657513
|
||||
,,2,2018-12-18T22:11:05Z,2018-12-18T22:11:55Z,Sgf,qaOnnQc,2018-12-18T22:11:35Z,114.285955884979
|
||||
,,2,2018-12-18T22:11:05Z,2018-12-18T22:11:55Z,Sgf,qaOnnQc,2018-12-18T22:11:45Z,16.140262630578995
|
||||
,,2,2018-12-18T22:11:05Z,2018-12-18T22:11:55Z,Sgf,qaOnnQc,2018-12-18T22:11:55Z,29.50336437998469
|
||||
"
|
||||
outData = "
|
||||
#datatype,string,long,string,string,unsignedLong
|
||||
#group,false,false,true,true,false
|
||||
#default,_result,,,,
|
||||
,result,table,_measurement,_field,_value
|
||||
,,0,Sgf,DlXwgrw,51
|
||||
|
||||
#datatype,string,long,string,string,long
|
||||
#group,false,false,true,true,false
|
||||
#default,_result,,,,
|
||||
,result,table,_measurement,_field,_value
|
||||
,,1,Sgf,GxUPYq1,140
|
||||
|
||||
#datatype,string,long,string,string,double
|
||||
#group,false,false,true,true,false
|
||||
#default,_result,,,,
|
||||
,result,table,_measurement,_field,_value
|
||||
,,2,Sgf,qaOnnQc,175.97386476487634
|
||||
"
|
||||
|
||||
option now = () => 2018-12-18T22:12:00Z
|
||||
|
||||
t_spread = (table=<-) => table
|
||||
|> range(start: -5m)
|
||||
|> spread()
|
||||
|
||||
testingTest(name: "spread",
|
||||
input: testLoadStorage(csv: inData),
|
||||
want: testLoadMem(csv: outData),
|
||||
test: t_spread)
|
|
@ -0,0 +1,46 @@
|
|||
inData = "
|
||||
#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,dateTime:RFC3339,double,string,string,string
|
||||
#group,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.4214704Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:26Z,72.9,used_percent,swap,hostA.local
|
||||
,,161,2018-05-22T19:53:24.4214704Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:36Z,82.5,used_percent,swap,hostA.local
|
||||
,,161,2018-05-22T19:53:24.4214704Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:46Z,82.5,used_percent,swap,hostA.local
|
||||
,,161,2018-05-22T19:53:24.4214704Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:56Z,32.5,used_percent,swap,hostA.local
|
||||
,,161,2018-05-22T19:53:24.4214704Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:54:06Z,32.5,used_percent,swap,hostA.local
|
||||
,,161,2018-05-22T19:53:24.4214704Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:54:16Z,92.6,used_percent,swap,hostA.local
|
||||
,,162,2018-05-22T19:53:24.4214704Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:26Z,82.9,used_percent,swap,hostB.local
|
||||
,,162,2018-05-22T19:53:24.4214704Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:36Z,32.5,used_percent,swap,hostB.local
|
||||
,,162,2018-05-22T19:53:24.4214704Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:46Z,42.5,used_percent,swap,hostB.local
|
||||
,,162,2018-05-22T19:53:24.4214704Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:56Z,52.5,used_percent,swap,hostB.local
|
||||
,,162,2018-05-22T19:53:24.4214704Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:54:06Z,82.5,used_percent,swap,hostB.local
|
||||
,,162,2018-05-22T19:53:24.4214704Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:54:16Z,92.6,used_percent,swap,hostB.local
|
||||
"
|
||||
outData = "
|
||||
#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,dateTime:RFC3339,double,string,string,string,long
|
||||
#group,false,false,false,false,false,false,true,true,true,false
|
||||
#default,_result,,,,,,,,,
|
||||
,result,table,_start,_stop,_time,_value,_field,_measurement,host,stateCount
|
||||
,,0,2018-05-22T19:53:26Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:26Z,72.9,used_percent,swap,hostA.local,-1
|
||||
,,0,2018-05-22T19:53:26Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:36Z,82.5,used_percent,swap,hostA.local,1
|
||||
,,0,2018-05-22T19:53:26Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:46Z,82.5,used_percent,swap,hostA.local,2
|
||||
,,0,2018-05-22T19:53:26Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:56Z,32.5,used_percent,swap,hostA.local,-1
|
||||
,,0,2018-05-22T19:53:26Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:54:06Z,32.5,used_percent,swap,hostA.local,-1
|
||||
,,0,2018-05-22T19:53:26Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:54:16Z,92.6,used_percent,swap,hostA.local,1
|
||||
,,1,2018-05-22T19:53:26Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:26Z,82.9,used_percent,swap,hostB.local,1
|
||||
,,1,2018-05-22T19:53:26Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:36Z,32.5,used_percent,swap,hostB.local,-1
|
||||
,,1,2018-05-22T19:53:26Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:46Z,42.5,used_percent,swap,hostB.local,-1
|
||||
,,1,2018-05-22T19:53:26Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:56Z,52.5,used_percent,swap,hostB.local,-1
|
||||
,,1,2018-05-22T19:53:26Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:54:06Z,82.5,used_percent,swap,hostB.local,1
|
||||
,,1,2018-05-22T19:53:26Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:54:16Z,92.6,used_percent,swap,hostB.local,2
|
||||
"
|
||||
|
||||
t_state_count = (table=<-) =>
|
||||
table
|
||||
|> range(start: 2018-05-22T19:53:26Z)
|
||||
|> stateCount(fn:(r) => r._value > 80)
|
||||
|
||||
testingTest(name: "state_count",
|
||||
input: testLoadStorage(csv: inData),
|
||||
want: testLoadMem(csv: outData),
|
||||
test: t_state_count)
|
|
@ -0,0 +1,46 @@
|
|||
inData = "
|
||||
#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,dateTime:RFC3339,double,string,string,string
|
||||
#group,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.4214704Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:26Z,72.9,used_percent,swap,hostA.local
|
||||
,,161,2018-05-22T19:53:24.4214704Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:36Z,82.5,used_percent,swap,hostA.local
|
||||
,,161,2018-05-22T19:53:24.4214704Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:46Z,82.5,used_percent,swap,hostA.local
|
||||
,,161,2018-05-22T19:53:24.4214704Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:56Z,32.5,used_percent,swap,hostA.local
|
||||
,,161,2018-05-22T19:53:24.4214704Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:54:06Z,32.5,used_percent,swap,hostA.local
|
||||
,,161,2018-05-22T19:53:24.4214704Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:54:16Z,92.6,used_percent,swap,hostA.local
|
||||
,,162,2018-05-22T19:53:24.4214704Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:26Z,82.9,used_percent,swap,hostB.local
|
||||
,,162,2018-05-22T19:53:24.4214704Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:36Z,32.5,used_percent,swap,hostB.local
|
||||
,,162,2018-05-22T19:53:24.4214704Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:46Z,42.5,used_percent,swap,hostB.local
|
||||
,,162,2018-05-22T19:53:24.4214704Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:56Z,52.5,used_percent,swap,hostB.local
|
||||
,,162,2018-05-22T19:53:24.4214704Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:54:06Z,82.5,used_percent,swap,hostB.local
|
||||
,,162,2018-05-22T19:53:24.4214704Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:54:16Z,92.6,used_percent,swap,hostB.local
|
||||
"
|
||||
outData = "
|
||||
#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,dateTime:RFC3339,double,string,string,string,long
|
||||
#group,false,false,false,false,false,false,true,true,true,false
|
||||
#default,_result,,,,,,,,,
|
||||
,result,table,_start,_stop,_time,_value,_field,_measurement,host,stateDuration
|
||||
,,0,2018-05-22T19:53:26Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:26Z,72.9,used_percent,swap,hostA.local,-1
|
||||
,,0,2018-05-22T19:53:26Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:36Z,82.5,used_percent,swap,hostA.local,0
|
||||
,,0,2018-05-22T19:53:26Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:46Z,82.5,used_percent,swap,hostA.local,10
|
||||
,,0,2018-05-22T19:53:26Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:56Z,32.5,used_percent,swap,hostA.local,-1
|
||||
,,0,2018-05-22T19:53:26Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:54:06Z,32.5,used_percent,swap,hostA.local,-1
|
||||
,,0,2018-05-22T19:53:26Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:54:16Z,92.6,used_percent,swap,hostA.local,0
|
||||
,,1,2018-05-22T19:53:26Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:26Z,82.9,used_percent,swap,hostB.local,0
|
||||
,,1,2018-05-22T19:53:26Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:36Z,32.5,used_percent,swap,hostB.local,-1
|
||||
,,1,2018-05-22T19:53:26Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:46Z,42.5,used_percent,swap,hostB.local,-1
|
||||
,,1,2018-05-22T19:53:26Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:56Z,52.5,used_percent,swap,hostB.local,-1
|
||||
,,1,2018-05-22T19:53:26Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:54:06Z,82.5,used_percent,swap,hostB.local,0
|
||||
,,1,2018-05-22T19:53:26Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:54:16Z,92.6,used_percent,swap,hostB.local,10
|
||||
"
|
||||
|
||||
t_state_duration = (table=<-) =>
|
||||
table
|
||||
|> range(start: 2018-05-22T19:53:26Z)
|
||||
|> stateDuration(fn:(r) => r._value > 80)
|
||||
|
||||
testingTest(name: "state_duration",
|
||||
input: testLoadStorage(csv: inData),
|
||||
want: testLoadMem(csv: outData),
|
||||
test: t_state_duration)
|
|
@ -0,0 +1,54 @@
|
|||
inData = "
|
||||
#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,string,string,dateTime:RFC3339,unsignedLong
|
||||
#group,false,false,false,false,true,true,false,false
|
||||
#default,,,,,,,,
|
||||
,result,table,_start,_stop,_measurement,_field,_time,_value
|
||||
,,0,2018-12-18T22:11:05Z,2018-12-18T22:11:55Z,Sgf,DlXwgrw,2018-12-18T22:11:05Z,70
|
||||
,,0,2018-12-18T22:11:05Z,2018-12-18T22:11:55Z,Sgf,DlXwgrw,2018-12-18T22:11:15Z,48
|
||||
,,0,2018-12-18T22:11:05Z,2018-12-18T22:11:55Z,Sgf,DlXwgrw,2018-12-18T22:11:25Z,33
|
||||
,,0,2018-12-18T22:11:05Z,2018-12-18T22:11:55Z,Sgf,DlXwgrw,2018-12-18T22:11:35Z,24
|
||||
,,0,2018-12-18T22:11:05Z,2018-12-18T22:11:55Z,Sgf,DlXwgrw,2018-12-18T22:11:45Z,38
|
||||
,,0,2018-12-18T22:11:05Z,2018-12-18T22:11:55Z,Sgf,DlXwgrw,2018-12-18T22:11:55Z,75
|
||||
|
||||
#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,string,string,dateTime:RFC3339,long
|
||||
#group,false,false,false,false,true,true,false,false
|
||||
#default,,,,,,,,
|
||||
,result,table,_start,_stop,_measurement,_field,_time,_value
|
||||
,,1,2018-12-18T22:11:05Z,2018-12-18T22:11:55Z,Sgf,GxUPYq1,2018-12-18T22:11:05Z,96
|
||||
,,1,2018-12-18T22:11:05Z,2018-12-18T22:11:55Z,Sgf,GxUPYq1,2018-12-18T22:11:15Z,-44
|
||||
,,1,2018-12-18T22:11:05Z,2018-12-18T22:11:55Z,Sgf,GxUPYq1,2018-12-18T22:11:25Z,-25
|
||||
,,1,2018-12-18T22:11:05Z,2018-12-18T22:11:55Z,Sgf,GxUPYq1,2018-12-18T22:11:35Z,46
|
||||
,,1,2018-12-18T22:11:05Z,2018-12-18T22:11:55Z,Sgf,GxUPYq1,2018-12-18T22:11:45Z,-2
|
||||
,,1,2018-12-18T22:11:05Z,2018-12-18T22:11:55Z,Sgf,GxUPYq1,2018-12-18T22:11:55Z,-14
|
||||
|
||||
#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,string,string,dateTime:RFC3339,double
|
||||
#group,false,false,false,false,true,true,false,false
|
||||
#default,,,,,,,,
|
||||
,result,table,_start,_stop,_measurement,_field,_time,_value
|
||||
,,2,2018-12-18T22:11:05Z,2018-12-18T22:11:55Z,Sgf,qaOnnQc,2018-12-18T22:11:05Z,-61.68790887989735
|
||||
,,2,2018-12-18T22:11:05Z,2018-12-18T22:11:55Z,Sgf,qaOnnQc,2018-12-18T22:11:15Z,-6.3173755351186465
|
||||
,,2,2018-12-18T22:11:05Z,2018-12-18T22:11:55Z,Sgf,qaOnnQc,2018-12-18T22:11:25Z,-26.049728557657513
|
||||
,,2,2018-12-18T22:11:05Z,2018-12-18T22:11:55Z,Sgf,qaOnnQc,2018-12-18T22:11:35Z,114.285955884979
|
||||
,,2,2018-12-18T22:11:05Z,2018-12-18T22:11:55Z,Sgf,qaOnnQc,2018-12-18T22:11:45Z,16.140262630578995
|
||||
,,2,2018-12-18T22:11:05Z,2018-12-18T22:11:55Z,Sgf,qaOnnQc,2018-12-18T22:11:55Z,29.50336437998469
|
||||
"
|
||||
outData = "
|
||||
#datatype,string,long,string,string,double
|
||||
#group,false,false,true,true,false
|
||||
#default,_result,,,,
|
||||
,result,table,_measurement,_field,_value
|
||||
,,0,Sgf,DlXwgrw,20.5621010599598
|
||||
,,1,Sgf,GxUPYq1,52.060541679855774
|
||||
,,2,Sgf,qaOnnQc,59.9881468845287
|
||||
"
|
||||
|
||||
option now = () => 2018-12-18T22:12:00Z
|
||||
|
||||
t_stddev = (table=<-) => table
|
||||
|> range(start: -5m)
|
||||
|> stddev()
|
||||
|
||||
testingTest(name: "stddev",
|
||||
input: testLoadStorage(csv: inData),
|
||||
want: testLoadMem(csv: outData),
|
||||
test: t_stddev)
|
|
@ -0,0 +1,33 @@
|
|||
inData = "
|
||||
#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,field1,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,field1,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,field1,disk,disk1s1,apfs,host.local,/
|
||||
"
|
||||
outData = "
|
||||
#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:56Z,34.982447293755506,field1,disk,disk1s1,apfs,host.local,/
|
||||
,,0,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:54:06Z,34.98204153981662,field1,disk,disk1s1,apfs,host.local,/
|
||||
,,0,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:54:16Z,34.982252364543626,field1,disk,disk1s1,apfs,host.local,/
|
||||
"
|
||||
|
||||
n = 1
|
||||
fieldSelect = "field{n}"
|
||||
|
||||
t_string_interp = (table=<-) =>
|
||||
table
|
||||
|> range(start:2018-05-22T19:53:26Z)
|
||||
|> filter(fn: (r) => r._field == fieldSelect)
|
||||
testingTest(name: "string_interp",
|
||||
input: testLoadStorage(csv: inData),
|
||||
want: testLoadMem(csv: outData),
|
||||
test: t_string_interp)
|
|
@ -0,0 +1,23 @@
|
|||
inData = "
|
||||
#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,dateTime:RFC3339,string,string,string,string,string,string,string
|
||||
#group,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:54:16Z,13F2,used_percent,disk,disk1,apfs,host.local,/
|
||||
,,0,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:56Z,2COTDe,used_percent,disk,disk1,apfs,host.local,/
|
||||
,,0,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:54:06Z,cLnSkNMI,used_percent,disk,disk1,apfs,host.local,/
|
||||
,,0,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:26Z,a,used_percent,disk,disk1,apfs,host.local,/
|
||||
,,0,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:46Z,b,used_percent,disk,disk1,apfs,host.local,/
|
||||
,,0,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:36Z,k9ngm,used_percent,disk,disk1,apfs,host.local,/
|
||||
"
|
||||
outData = "error: invalid use of function: *functions.MaxSelector has no implementation for type string
|
||||
"
|
||||
|
||||
t_string_max = (table=<-) =>
|
||||
table
|
||||
|> range(start:2018-05-22T19:54:16Z)
|
||||
|> max()
|
||||
testingTest(name: "string_max",
|
||||
input: testLoadStorage(csv: inData),
|
||||
want: testLoadMem(csv: outData),
|
||||
test: t_string_max)
|
|
@ -0,0 +1,34 @@
|
|||
inData = "
|
||||
#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,dateTime:RFC3339,string,string,string,string,string,string,string
|
||||
#group,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:54:16Z,13F2,used_percent,disk,disk1,apfs,host.local,/
|
||||
,,0,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:56Z,2COTDe,used_percent,disk,disk1,apfs,host.local,/
|
||||
,,0,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:54:06Z,cLnSkNMI,used_percent,disk,disk1,apfs,host.local,/
|
||||
,,0,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:26Z,a,used_percent,disk,disk1,apfs,host.local,/
|
||||
,,0,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:46Z,b,used_percent,disk,disk1,apfs,host.local,/
|
||||
,,0,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:36Z,k9ngm,used_percent,disk,disk1,apfs,host.local,/
|
||||
"
|
||||
outData = "
|
||||
#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,dateTime:RFC3339,string,string,string,string,string,string,string
|
||||
#group,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:26Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:54:16Z,13F2,used_percent,disk,disk1,apfs,host.local,/
|
||||
,,0,2018-05-22T19:53:26Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:56Z,2COTDe,used_percent,disk,disk1,apfs,host.local,/
|
||||
,,0,2018-05-22T19:53:26Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:26Z,a,used_percent,disk,disk1,apfs,host.local,/
|
||||
,,0,2018-05-22T19:53:26Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:46Z,b,used_percent,disk,disk1,apfs,host.local,/
|
||||
,,0,2018-05-22T19:53:26Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:54:06Z,cLnSkNMI,used_percent,disk,disk1,apfs,host.local,/
|
||||
,,0,2018-05-22T19:53:26Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:36Z,k9ngm,used_percent,disk,disk1,apfs,host.local,/
|
||||
"
|
||||
|
||||
t_string_sort = (table=<-) =>
|
||||
table
|
||||
|> range(start:2018-05-22T19:53:26Z)
|
||||
|> sort()
|
||||
|
||||
testingTest(name: "string_sort",
|
||||
input: testLoadStorage(csv: inData),
|
||||
want: testLoadMem(csv: outData),
|
||||
test: t_string_sort)
|
|
@ -0,0 +1,64 @@
|
|||
inData = "
|
||||
#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,string,string,dateTime:RFC3339,unsignedLong
|
||||
#group,false,false,false,false,true,true,false,false
|
||||
#default,,,,,,,,
|
||||
,result,table,_start,_stop,_measurement,_field,_time,_value
|
||||
,,0,2018-12-18T22:11:05Z,2018-12-18T22:11:55Z,Sgf,DlXwgrw,2018-12-18T22:11:05Z,70
|
||||
,,0,2018-12-18T22:11:05Z,2018-12-18T22:11:55Z,Sgf,DlXwgrw,2018-12-18T22:11:15Z,48
|
||||
,,0,2018-12-18T22:11:05Z,2018-12-18T22:11:55Z,Sgf,DlXwgrw,2018-12-18T22:11:25Z,33
|
||||
,,0,2018-12-18T22:11:05Z,2018-12-18T22:11:55Z,Sgf,DlXwgrw,2018-12-18T22:11:35Z,24
|
||||
,,0,2018-12-18T22:11:05Z,2018-12-18T22:11:55Z,Sgf,DlXwgrw,2018-12-18T22:11:45Z,38
|
||||
,,0,2018-12-18T22:11:05Z,2018-12-18T22:11:55Z,Sgf,DlXwgrw,2018-12-18T22:11:55Z,75
|
||||
|
||||
#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,string,string,dateTime:RFC3339,long
|
||||
#group,false,false,false,false,true,true,false,false
|
||||
#default,,,,,,,,
|
||||
,result,table,_start,_stop,_measurement,_field,_time,_value
|
||||
,,1,2018-12-18T22:11:05Z,2018-12-18T22:11:55Z,Sgf,GxUPYq1,2018-12-18T22:11:05Z,96
|
||||
,,1,2018-12-18T22:11:05Z,2018-12-18T22:11:55Z,Sgf,GxUPYq1,2018-12-18T22:11:15Z,-44
|
||||
,,1,2018-12-18T22:11:05Z,2018-12-18T22:11:55Z,Sgf,GxUPYq1,2018-12-18T22:11:25Z,-25
|
||||
,,1,2018-12-18T22:11:05Z,2018-12-18T22:11:55Z,Sgf,GxUPYq1,2018-12-18T22:11:35Z,46
|
||||
,,1,2018-12-18T22:11:05Z,2018-12-18T22:11:55Z,Sgf,GxUPYq1,2018-12-18T22:11:45Z,-2
|
||||
,,1,2018-12-18T22:11:05Z,2018-12-18T22:11:55Z,Sgf,GxUPYq1,2018-12-18T22:11:55Z,-14
|
||||
|
||||
#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,string,string,dateTime:RFC3339,double
|
||||
#group,false,false,false,false,true,true,false,false
|
||||
#default,,,,,,,,
|
||||
,result,table,_start,_stop,_measurement,_field,_time,_value
|
||||
,,2,2018-12-18T22:11:05Z,2018-12-18T22:11:55Z,Sgf,qaOnnQc,2018-12-18T22:11:05Z,-61.68790887989735
|
||||
,,2,2018-12-18T22:11:05Z,2018-12-18T22:11:55Z,Sgf,qaOnnQc,2018-12-18T22:11:15Z,-6.3173755351186465
|
||||
,,2,2018-12-18T22:11:05Z,2018-12-18T22:11:55Z,Sgf,qaOnnQc,2018-12-18T22:11:25Z,-26.049728557657513
|
||||
,,2,2018-12-18T22:11:05Z,2018-12-18T22:11:55Z,Sgf,qaOnnQc,2018-12-18T22:11:35Z,114.285955884979
|
||||
,,2,2018-12-18T22:11:05Z,2018-12-18T22:11:55Z,Sgf,qaOnnQc,2018-12-18T22:11:45Z,16.140262630578995
|
||||
,,2,2018-12-18T22:11:05Z,2018-12-18T22:11:55Z,Sgf,qaOnnQc,2018-12-18T22:11:55Z,29.50336437998469
|
||||
"
|
||||
outData = "
|
||||
#datatype,string,long,string,string,unsignedLong
|
||||
#group,false,false,true,true,false
|
||||
#default,_result,,,,
|
||||
,result,table,_measurement,_field,_value
|
||||
,,0,Sgf,DlXwgrw,288
|
||||
|
||||
#datatype,string,long,string,string,long
|
||||
#group,false,false,true,true,false
|
||||
#default,_result,,,,
|
||||
,result,table,_measurement,_field,_value
|
||||
,,1,Sgf,GxUPYq1,57
|
||||
|
||||
#datatype,string,long,string,string,double
|
||||
#group,false,false,true,true,false
|
||||
#default,_result,,,,
|
||||
,result,table,_measurement,_field,_value
|
||||
,,2,Sgf,qaOnnQc,65.87456992286917
|
||||
"
|
||||
|
||||
option now = () => 2018-12-18T22:12:00Z
|
||||
|
||||
t_sum = (table=<-) => table
|
||||
|> range(start: -5m)
|
||||
|> sum()
|
||||
|
||||
testingTest(name: "sum",
|
||||
input: testLoadStorage(csv: inData),
|
||||
want: testLoadMem(csv: outData),
|
||||
test: t_sum)
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue