fix(fluxtest): update Flux tests for new option support
The Flux test harness now allows inheriting options, this updates the test cases with the new syntax and simplifies any tests that had to duplicate the options.pull/23277/head
parent
24f64a735f
commit
8334dd0a23
|
@ -1,43 +1,46 @@
|
|||
package influxdb_test
|
||||
|
||||
|
||||
import "testing/expect"
|
||||
|
||||
testcase push_down_group_one_tag_count extends "flux/planner/group_agg_test" {
|
||||
testcase push_down_group_one_tag_count extends "flux/planner/group_agg_test.group_one_tag_count" {
|
||||
expect.planner(rules: ["PushDownGroupAggregateRule": 1])
|
||||
group_agg_test.group_one_tag_count()
|
||||
super()
|
||||
}
|
||||
|
||||
testcase push_down_group_all_filter_field_count extends "flux/planner/group_agg_test" {
|
||||
testcase push_down_group_all_filter_field_count extends "flux/planner/group_agg_test.group_all_filter_field_count" {
|
||||
expect.planner(rules: ["PushDownGroupAggregateRule": 1])
|
||||
group_agg_test.group_all_filter_field_count()
|
||||
super()
|
||||
}
|
||||
|
||||
testcase push_down_group_one_tag_filter_field_count extends "flux/planner/group_agg_test" {
|
||||
testcase push_down_group_one_tag_filter_field_count extends "flux/planner/group_agg_test.group_one_tag_filter_field_count"
|
||||
{
|
||||
expect.planner(rules: ["PushDownGroupAggregateRule": 1])
|
||||
super()
|
||||
}
|
||||
|
||||
testcase push_down_group_two_tag_filter_field_count extends "flux/planner/group_agg_test.group_two_tag_filter_field_count"
|
||||
{
|
||||
expect.planner(rules: ["PushDownGroupAggregateRule": 1])
|
||||
super()
|
||||
}
|
||||
|
||||
testcase push_down_group_one_tag_sum extends "flux/planner/group_agg_test.group_one_tag_sum" {
|
||||
expect.planner(rules: ["PushDownGroupAggregateRule": 1])
|
||||
group_agg_test.group_one_tag_filter_field_count()
|
||||
super()
|
||||
}
|
||||
|
||||
testcase push_down_group_two_tag_filter_field_count extends "flux/planner/group_agg_test" {
|
||||
testcase push_down_group_all_filter_field_sum extends "flux/planner/group_agg_test.group_all_filter_field_sum" {
|
||||
expect.planner(rules: ["PushDownGroupAggregateRule": 1])
|
||||
group_agg_test.group_two_tag_filter_field_count()
|
||||
super()
|
||||
}
|
||||
|
||||
testcase push_down_group_one_tag_sum extends "flux/planner/group_agg_test" {
|
||||
testcase push_down_group_one_tag_filter_field_sum extends "flux/planner/group_agg_test.group_one_tag_filter_field_sum" {
|
||||
expect.planner(rules: ["PushDownGroupAggregateRule": 1])
|
||||
group_agg_test.group_one_tag_sum()
|
||||
super()
|
||||
}
|
||||
|
||||
testcase push_down_group_all_filter_field_sum extends "flux/planner/group_agg_test" {
|
||||
testcase push_down_group_two_tag_filter_field_sum extends "flux/planner/group_agg_test.group_two_tag_filter_field_sum" {
|
||||
expect.planner(rules: ["PushDownGroupAggregateRule": 1])
|
||||
group_agg_test.group_all_filter_field_sum()
|
||||
}
|
||||
|
||||
testcase push_down_group_one_tag_filter_field_sum extends "flux/planner/group_agg_test" {
|
||||
expect.planner(rules: ["PushDownGroupAggregateRule": 1])
|
||||
group_agg_test.group_one_tag_filter_field_sum()
|
||||
}
|
||||
|
||||
testcase push_down_group_two_tag_filter_field_sum extends "flux/planner/group_agg_test" {
|
||||
expect.planner(rules: ["PushDownGroupAggregateRule": 1])
|
||||
group_agg_test.group_two_tag_filter_field_sum()
|
||||
super()
|
||||
}
|
||||
|
|
|
@ -3,43 +3,49 @@ package influxdb_test
|
|||
|
||||
import "testing/expect"
|
||||
|
||||
testcase push_down_group_one_tag_first extends "flux/planner/group_first_last_test" {
|
||||
testcase push_down_group_one_tag_first extends "flux/planner/group_first_last_test.group_one_tag_first" {
|
||||
expect.planner(rules: ["PushDownGroupAggregateRule": 1])
|
||||
group_first_last_test.group_one_tag_first()
|
||||
super()
|
||||
}
|
||||
|
||||
testcase push_down_group_all_filter_field_first extends "flux/planner/group_first_last_test" {
|
||||
expect.planner(rules: ["PushDownGroupAggregateRule": 1])
|
||||
group_first_last_test.group_all_filter_field_first()
|
||||
}
|
||||
testcase push_down_group_all_filter_field_first extends "flux/planner/group_first_last_test.group_all_filter_field_first"
|
||||
{
|
||||
expect.planner(rules: ["PushDownGroupAggregateRule": 1])
|
||||
super()
|
||||
}
|
||||
|
||||
testcase push_down_group_one_tag_filter_field_first extends "flux/planner/group_first_last_test" {
|
||||
expect.planner(rules: ["PushDownGroupAggregateRule": 1])
|
||||
group_first_last_test.group_one_tag_filter_field_first()
|
||||
}
|
||||
testcase push_down_group_one_tag_filter_field_first extends "flux/planner/group_first_last_test.group_one_tag_filter_field_first"
|
||||
{
|
||||
expect.planner(rules: ["PushDownGroupAggregateRule": 1])
|
||||
super()
|
||||
}
|
||||
|
||||
testcase push_down_group_two_tag_filter_field_first extends "flux/planner/group_first_last_test" {
|
||||
expect.planner(rules: ["PushDownGroupAggregateRule": 1])
|
||||
group_first_last_test.group_two_tag_filter_field_first()
|
||||
}
|
||||
testcase push_down_group_two_tag_filter_field_first extends "flux/planner/group_first_last_test.group_two_tag_filter_field_first"
|
||||
{
|
||||
expect.planner(rules: ["PushDownGroupAggregateRule": 1])
|
||||
super()
|
||||
}
|
||||
|
||||
// Group + last tests
|
||||
testcase push_down_group_one_tag_last extends "flux/planner/group_first_last_test" {
|
||||
testcase push_down_group_one_tag_last extends "flux/planner/group_first_last_test.group_one_tag_last" {
|
||||
expect.planner(rules: ["PushDownGroupAggregateRule": 1])
|
||||
group_first_last_test.group_one_tag_last()
|
||||
super()
|
||||
}
|
||||
|
||||
testcase push_down_group_all_filter_field_last extends "flux/planner/group_first_last_test" {
|
||||
expect.planner(rules: ["PushDownGroupAggregateRule": 1])
|
||||
group_first_last_test.group_all_filter_field_last()
|
||||
}
|
||||
testcase push_down_group_all_filter_field_last extends "flux/planner/group_first_last_test.group_all_filter_field_last"
|
||||
{
|
||||
expect.planner(rules: ["PushDownGroupAggregateRule": 1])
|
||||
super()
|
||||
}
|
||||
|
||||
testcase push_down_group_one_tag_filter_field_last extends "flux/planner/group_first_last_test" {
|
||||
expect.planner(rules: ["PushDownGroupAggregateRule": 1])
|
||||
group_first_last_test.group_one_tag_filter_field_last()
|
||||
}
|
||||
testcase push_down_group_one_tag_filter_field_last extends "flux/planner/group_first_last_test.group_one_tag_filter_field_last"
|
||||
{
|
||||
expect.planner(rules: ["PushDownGroupAggregateRule": 1])
|
||||
super()
|
||||
}
|
||||
|
||||
testcase push_down_group_two_tag_filter_field_last extends "flux/planner/group_first_last_test" {
|
||||
expect.planner(rules: ["PushDownGroupAggregateRule": 1])
|
||||
group_first_last_test.group_two_tag_filter_field_last()
|
||||
}
|
||||
testcase push_down_group_two_tag_filter_field_last extends "flux/planner/group_first_last_test.group_two_tag_filter_field_last"
|
||||
{
|
||||
expect.planner(rules: ["PushDownGroupAggregateRule": 1])
|
||||
super()
|
||||
}
|
||||
|
|
|
@ -1,61 +1,44 @@
|
|||
package influxdb_test
|
||||
|
||||
|
||||
import "testing/expect"
|
||||
|
||||
option now = () => (2030-01-01T00:00:00Z)
|
||||
|
||||
testcase push_down_min_bare extends "flux/planner/group_min_test" {
|
||||
expect.planner(rules: [
|
||||
"PushDownGroupAggregateRule": 1,
|
||||
])
|
||||
group_min_test.group_min_bare()
|
||||
testcase push_down_min_bare extends "flux/planner/group_min_test.group_min_bare" {
|
||||
expect.planner(rules: ["PushDownGroupAggregateRule": 1])
|
||||
super()
|
||||
}
|
||||
|
||||
testcase push_down_min_bare_host extends "flux/planner/group_min_test" {
|
||||
expect.planner(rules: [
|
||||
"PushDownGroupAggregateRule": 1,
|
||||
])
|
||||
group_min_test.group_min_bare_host()
|
||||
testcase push_down_min_bare_host extends "flux/planner/group_min_test.group_min_bare_host" {
|
||||
expect.planner(rules: ["PushDownGroupAggregateRule": 1])
|
||||
super()
|
||||
}
|
||||
|
||||
testcase push_down_min_bare_field extends "flux/planner/group_min_test" {
|
||||
expect.planner(rules: [
|
||||
"PushDownGroupAggregateRule": 1,
|
||||
])
|
||||
group_min_test.group_min_bare_field()
|
||||
testcase push_down_min_bare_field extends "flux/planner/group_min_test.group_min_bare_field" {
|
||||
expect.planner(rules: ["PushDownGroupAggregateRule": 1])
|
||||
super()
|
||||
}
|
||||
|
||||
testcase push_down_max_bare extends "flux/planner/group_max_test" {
|
||||
expect.planner(rules: [
|
||||
"PushDownGroupAggregateRule": 1,
|
||||
])
|
||||
group_max_test.group_max_bare()
|
||||
testcase push_down_max_bare extends "flux/planner/group_max_test.group_max_bare" {
|
||||
expect.planner(rules: ["PushDownGroupAggregateRule": 1])
|
||||
super()
|
||||
}
|
||||
|
||||
testcase push_down_max_bare_host extends "flux/planner/group_max_test" {
|
||||
expect.planner(rules: [
|
||||
"PushDownGroupAggregateRule": 1,
|
||||
])
|
||||
group_max_test.group_max_bare_host()
|
||||
testcase push_down_max_bare_host extends "flux/planner/group_max_test.group_max_bare_host" {
|
||||
expect.planner(rules: ["PushDownGroupAggregateRule": 1])
|
||||
super()
|
||||
}
|
||||
|
||||
testcase push_down_max_bare_field extends "flux/planner/group_max_test" {
|
||||
expect.planner(rules: [
|
||||
"PushDownGroupAggregateRule": 1,
|
||||
])
|
||||
group_max_test.group_max_bare_field()
|
||||
testcase push_down_max_bare_field extends "flux/planner/group_max_test.group_max_bare_field" {
|
||||
expect.planner(rules: ["PushDownGroupAggregateRule": 1])
|
||||
super()
|
||||
}
|
||||
|
||||
testcase push_down_table_test_min extends "flux/planner/group_min_max_table_test" {
|
||||
expect.planner(rules: [
|
||||
"PushDownGroupAggregateRule": 1,
|
||||
])
|
||||
group_min_max_table_test.group_min_table()
|
||||
testcase push_down_table_test_min extends "flux/planner/group_min_max_table_test.group_min_table" {
|
||||
expect.planner(rules: ["PushDownGroupAggregateRule": 1])
|
||||
super()
|
||||
}
|
||||
|
||||
testcase push_down_table_test_max extends "flux/planner/group_min_max_table_test" {
|
||||
expect.planner(rules: [
|
||||
"PushDownGroupAggregateRule": 1,
|
||||
])
|
||||
group_min_max_table_test.group_max_table()
|
||||
testcase push_down_table_test_max extends "flux/planner/group_min_max_table_test.group_max_table" {
|
||||
expect.planner(rules: ["PushDownGroupAggregateRule": 1])
|
||||
super()
|
||||
}
|
||||
|
|
|
@ -2,524 +2,32 @@ package influxdb_test
|
|||
|
||||
|
||||
import "testing/expect"
|
||||
import "internal/debug"
|
||||
import "array"
|
||||
import "testing"
|
||||
import "csv"
|
||||
import "influxdata/influxdb/schema"
|
||||
|
||||
// TODO(nathanielc): The test data below is duplicated from the Flux test code.
|
||||
// This is because we can't use options in tests that extend other tests.
|
||||
// This makes it so that the tests pass and do the same thing, but any changes
|
||||
// to the source data in Flux will need to be reflected here.
|
||||
// Range of the input data
|
||||
start = 2018-05-22T19:53:16Z
|
||||
stop = 2018-05-22T19:53:26Z
|
||||
|
||||
// cpu:
|
||||
// tags: host,cpu
|
||||
// fields: usage_idle,usage_user
|
||||
cpu =
|
||||
array.from(
|
||||
rows: [
|
||||
{
|
||||
_time: 2018-05-22T19:53:16Z,
|
||||
_measurement: "cpu",
|
||||
host: "host.local",
|
||||
cpu: "cpu0",
|
||||
_field: "usage_idle",
|
||||
_value: 1.83,
|
||||
},
|
||||
{
|
||||
_time: 2018-05-22T19:53:16Z,
|
||||
_measurement: "cpu",
|
||||
host: "host.local",
|
||||
cpu: "cpu1",
|
||||
_field: "usage_idle",
|
||||
_value: 1.72,
|
||||
},
|
||||
{
|
||||
_time: 2018-05-22T19:53:16Z,
|
||||
_measurement: "cpu",
|
||||
host: "host.local",
|
||||
cpu: "cpu0",
|
||||
_field: "usage_user",
|
||||
_value: 1.83,
|
||||
},
|
||||
{
|
||||
_time: 2018-05-22T19:53:16Z,
|
||||
_measurement: "cpu",
|
||||
host: "host.local",
|
||||
cpu: "cpu1",
|
||||
_field: "usage_user",
|
||||
_value: 1.72,
|
||||
},
|
||||
{
|
||||
_time: 2018-05-22T19:53:16Z,
|
||||
_measurement: "cpu",
|
||||
host: "host.global",
|
||||
cpu: "cpu0",
|
||||
_field: "usage_idle",
|
||||
_value: 1.83,
|
||||
},
|
||||
{
|
||||
_time: 2018-05-22T19:53:16Z,
|
||||
_measurement: "cpu",
|
||||
host: "host.global",
|
||||
cpu: "cpu1",
|
||||
_field: "usage_idle",
|
||||
_value: 1.72,
|
||||
},
|
||||
{
|
||||
_time: 2018-05-22T19:53:16Z,
|
||||
_measurement: "cpu",
|
||||
host: "host.global",
|
||||
cpu: "cpu0",
|
||||
_field: "usage_user",
|
||||
_value: 1.83,
|
||||
},
|
||||
{
|
||||
_time: 2018-05-22T19:53:16Z,
|
||||
_measurement: "cpu",
|
||||
host: "host.global",
|
||||
cpu: "cpu1",
|
||||
_field: "usage_user",
|
||||
_value: 1.72,
|
||||
},
|
||||
{
|
||||
_time: 2018-05-22T19:53:16Z,
|
||||
_measurement: "cpu",
|
||||
host: "host.local",
|
||||
cpu: "cpu0",
|
||||
_field: "usage_idle",
|
||||
_value: 1.98,
|
||||
},
|
||||
{
|
||||
_time: 2018-05-22T19:53:16Z,
|
||||
_measurement: "cpu",
|
||||
host: "host.local",
|
||||
cpu: "cpu1",
|
||||
_field: "usage_idle",
|
||||
_value: 1.97,
|
||||
},
|
||||
{
|
||||
_time: 2018-05-22T19:53:16Z,
|
||||
_measurement: "cpu",
|
||||
host: "host.local",
|
||||
cpu: "cpu0",
|
||||
_field: "usage_user",
|
||||
_value: 1.98,
|
||||
},
|
||||
{
|
||||
_time: 2018-05-22T19:53:16Z,
|
||||
_measurement: "cpu",
|
||||
host: "host.local",
|
||||
cpu: "cpu1",
|
||||
_field: "usage_user",
|
||||
_value: 1.97,
|
||||
},
|
||||
{
|
||||
_time: 2018-05-22T19:53:16Z,
|
||||
_measurement: "cpu",
|
||||
host: "host.global",
|
||||
cpu: "cpu0",
|
||||
_field: "usage_idle",
|
||||
_value: 1.98,
|
||||
},
|
||||
{
|
||||
_time: 2018-05-22T19:53:16Z,
|
||||
_measurement: "cpu",
|
||||
host: "host.global",
|
||||
cpu: "cpu1",
|
||||
_field: "usage_idle",
|
||||
_value: 1.97,
|
||||
},
|
||||
{
|
||||
_time: 2018-05-22T19:53:16Z,
|
||||
_measurement: "cpu",
|
||||
host: "host.global",
|
||||
cpu: "cpu0",
|
||||
_field: "usage_user",
|
||||
_value: 1.98,
|
||||
},
|
||||
{
|
||||
_time: 2018-05-22T19:53:16Z,
|
||||
_measurement: "cpu",
|
||||
host: "host.global",
|
||||
cpu: "cpu1",
|
||||
_field: "usage_user",
|
||||
_value: 1.97,
|
||||
},
|
||||
{
|
||||
_time: 2018-05-22T19:53:16Z,
|
||||
_measurement: "cpu",
|
||||
host: "host.local",
|
||||
cpu: "cpu0",
|
||||
_field: "usage_idle",
|
||||
_value: 1.95,
|
||||
},
|
||||
{
|
||||
_time: 2018-05-22T19:53:16Z,
|
||||
_measurement: "cpu",
|
||||
host: "host.local",
|
||||
cpu: "cpu1",
|
||||
_field: "usage_idle",
|
||||
_value: 1.92,
|
||||
},
|
||||
{
|
||||
_time: 2018-05-22T19:53:16Z,
|
||||
_measurement: "cpu",
|
||||
host: "host.local",
|
||||
cpu: "cpu0",
|
||||
_field: "usage_user",
|
||||
_value: 1.95,
|
||||
},
|
||||
{
|
||||
_time: 2018-05-22T19:53:16Z,
|
||||
_measurement: "cpu",
|
||||
host: "host.local",
|
||||
cpu: "cpu1",
|
||||
_field: "usage_user",
|
||||
_value: 1.92,
|
||||
},
|
||||
{
|
||||
_time: 2018-05-22T19:53:16Z,
|
||||
_measurement: "cpu",
|
||||
host: "host.global",
|
||||
cpu: "cpu0",
|
||||
_field: "usage_idle",
|
||||
_value: 1.95,
|
||||
},
|
||||
{
|
||||
_time: 2018-05-22T19:53:16Z,
|
||||
_measurement: "cpu",
|
||||
host: "host.global",
|
||||
cpu: "cpu1",
|
||||
_field: "usage_idle",
|
||||
_value: 1.92,
|
||||
},
|
||||
{
|
||||
_time: 2018-05-22T19:53:16Z,
|
||||
_measurement: "cpu",
|
||||
host: "host.global",
|
||||
cpu: "cpu0",
|
||||
_field: "usage_user",
|
||||
_value: 1.95,
|
||||
},
|
||||
{
|
||||
_time: 2018-05-22T19:53:16Z,
|
||||
_measurement: "cpu",
|
||||
host: "host.global",
|
||||
cpu: "cpu1",
|
||||
_field: "usage_user",
|
||||
_value: 1.92,
|
||||
},
|
||||
{
|
||||
_time: 2018-05-22T19:53:16Z,
|
||||
_measurement: "cpu",
|
||||
host: "host.local",
|
||||
cpu: "cpu0",
|
||||
_field: "usage_idle",
|
||||
_value: 1.83,
|
||||
},
|
||||
{
|
||||
_time: 2018-05-22T19:53:16Z,
|
||||
_measurement: "cpu",
|
||||
host: "host.local",
|
||||
cpu: "cpu1",
|
||||
_field: "usage_idle",
|
||||
_value: 1.72,
|
||||
},
|
||||
{
|
||||
_time: 2018-05-22T19:53:16Z,
|
||||
_measurement: "cpu",
|
||||
host: "host.local",
|
||||
cpu: "cpu0",
|
||||
_field: "usage_user",
|
||||
_value: 1.83,
|
||||
},
|
||||
{
|
||||
_time: 2018-05-22T19:53:16Z,
|
||||
_measurement: "cpu",
|
||||
host: "host.local",
|
||||
cpu: "cpu1",
|
||||
_field: "usage_user",
|
||||
_value: 1.72,
|
||||
},
|
||||
{
|
||||
_time: 2018-05-22T19:53:16Z,
|
||||
_measurement: "cpu",
|
||||
host: "host.global",
|
||||
cpu: "cpu0",
|
||||
_field: "usage_idle",
|
||||
_value: 1.83,
|
||||
},
|
||||
{
|
||||
_time: 2018-05-22T19:53:16Z,
|
||||
_measurement: "cpu",
|
||||
host: "host.global",
|
||||
cpu: "cpu1",
|
||||
_field: "usage_idle",
|
||||
_value: 1.72,
|
||||
},
|
||||
{
|
||||
_time: 2018-05-22T19:53:16Z,
|
||||
_measurement: "cpu",
|
||||
host: "host.global",
|
||||
cpu: "cpu0",
|
||||
_field: "usage_user",
|
||||
_value: 1.83,
|
||||
},
|
||||
{
|
||||
_time: 2018-05-22T19:53:16Z,
|
||||
_measurement: "cpu",
|
||||
host: "host.global",
|
||||
cpu: "cpu1",
|
||||
_field: "usage_user",
|
||||
_value: 1.72,
|
||||
},
|
||||
{
|
||||
_time: 2018-05-22T19:53:16Z,
|
||||
_measurement: "cpu",
|
||||
host: "host.local",
|
||||
cpu: "cpu0",
|
||||
_field: "usage_idle",
|
||||
_value: 1.98,
|
||||
},
|
||||
{
|
||||
_time: 2018-05-22T19:53:16Z,
|
||||
_measurement: "cpu",
|
||||
host: "host.local",
|
||||
cpu: "cpu1",
|
||||
_field: "usage_idle",
|
||||
_value: 1.97,
|
||||
},
|
||||
{
|
||||
_time: 2018-05-22T19:53:16Z,
|
||||
_measurement: "cpu",
|
||||
host: "host.local",
|
||||
cpu: "cpu0",
|
||||
_field: "usage_user",
|
||||
_value: 1.98,
|
||||
},
|
||||
{
|
||||
_time: 2018-05-22T19:53:16Z,
|
||||
_measurement: "cpu",
|
||||
host: "host.local",
|
||||
cpu: "cpu1",
|
||||
_field: "usage_user",
|
||||
_value: 1.97,
|
||||
},
|
||||
{
|
||||
_time: 2018-05-22T19:53:16Z,
|
||||
_measurement: "cpu",
|
||||
host: "host.global",
|
||||
cpu: "cpu0",
|
||||
_field: "usage_idle",
|
||||
_value: 1.98,
|
||||
},
|
||||
{
|
||||
_time: 2018-05-22T19:53:16Z,
|
||||
_measurement: "cpu",
|
||||
host: "host.global",
|
||||
cpu: "cpu1",
|
||||
_field: "usage_idle",
|
||||
_value: 1.97,
|
||||
},
|
||||
{
|
||||
_time: 2018-05-22T19:53:16Z,
|
||||
_measurement: "cpu",
|
||||
host: "host.global",
|
||||
cpu: "cpu0",
|
||||
_field: "usage_user",
|
||||
_value: 1.98,
|
||||
},
|
||||
{
|
||||
_time: 2018-05-22T19:53:16Z,
|
||||
_measurement: "cpu",
|
||||
host: "host.global",
|
||||
cpu: "cpu1",
|
||||
_field: "usage_user",
|
||||
_value: 1.97,
|
||||
},
|
||||
{
|
||||
_time: 2018-05-22T19:53:16Z,
|
||||
_measurement: "cpu",
|
||||
host: "host.local",
|
||||
cpu: "cpu0",
|
||||
_field: "usage_idle",
|
||||
_value: 1.95,
|
||||
},
|
||||
{
|
||||
_time: 2018-05-22T19:53:16Z,
|
||||
_measurement: "cpu",
|
||||
host: "host.local",
|
||||
cpu: "cpu1",
|
||||
_field: "usage_idle",
|
||||
_value: 1.92,
|
||||
},
|
||||
{
|
||||
_time: 2018-05-22T19:53:16Z,
|
||||
_measurement: "cpu",
|
||||
host: "host.local",
|
||||
cpu: "cpu0",
|
||||
_field: "usage_user",
|
||||
_value: 1.95,
|
||||
},
|
||||
{
|
||||
_time: 2018-05-22T19:53:16Z,
|
||||
_measurement: "cpu",
|
||||
host: "host.local",
|
||||
cpu: "cpu1",
|
||||
_field: "usage_user",
|
||||
_value: 1.92,
|
||||
},
|
||||
{
|
||||
_time: 2018-05-22T19:53:16Z,
|
||||
_measurement: "cpu",
|
||||
host: "host.global",
|
||||
cpu: "cpu0",
|
||||
_field: "usage_idle",
|
||||
_value: 1.95,
|
||||
},
|
||||
{
|
||||
_time: 2018-05-22T19:53:16Z,
|
||||
_measurement: "cpu",
|
||||
host: "host.global",
|
||||
cpu: "cpu1",
|
||||
_field: "usage_idle",
|
||||
_value: 1.92,
|
||||
},
|
||||
{
|
||||
_time: 2018-05-22T19:53:16Z,
|
||||
_measurement: "cpu",
|
||||
host: "host.global",
|
||||
cpu: "cpu0",
|
||||
_field: "usage_user",
|
||||
_value: 1.95,
|
||||
},
|
||||
{
|
||||
_time: 2018-05-22T19:53:16Z,
|
||||
_measurement: "cpu",
|
||||
host: "host.global",
|
||||
cpu: "cpu1",
|
||||
_field: "usage_user",
|
||||
_value: 1.92,
|
||||
},
|
||||
],
|
||||
)
|
||||
|> group(columns: ["_measurement", "_field", "host", "cpu"])
|
||||
|
||||
// swap:
|
||||
// tags: host,partition
|
||||
// fields: used_percent
|
||||
swap =
|
||||
array.from(
|
||||
rows: [
|
||||
{
|
||||
_time: 2018-05-22T19:53:16Z,
|
||||
_measurement: "swap",
|
||||
host: "host.local",
|
||||
partition: "/dev/sda1",
|
||||
_field: "used_percent",
|
||||
_value: 66.98,
|
||||
},
|
||||
{
|
||||
_time: 2018-05-22T19:53:16Z,
|
||||
_measurement: "swap",
|
||||
host: "host.local",
|
||||
partition: "/dev/sdb1",
|
||||
_field: "used_percent",
|
||||
_value: 66.98,
|
||||
},
|
||||
{
|
||||
_time: 2018-05-22T19:53:26Z,
|
||||
_measurement: "swap",
|
||||
host: "host.local",
|
||||
partition: "/dev/sda1",
|
||||
_field: "used_percent",
|
||||
_value: 37.59,
|
||||
},
|
||||
{
|
||||
_time: 2018-05-22T19:53:26Z,
|
||||
_measurement: "swap",
|
||||
host: "host.local",
|
||||
partition: "/dev/sdb1",
|
||||
_field: "used_percent",
|
||||
_value: 37.59,
|
||||
},
|
||||
{
|
||||
_time: 2018-05-22T19:53:16Z,
|
||||
_measurement: "swap",
|
||||
host: "host.global",
|
||||
partition: "/dev/sda1",
|
||||
_field: "used_percent",
|
||||
_value: 72.98,
|
||||
},
|
||||
{
|
||||
_time: 2018-05-22T19:53:16Z,
|
||||
_measurement: "swap",
|
||||
host: "host.global",
|
||||
partition: "/dev/sdb1",
|
||||
_field: "used_percent",
|
||||
_value: 72.98,
|
||||
},
|
||||
{
|
||||
_time: 2018-05-22T19:53:26Z,
|
||||
_measurement: "swap",
|
||||
host: "host.global",
|
||||
partition: "/dev/sda1",
|
||||
_field: "used_percent",
|
||||
_value: 88.59,
|
||||
},
|
||||
{
|
||||
_time: 2018-05-22T19:53:26Z,
|
||||
_measurement: "swap",
|
||||
host: "host.global",
|
||||
partition: "/dev/sdb1",
|
||||
_field: "used_percent",
|
||||
_value: 88.59,
|
||||
},
|
||||
],
|
||||
)
|
||||
|> group(columns: ["_measurement", "_field", "host", "partition"])
|
||||
|
||||
option schema._from = (bucket) =>
|
||||
union(
|
||||
tables: [
|
||||
cpu
|
||||
|> debug.opaque(),
|
||||
swap
|
||||
|> debug.opaque(),
|
||||
],
|
||||
)
|
||||
|> testing.load()
|
||||
|
||||
testcase push_down_tagValues extends "flux/influxdata/influxdb/schema/schema_test" {
|
||||
testcase push_down_tagValues extends "flux/influxdata/influxdb/schema/schema_test.tagValues" {
|
||||
expect.planner(rules: ["PushDownReadTagValuesRule": 1])
|
||||
schema_test.tagValues()
|
||||
super()
|
||||
}
|
||||
testcase push_down_measurementTagValues extends "flux/influxdata/influxdb/schema/schema_test" {
|
||||
testcase push_down_measurementTagValues extends "flux/influxdata/influxdb/schema/schema_test.measurementTagValues" {
|
||||
expect.planner(rules: ["PushDownReadTagValuesRule": 1])
|
||||
schema_test.measurementTagValues()
|
||||
super()
|
||||
}
|
||||
testcase push_down_tagKeys extends "flux/influxdata/influxdb/schema/schema_test" {
|
||||
testcase push_down_tagKeys extends "flux/influxdata/influxdb/schema/schema_test.tagKeys" {
|
||||
expect.planner(rules: ["PushDownReadTagKeysRule": 1])
|
||||
schema_test.tagKeys()
|
||||
super()
|
||||
}
|
||||
testcase push_down_measurementTagKeys extends "flux/influxdata/influxdb/schema/schema_test" {
|
||||
testcase push_down_measurementTagKeys extends "flux/influxdata/influxdb/schema/schema_test.measurementTagKeys" {
|
||||
expect.planner(rules: ["PushDownReadTagKeysRule": 1])
|
||||
schema_test.measurementTagKeys()
|
||||
super()
|
||||
}
|
||||
testcase push_down_fieldKeys extends "flux/influxdata/influxdb/schema/schema_test" {
|
||||
testcase push_down_fieldKeys extends "flux/influxdata/influxdb/schema/schema_test.fieldKeys" {
|
||||
expect.planner(rules: ["PushDownReadTagValuesRule": 1])
|
||||
schema_test.fieldKeys()
|
||||
super()
|
||||
}
|
||||
testcase push_down_measurementFieldKeys extends "flux/influxdata/influxdb/schema/schema_test" {
|
||||
testcase push_down_measurementFieldKeys extends "flux/influxdata/influxdb/schema/schema_test.measurementFieldKeys" {
|
||||
expect.planner(rules: ["PushDownReadTagValuesRule": 1])
|
||||
schema_test.measurementFieldKeys()
|
||||
super()
|
||||
}
|
||||
testcase push_down_measurements extends "flux/influxdata/influxdb/schema/schema_test" {
|
||||
testcase push_down_measurements extends "flux/influxdata/influxdb/schema/schema_test.measurements" {
|
||||
expect.planner(rules: ["PushDownReadTagValuesRule": 1])
|
||||
schema_test.measurements()
|
||||
super()
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue