Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var FluxTestPackages = []*ast.Package{&ast.Package{ BaseNode: ast.BaseNode{ Errors: nil, Loc: nil, }, Files: []*ast.File{&ast.File{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 97, Line: 63, }, File: "check_test.flux", Source: "package monitor_test\n\nimport \"influxdata/influxdb/monitor\"\nimport \"influxdata/influxdb/v1\"\nimport \"testing\"\n\noption now = () => 2018-05-22T19:54:20Z\n\noption monitor.write = (tables=<-) => tables |> drop(columns:[\"_start\", \"_stop\"])\n\ninData = \"\n#datatype,string,long,dateTime:RFC3339,double,string,string,string,string\n#group,false,false,false,false,true,true,true,true\n#default,_result,,,,,,,\n,result,table,_time,_value,_field,_measurement,cpu,host\n,,0,2018-05-22T19:53:26Z,91.7364670583823,usage_idle,cpu,cpu-total,host.local\n,,0,2018-05-22T19:53:36Z,89.51118889861233,usage_idle,cpu,cpu-total,host.local\n,,0,2018-05-22T19:53:46Z,4.9,usage_idle,cpu,cpu-total,host.local\n,,0,2018-05-22T19:53:56Z,4.7,usage_idle,cpu,cpu-total,host.local\n,,0,2018-05-22T19:54:06Z,7.0,usage_idle,cpu,cpu-total,host.local\n,,0,2018-05-22T19:54:16Z,7.1,usage_idle,cpu,cpu-total,host.local\n\"\n\noutData = \"\n#datatype,string,long,string,string,string,string,string,string,long,dateTime:RFC3339,string,string,string,string,string,double\n#group,false,false,true,true,true,true,false,true,false,false,true,true,true,true,true,false\n#default,got,,,,,,,,,,,,,,,\n,result,table,_check_id,_check_name,_level,_measurement,_message,_source_measurement,_source_timestamp,_time,_type,aaa,bbb,cpu,host,usage_idle\n,,0,000000000000000a,cpu threshold check,crit,statuses,whoa!,cpu,1527018840000000000,2018-05-22T19:54:20Z,threshold,vaaa,vbbb,cpu-total,host.local,4.800000000000001\n,,1,000000000000000a,cpu threshold check,ok,statuses,whoa!,cpu,1527018820000000000,2018-05-22T19:54:20Z,threshold,vaaa,vbbb,cpu-total,host.local,90.62382797849732\n,,2,000000000000000a,cpu threshold check,warn,statuses,whoa!,cpu,1527018860000000000,2018-05-22T19:54:20Z,threshold,vaaa,vbbb,cpu-total,host.local,7.05\n\"\n\ndata = {\n _check_id: \"000000000000000a\",\n _check_name: \"cpu threshold check\",\n _type: \"threshold\",\n tags: {aaa: \"vaaa\", bbb: \"vbbb\"}\n}\n\ncrit = (r) => (r.usage_idle < 5.0)\nwarn = (r) => (r.usage_idle < 10.0)\ninfo = (r) => (r.usage_idle < 25.0)\n\nmessageFn = (r) => \"whoa!\"\n\nt_check = (table=<-) => table\n |> range(start: -1m)\n |> filter(fn: (r) => r._measurement == \"cpu\")\n |> filter(fn: (r) => r._field == \"usage_idle\")\n |> filter(fn: (r) => r.cpu == \"cpu-total\")\n |> v1.fieldsAsCols() // pivot data so there is a \"usage_idle\" column\n |> aggregateWindow(every: 20s, fn: mean, column: \"usage_idle\")\n |> monitor.check(\n data: data,\n messageFn: messageFn,\n info: info,\n warn: warn,\n crit: crit,\n )\n\ntest monitor_check = () =>\n ({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_check}", Start: ast.Position{ Column: 1, Line: 1, }, }, }, Body: []ast.Statement{&ast.OptionStatement{ Assignment: &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 40, Line: 7, }, File: "check_test.flux", Source: "now = () => 2018-05-22T19:54:20Z", Start: ast.Position{ Column: 8, Line: 7, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 11, Line: 7, }, File: "check_test.flux", Source: "now", Start: ast.Position{ Column: 8, Line: 7, }, }, }, Name: "now", }, Init: &ast.FunctionExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 40, Line: 7, }, File: "check_test.flux", Source: "() => 2018-05-22T19:54:20Z", Start: ast.Position{ Column: 14, Line: 7, }, }, }, Body: &ast.DateTimeLiteral{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 40, Line: 7, }, File: "check_test.flux", Source: "2018-05-22T19:54:20Z", Start: ast.Position{ Column: 20, Line: 7, }, }, }, Value: parser.MustParseTime("2018-05-22T19:54:20Z"), }, Params: nil, }, }, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 40, Line: 7, }, File: "check_test.flux", Source: "option now = () => 2018-05-22T19:54:20Z", Start: ast.Position{ Column: 1, Line: 7, }, }, }, }, &ast.OptionStatement{ Assignment: &ast.MemberAssignment{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 82, Line: 9, }, File: "check_test.flux", Source: "monitor.write = (tables=<-) => tables |> drop(columns:[\"_start\", \"_stop\"])", Start: ast.Position{ Column: 8, Line: 9, }, }, }, Init: &ast.FunctionExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 82, Line: 9, }, File: "check_test.flux", Source: "(tables=<-) => tables |> drop(columns:[\"_start\", \"_stop\"])", Start: ast.Position{ Column: 24, Line: 9, }, }, }, Body: &ast.PipeExpression{ Argument: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 45, Line: 9, }, File: "check_test.flux", Source: "tables", Start: ast.Position{ Column: 39, Line: 9, }, }, }, Name: "tables", }, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 82, Line: 9, }, File: "check_test.flux", Source: "tables |> drop(columns:[\"_start\", \"_stop\"])", Start: ast.Position{ Column: 39, Line: 9, }, }, }, Call: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 81, Line: 9, }, File: "check_test.flux", Source: "columns:[\"_start\", \"_stop\"]", Start: ast.Position{ Column: 54, Line: 9, }, }, }, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 81, Line: 9, }, File: "check_test.flux", Source: "columns:[\"_start\", \"_stop\"]", Start: ast.Position{ Column: 54, Line: 9, }, }, }, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 61, Line: 9, }, File: "check_test.flux", Source: "columns", Start: ast.Position{ Column: 54, Line: 9, }, }, }, Name: "columns", }, Value: &ast.ArrayExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 81, Line: 9, }, File: "check_test.flux", Source: "[\"_start\", \"_stop\"]", Start: ast.Position{ Column: 62, Line: 9, }, }, }, Elements: []ast.Expression{&ast.StringLiteral{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 71, Line: 9, }, File: "check_test.flux", Source: "\"_start\"", Start: ast.Position{ Column: 63, Line: 9, }, }, }, Value: "_start", }, &ast.StringLiteral{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 80, Line: 9, }, File: "check_test.flux", Source: "\"_stop\"", Start: ast.Position{ Column: 73, Line: 9, }, }, }, Value: "_stop", }}, }, }}, With: nil, }}, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 82, Line: 9, }, File: "check_test.flux", Source: "drop(columns:[\"_start\", \"_stop\"])", Start: ast.Position{ Column: 49, Line: 9, }, }, }, Callee: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 53, Line: 9, }, File: "check_test.flux", Source: "drop", Start: ast.Position{ Column: 49, Line: 9, }, }, }, Name: "drop", }, }, }, Params: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 34, Line: 9, }, File: "check_test.flux", Source: "tables=<-", Start: ast.Position{ Column: 25, Line: 9, }, }, }, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 31, Line: 9, }, File: "check_test.flux", Source: "tables", Start: ast.Position{ Column: 25, Line: 9, }, }, }, Name: "tables", }, Value: &ast.PipeLiteral{BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 34, Line: 9, }, File: "check_test.flux", Source: "<-", Start: ast.Position{ Column: 32, Line: 9, }, }, }}, }}, }, Member: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 21, Line: 9, }, File: "check_test.flux", Source: "monitor.write", Start: ast.Position{ Column: 8, Line: 9, }, }, }, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 15, Line: 9, }, File: "check_test.flux", Source: "monitor", Start: ast.Position{ Column: 8, Line: 9, }, }, }, Name: "monitor", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 21, Line: 9, }, File: "check_test.flux", Source: "write", Start: ast.Position{ Column: 16, Line: 9, }, }, }, Name: "write", }, }, }, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 82, Line: 9, }, File: "check_test.flux", Source: "option monitor.write = (tables=<-) => tables |> drop(columns:[\"_start\", \"_stop\"])", Start: ast.Position{ Column: 1, Line: 9, }, }, }, }, &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 2, Line: 22, }, File: "check_test.flux", Source: "inData = \"\n#datatype,string,long,dateTime:RFC3339,double,string,string,string,string\n#group,false,false,false,false,true,true,true,true\n#default,_result,,,,,,,\n,result,table,_time,_value,_field,_measurement,cpu,host\n,,0,2018-05-22T19:53:26Z,91.7364670583823,usage_idle,cpu,cpu-total,host.local\n,,0,2018-05-22T19:53:36Z,89.51118889861233,usage_idle,cpu,cpu-total,host.local\n,,0,2018-05-22T19:53:46Z,4.9,usage_idle,cpu,cpu-total,host.local\n,,0,2018-05-22T19:53:56Z,4.7,usage_idle,cpu,cpu-total,host.local\n,,0,2018-05-22T19:54:06Z,7.0,usage_idle,cpu,cpu-total,host.local\n,,0,2018-05-22T19:54:16Z,7.1,usage_idle,cpu,cpu-total,host.local\n\"", Start: ast.Position{ Column: 1, Line: 11, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 7, Line: 11, }, File: "check_test.flux", Source: "inData", Start: ast.Position{ Column: 1, Line: 11, }, }, }, Name: "inData", }, Init: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 2, Line: 22, }, File: "check_test.flux", Source: "\"\n#datatype,string,long,dateTime:RFC3339,double,string,string,string,string\n#group,false,false,false,false,true,true,true,true\n#default,_result,,,,,,,\n,result,table,_time,_value,_field,_measurement,cpu,host\n,,0,2018-05-22T19:53:26Z,91.7364670583823,usage_idle,cpu,cpu-total,host.local\n,,0,2018-05-22T19:53:36Z,89.51118889861233,usage_idle,cpu,cpu-total,host.local\n,,0,2018-05-22T19:53:46Z,4.9,usage_idle,cpu,cpu-total,host.local\n,,0,2018-05-22T19:53:56Z,4.7,usage_idle,cpu,cpu-total,host.local\n,,0,2018-05-22T19:54:06Z,7.0,usage_idle,cpu,cpu-total,host.local\n,,0,2018-05-22T19:54:16Z,7.1,usage_idle,cpu,cpu-total,host.local\n\"", Start: ast.Position{ Column: 10, Line: 11, }, }, }, Value: "\n#datatype,string,long,dateTime:RFC3339,double,string,string,string,string\n#group,false,false,false,false,true,true,true,true\n#default,_result,,,,,,,\n,result,table,_time,_value,_field,_measurement,cpu,host\n,,0,2018-05-22T19:53:26Z,91.7364670583823,usage_idle,cpu,cpu-total,host.local\n,,0,2018-05-22T19:53:36Z,89.51118889861233,usage_idle,cpu,cpu-total,host.local\n,,0,2018-05-22T19:53:46Z,4.9,usage_idle,cpu,cpu-total,host.local\n,,0,2018-05-22T19:53:56Z,4.7,usage_idle,cpu,cpu-total,host.local\n,,0,2018-05-22T19:54:06Z,7.0,usage_idle,cpu,cpu-total,host.local\n,,0,2018-05-22T19:54:16Z,7.1,usage_idle,cpu,cpu-total,host.local\n", }, }, &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 2, Line: 32, }, File: "check_test.flux", Source: "outData = \"\n#datatype,string,long,string,string,string,string,string,string,long,dateTime:RFC3339,string,string,string,string,string,double\n#group,false,false,true,true,true,true,false,true,false,false,true,true,true,true,true,false\n#default,got,,,,,,,,,,,,,,,\n,result,table,_check_id,_check_name,_level,_measurement,_message,_source_measurement,_source_timestamp,_time,_type,aaa,bbb,cpu,host,usage_idle\n,,0,000000000000000a,cpu threshold check,crit,statuses,whoa!,cpu,1527018840000000000,2018-05-22T19:54:20Z,threshold,vaaa,vbbb,cpu-total,host.local,4.800000000000001\n,,1,000000000000000a,cpu threshold check,ok,statuses,whoa!,cpu,1527018820000000000,2018-05-22T19:54:20Z,threshold,vaaa,vbbb,cpu-total,host.local,90.62382797849732\n,,2,000000000000000a,cpu threshold check,warn,statuses,whoa!,cpu,1527018860000000000,2018-05-22T19:54:20Z,threshold,vaaa,vbbb,cpu-total,host.local,7.05\n\"", Start: ast.Position{ Column: 1, Line: 24, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 8, Line: 24, }, File: "check_test.flux", Source: "outData", Start: ast.Position{ Column: 1, Line: 24, }, }, }, Name: "outData", }, Init: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 2, Line: 32, }, File: "check_test.flux", Source: "\"\n#datatype,string,long,string,string,string,string,string,string,long,dateTime:RFC3339,string,string,string,string,string,double\n#group,false,false,true,true,true,true,false,true,false,false,true,true,true,true,true,false\n#default,got,,,,,,,,,,,,,,,\n,result,table,_check_id,_check_name,_level,_measurement,_message,_source_measurement,_source_timestamp,_time,_type,aaa,bbb,cpu,host,usage_idle\n,,0,000000000000000a,cpu threshold check,crit,statuses,whoa!,cpu,1527018840000000000,2018-05-22T19:54:20Z,threshold,vaaa,vbbb,cpu-total,host.local,4.800000000000001\n,,1,000000000000000a,cpu threshold check,ok,statuses,whoa!,cpu,1527018820000000000,2018-05-22T19:54:20Z,threshold,vaaa,vbbb,cpu-total,host.local,90.62382797849732\n,,2,000000000000000a,cpu threshold check,warn,statuses,whoa!,cpu,1527018860000000000,2018-05-22T19:54:20Z,threshold,vaaa,vbbb,cpu-total,host.local,7.05\n\"", Start: ast.Position{ Column: 11, Line: 24, }, }, }, Value: "\n#datatype,string,long,string,string,string,string,string,string,long,dateTime:RFC3339,string,string,string,string,string,double\n#group,false,false,true,true,true,true,false,true,false,false,true,true,true,true,true,false\n#default,got,,,,,,,,,,,,,,,\n,result,table,_check_id,_check_name,_level,_measurement,_message,_source_measurement,_source_timestamp,_time,_type,aaa,bbb,cpu,host,usage_idle\n,,0,000000000000000a,cpu threshold check,crit,statuses,whoa!,cpu,1527018840000000000,2018-05-22T19:54:20Z,threshold,vaaa,vbbb,cpu-total,host.local,4.800000000000001\n,,1,000000000000000a,cpu threshold check,ok,statuses,whoa!,cpu,1527018820000000000,2018-05-22T19:54:20Z,threshold,vaaa,vbbb,cpu-total,host.local,90.62382797849732\n,,2,000000000000000a,cpu threshold check,warn,statuses,whoa!,cpu,1527018860000000000,2018-05-22T19:54:20Z,threshold,vaaa,vbbb,cpu-total,host.local,7.05\n", }, }, &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 2, Line: 39, }, File: "check_test.flux", Source: "data = {\n _check_id: \"000000000000000a\",\n _check_name: \"cpu threshold check\",\n _type: \"threshold\",\n tags: {aaa: \"vaaa\", bbb: \"vbbb\"}\n}", Start: ast.Position{ Column: 1, Line: 34, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 5, Line: 34, }, File: "check_test.flux", Source: "data", Start: ast.Position{ Column: 1, Line: 34, }, }, }, Name: "data", }, Init: &ast.ObjectExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 2, Line: 39, }, File: "check_test.flux", Source: "{\n _check_id: \"000000000000000a\",\n _check_name: \"cpu threshold check\",\n _type: \"threshold\",\n tags: {aaa: \"vaaa\", bbb: \"vbbb\"}\n}", Start: ast.Position{ Column: 8, Line: 34, }, }, }, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 34, Line: 35, }, File: "check_test.flux", Source: "_check_id: \"000000000000000a\"", Start: ast.Position{ Column: 5, Line: 35, }, }, }, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 14, Line: 35, }, File: "check_test.flux", Source: "_check_id", Start: ast.Position{ Column: 5, Line: 35, }, }, }, Name: "_check_id", }, Value: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 34, Line: 35, }, File: "check_test.flux", Source: "\"000000000000000a\"", Start: ast.Position{ Column: 16, Line: 35, }, }, }, Value: "000000000000000a", }, }, &ast.Property{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 39, Line: 36, }, File: "check_test.flux", Source: "_check_name: \"cpu threshold check\"", Start: ast.Position{ Column: 5, Line: 36, }, }, }, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 16, Line: 36, }, File: "check_test.flux", Source: "_check_name", Start: ast.Position{ Column: 5, Line: 36, }, }, }, Name: "_check_name", }, Value: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 39, Line: 36, }, File: "check_test.flux", Source: "\"cpu threshold check\"", Start: ast.Position{ Column: 18, Line: 36, }, }, }, Value: "cpu threshold check", }, }, &ast.Property{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 23, Line: 37, }, File: "check_test.flux", Source: "_type: \"threshold\"", Start: ast.Position{ Column: 5, Line: 37, }, }, }, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 10, Line: 37, }, File: "check_test.flux", Source: "_type", Start: ast.Position{ Column: 5, Line: 37, }, }, }, Name: "_type", }, Value: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 23, Line: 37, }, File: "check_test.flux", Source: "\"threshold\"", Start: ast.Position{ Column: 12, Line: 37, }, }, }, Value: "threshold", }, }, &ast.Property{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 37, Line: 38, }, File: "check_test.flux", Source: "tags: {aaa: \"vaaa\", bbb: \"vbbb\"}", Start: ast.Position{ Column: 5, Line: 38, }, }, }, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 9, Line: 38, }, File: "check_test.flux", Source: "tags", Start: ast.Position{ Column: 5, Line: 38, }, }, }, Name: "tags", }, Value: &ast.ObjectExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 37, Line: 38, }, File: "check_test.flux", Source: "{aaa: \"vaaa\", bbb: \"vbbb\"}", Start: ast.Position{ Column: 11, Line: 38, }, }, }, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 23, Line: 38, }, File: "check_test.flux", Source: "aaa: \"vaaa\"", Start: ast.Position{ Column: 12, Line: 38, }, }, }, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 15, Line: 38, }, File: "check_test.flux", Source: "aaa", Start: ast.Position{ Column: 12, Line: 38, }, }, }, Name: "aaa", }, Value: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 23, Line: 38, }, File: "check_test.flux", Source: "\"vaaa\"", Start: ast.Position{ Column: 17, Line: 38, }, }, }, Value: "vaaa", }, }, &ast.Property{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 36, Line: 38, }, File: "check_test.flux", Source: "bbb: \"vbbb\"", Start: ast.Position{ Column: 25, Line: 38, }, }, }, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 28, Line: 38, }, File: "check_test.flux", Source: "bbb", Start: ast.Position{ Column: 25, Line: 38, }, }, }, Name: "bbb", }, Value: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 36, Line: 38, }, File: "check_test.flux", Source: "\"vbbb\"", Start: ast.Position{ Column: 30, Line: 38, }, }, }, Value: "vbbb", }, }}, With: nil, }, }}, With: nil, }, }, &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 34, Line: 41, }, File: "check_test.flux", Source: "crit = (r) => (r.usage_idle < 5.0", Start: ast.Position{ Column: 1, Line: 41, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 5, Line: 41, }, File: "check_test.flux", Source: "crit", Start: ast.Position{ Column: 1, Line: 41, }, }, }, Name: "crit", }, Init: &ast.FunctionExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 34, Line: 41, }, File: "check_test.flux", Source: "(r) => (r.usage_idle < 5.0", Start: ast.Position{ Column: 8, Line: 41, }, }, }, Body: &ast.BinaryExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 34, Line: 41, }, File: "check_test.flux", Source: "r.usage_idle < 5.0", Start: ast.Position{ Column: 16, Line: 41, }, }, }, Left: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 28, Line: 41, }, File: "check_test.flux", Source: "r.usage_idle", Start: ast.Position{ Column: 16, Line: 41, }, }, }, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 17, Line: 41, }, File: "check_test.flux", Source: "r", Start: ast.Position{ Column: 16, Line: 41, }, }, }, Name: "r", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 28, Line: 41, }, File: "check_test.flux", Source: "usage_idle", Start: ast.Position{ Column: 18, Line: 41, }, }, }, Name: "usage_idle", }, }, Operator: 8, Right: &ast.FloatLiteral{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 34, Line: 41, }, File: "check_test.flux", Source: "5.0", Start: ast.Position{ Column: 31, Line: 41, }, }, }, Value: 5.0, }, }, Params: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 10, Line: 41, }, File: "check_test.flux", Source: "r", Start: ast.Position{ Column: 9, Line: 41, }, }, }, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 10, Line: 41, }, File: "check_test.flux", Source: "r", Start: ast.Position{ Column: 9, Line: 41, }, }, }, Name: "r", }, Value: nil, }}, }, }, &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 35, Line: 42, }, File: "check_test.flux", Source: "warn = (r) => (r.usage_idle < 10.0", Start: ast.Position{ Column: 1, Line: 42, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 5, Line: 42, }, File: "check_test.flux", Source: "warn", Start: ast.Position{ Column: 1, Line: 42, }, }, }, Name: "warn", }, Init: &ast.FunctionExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 35, Line: 42, }, File: "check_test.flux", Source: "(r) => (r.usage_idle < 10.0", Start: ast.Position{ Column: 8, Line: 42, }, }, }, Body: &ast.BinaryExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 35, Line: 42, }, File: "check_test.flux", Source: "r.usage_idle < 10.0", Start: ast.Position{ Column: 16, Line: 42, }, }, }, Left: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 28, Line: 42, }, File: "check_test.flux", Source: "r.usage_idle", Start: ast.Position{ Column: 16, Line: 42, }, }, }, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 17, Line: 42, }, File: "check_test.flux", Source: "r", Start: ast.Position{ Column: 16, Line: 42, }, }, }, Name: "r", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 28, Line: 42, }, File: "check_test.flux", Source: "usage_idle", Start: ast.Position{ Column: 18, Line: 42, }, }, }, Name: "usage_idle", }, }, Operator: 8, Right: &ast.FloatLiteral{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 35, Line: 42, }, File: "check_test.flux", Source: "10.0", Start: ast.Position{ Column: 31, Line: 42, }, }, }, Value: 10.0, }, }, Params: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 10, Line: 42, }, File: "check_test.flux", Source: "r", Start: ast.Position{ Column: 9, Line: 42, }, }, }, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 10, Line: 42, }, File: "check_test.flux", Source: "r", Start: ast.Position{ Column: 9, Line: 42, }, }, }, Name: "r", }, Value: nil, }}, }, }, &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 35, Line: 43, }, File: "check_test.flux", Source: "info = (r) => (r.usage_idle < 25.0", Start: ast.Position{ Column: 1, Line: 43, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 5, Line: 43, }, File: "check_test.flux", Source: "info", Start: ast.Position{ Column: 1, Line: 43, }, }, }, Name: "info", }, Init: &ast.FunctionExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 35, Line: 43, }, File: "check_test.flux", Source: "(r) => (r.usage_idle < 25.0", Start: ast.Position{ Column: 8, Line: 43, }, }, }, Body: &ast.BinaryExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 35, Line: 43, }, File: "check_test.flux", Source: "r.usage_idle < 25.0", Start: ast.Position{ Column: 16, Line: 43, }, }, }, Left: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 28, Line: 43, }, File: "check_test.flux", Source: "r.usage_idle", Start: ast.Position{ Column: 16, Line: 43, }, }, }, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 17, Line: 43, }, File: "check_test.flux", Source: "r", Start: ast.Position{ Column: 16, Line: 43, }, }, }, Name: "r", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 28, Line: 43, }, File: "check_test.flux", Source: "usage_idle", Start: ast.Position{ Column: 18, Line: 43, }, }, }, Name: "usage_idle", }, }, Operator: 8, Right: &ast.FloatLiteral{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 35, Line: 43, }, File: "check_test.flux", Source: "25.0", Start: ast.Position{ Column: 31, Line: 43, }, }, }, Value: 25.0, }, }, Params: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 10, Line: 43, }, File: "check_test.flux", Source: "r", Start: ast.Position{ Column: 9, Line: 43, }, }, }, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 10, Line: 43, }, File: "check_test.flux", Source: "r", Start: ast.Position{ Column: 9, Line: 43, }, }, }, Name: "r", }, Value: nil, }}, }, }, &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 27, Line: 45, }, File: "check_test.flux", Source: "messageFn = (r) => \"whoa!\"", Start: ast.Position{ Column: 1, Line: 45, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 10, Line: 45, }, File: "check_test.flux", Source: "messageFn", Start: ast.Position{ Column: 1, Line: 45, }, }, }, Name: "messageFn", }, Init: &ast.FunctionExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 27, Line: 45, }, File: "check_test.flux", Source: "(r) => \"whoa!\"", Start: ast.Position{ Column: 13, Line: 45, }, }, }, Body: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 27, Line: 45, }, File: "check_test.flux", Source: "\"whoa!\"", Start: ast.Position{ Column: 20, Line: 45, }, }, }, Value: "whoa!", }, Params: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 15, Line: 45, }, File: "check_test.flux", Source: "r", Start: ast.Position{ Column: 14, Line: 45, }, }, }, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 15, Line: 45, }, File: "check_test.flux", Source: "r", Start: ast.Position{ Column: 14, Line: 45, }, }, }, Name: "r", }, Value: nil, }}, }, }, &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 6, Line: 60, }, File: "check_test.flux", Source: "t_check = (table=<-) => table\n |> range(start: -1m)\n |> filter(fn: (r) => r._measurement == \"cpu\")\n |> filter(fn: (r) => r._field == \"usage_idle\")\n |> filter(fn: (r) => r.cpu == \"cpu-total\")\n |> v1.fieldsAsCols() // pivot data so there is a \"usage_idle\" column\n |> aggregateWindow(every: 20s, fn: mean, column: \"usage_idle\")\n |> monitor.check(\n data: data,\n messageFn: messageFn,\n info: info,\n warn: warn,\n crit: crit,\n )", Start: ast.Position{ Column: 1, Line: 47, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 8, Line: 47, }, File: "check_test.flux", Source: "t_check", Start: ast.Position{ Column: 1, Line: 47, }, }, }, Name: "t_check", }, Init: &ast.FunctionExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 6, Line: 60, }, File: "check_test.flux", Source: "(table=<-) => table\n |> range(start: -1m)\n |> filter(fn: (r) => r._measurement == \"cpu\")\n |> filter(fn: (r) => r._field == \"usage_idle\")\n |> filter(fn: (r) => r.cpu == \"cpu-total\")\n |> v1.fieldsAsCols() // pivot data so there is a \"usage_idle\" column\n |> aggregateWindow(every: 20s, fn: mean, column: \"usage_idle\")\n |> monitor.check(\n data: data,\n messageFn: messageFn,\n info: info,\n warn: warn,\n crit: crit,\n )", Start: ast.Position{ Column: 11, Line: 47, }, }, }, Body: &ast.PipeExpression{ Argument: &ast.PipeExpression{ Argument: &ast.PipeExpression{ Argument: &ast.PipeExpression{ Argument: &ast.PipeExpression{ Argument: &ast.PipeExpression{ Argument: &ast.PipeExpression{ Argument: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 30, Line: 47, }, File: "check_test.flux", Source: "table", Start: ast.Position{ Column: 25, Line: 47, }, }, }, Name: "table", }, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 25, Line: 48, }, File: "check_test.flux", Source: "table\n |> range(start: -1m)", Start: ast.Position{ Column: 25, Line: 47, }, }, }, Call: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 24, Line: 48, }, File: "check_test.flux", Source: "start: -1m", Start: ast.Position{ Column: 14, Line: 48, }, }, }, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 24, Line: 48, }, File: "check_test.flux", Source: "start: -1m", Start: ast.Position{ Column: 14, Line: 48, }, }, }, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 19, Line: 48, }, File: "check_test.flux", Source: "start", Start: ast.Position{ Column: 14, Line: 48, }, }, }, Name: "start", }, Value: &ast.UnaryExpression{ Argument: &ast.DurationLiteral{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 24, Line: 48, }, File: "check_test.flux", Source: "1m", Start: ast.Position{ Column: 22, Line: 48, }, }, }, Values: []ast.Duration{ast.Duration{ Magnitude: int64(1), Unit: "m", }}, }, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 24, Line: 48, }, File: "check_test.flux", Source: "-1m", Start: ast.Position{ Column: 21, Line: 48, }, }, }, Operator: 6, }, }}, With: nil, }}, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 25, Line: 48, }, File: "check_test.flux", Source: "range(start: -1m)", Start: ast.Position{ Column: 8, Line: 48, }, }, }, Callee: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 13, Line: 48, }, File: "check_test.flux", Source: "range", Start: ast.Position{ Column: 8, Line: 48, }, }, }, Name: "range", }, }, }, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 50, Line: 49, }, File: "check_test.flux", Source: "table\n |> range(start: -1m)\n |> filter(fn: (r) => r._measurement == \"cpu\")", Start: ast.Position{ Column: 25, Line: 47, }, }, }, Call: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 49, Line: 49, }, File: "check_test.flux", Source: "fn: (r) => r._measurement == \"cpu\"", Start: ast.Position{ Column: 15, Line: 49, }, }, }, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 49, Line: 49, }, File: "check_test.flux", Source: "fn: (r) => r._measurement == \"cpu\"", Start: ast.Position{ Column: 15, Line: 49, }, }, }, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 17, Line: 49, }, File: "check_test.flux", Source: "fn", Start: ast.Position{ Column: 15, Line: 49, }, }, }, Name: "fn", }, Value: &ast.FunctionExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 49, Line: 49, }, File: "check_test.flux", Source: "(r) => r._measurement == \"cpu\"", Start: ast.Position{ Column: 19, Line: 49, }, }, }, Body: &ast.BinaryExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 49, Line: 49, }, File: "check_test.flux", Source: "r._measurement == \"cpu\"", Start: ast.Position{ Column: 26, Line: 49, }, }, }, Left: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 40, Line: 49, }, File: "check_test.flux", Source: "r._measurement", Start: ast.Position{ Column: 26, Line: 49, }, }, }, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 27, Line: 49, }, File: "check_test.flux", Source: "r", Start: ast.Position{ Column: 26, Line: 49, }, }, }, Name: "r", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 40, Line: 49, }, File: "check_test.flux", Source: "_measurement", Start: ast.Position{ Column: 28, Line: 49, }, }, }, Name: "_measurement", }, }, Operator: 17, Right: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 49, Line: 49, }, File: "check_test.flux", Source: "\"cpu\"", Start: ast.Position{ Column: 44, Line: 49, }, }, }, Value: "cpu", }, }, Params: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 21, Line: 49, }, File: "check_test.flux", Source: "r", Start: ast.Position{ Column: 20, Line: 49, }, }, }, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 21, Line: 49, }, File: "check_test.flux", Source: "r", Start: ast.Position{ Column: 20, Line: 49, }, }, }, Name: "r", }, Value: nil, }}, }, }}, With: nil, }}, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 50, Line: 49, }, File: "check_test.flux", Source: "filter(fn: (r) => r._measurement == \"cpu\")", Start: ast.Position{ Column: 8, Line: 49, }, }, }, Callee: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 14, Line: 49, }, File: "check_test.flux", Source: "filter", Start: ast.Position{ Column: 8, Line: 49, }, }, }, Name: "filter", }, }, }, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 51, Line: 50, }, File: "check_test.flux", Source: "table\n |> range(start: -1m)\n |> filter(fn: (r) => r._measurement == \"cpu\")\n |> filter(fn: (r) => r._field == \"usage_idle\")", Start: ast.Position{ Column: 25, Line: 47, }, }, }, Call: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 50, Line: 50, }, File: "check_test.flux", Source: "fn: (r) => r._field == \"usage_idle\"", Start: ast.Position{ Column: 15, Line: 50, }, }, }, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 50, Line: 50, }, File: "check_test.flux", Source: "fn: (r) => r._field == \"usage_idle\"", Start: ast.Position{ Column: 15, Line: 50, }, }, }, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 17, Line: 50, }, File: "check_test.flux", Source: "fn", Start: ast.Position{ Column: 15, Line: 50, }, }, }, Name: "fn", }, Value: &ast.FunctionExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 50, Line: 50, }, File: "check_test.flux", Source: "(r) => r._field == \"usage_idle\"", Start: ast.Position{ Column: 19, Line: 50, }, }, }, Body: &ast.BinaryExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 50, Line: 50, }, File: "check_test.flux", Source: "r._field == \"usage_idle\"", Start: ast.Position{ Column: 26, Line: 50, }, }, }, Left: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 34, Line: 50, }, File: "check_test.flux", Source: "r._field", Start: ast.Position{ Column: 26, Line: 50, }, }, }, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 27, Line: 50, }, File: "check_test.flux", Source: "r", Start: ast.Position{ Column: 26, Line: 50, }, }, }, Name: "r", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 34, Line: 50, }, File: "check_test.flux", Source: "_field", Start: ast.Position{ Column: 28, Line: 50, }, }, }, Name: "_field", }, }, Operator: 17, Right: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 50, Line: 50, }, File: "check_test.flux", Source: "\"usage_idle\"", Start: ast.Position{ Column: 38, Line: 50, }, }, }, Value: "usage_idle", }, }, Params: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 21, Line: 50, }, File: "check_test.flux", Source: "r", Start: ast.Position{ Column: 20, Line: 50, }, }, }, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 21, Line: 50, }, File: "check_test.flux", Source: "r", Start: ast.Position{ Column: 20, Line: 50, }, }, }, Name: "r", }, Value: nil, }}, }, }}, With: nil, }}, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 51, Line: 50, }, File: "check_test.flux", Source: "filter(fn: (r) => r._field == \"usage_idle\")", Start: ast.Position{ Column: 8, Line: 50, }, }, }, Callee: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 14, Line: 50, }, File: "check_test.flux", Source: "filter", Start: ast.Position{ Column: 8, Line: 50, }, }, }, Name: "filter", }, }, }, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 47, Line: 51, }, File: "check_test.flux", Source: "table\n |> range(start: -1m)\n |> filter(fn: (r) => r._measurement == \"cpu\")\n |> filter(fn: (r) => r._field == \"usage_idle\")\n |> filter(fn: (r) => r.cpu == \"cpu-total\")", Start: ast.Position{ Column: 25, Line: 47, }, }, }, Call: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 46, Line: 51, }, File: "check_test.flux", Source: "fn: (r) => r.cpu == \"cpu-total\"", Start: ast.Position{ Column: 15, Line: 51, }, }, }, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 46, Line: 51, }, File: "check_test.flux", Source: "fn: (r) => r.cpu == \"cpu-total\"", Start: ast.Position{ Column: 15, Line: 51, }, }, }, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 17, Line: 51, }, File: "check_test.flux", Source: "fn", Start: ast.Position{ Column: 15, Line: 51, }, }, }, Name: "fn", }, Value: &ast.FunctionExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 46, Line: 51, }, File: "check_test.flux", Source: "(r) => r.cpu == \"cpu-total\"", Start: ast.Position{ Column: 19, Line: 51, }, }, }, Body: &ast.BinaryExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 46, Line: 51, }, File: "check_test.flux", Source: "r.cpu == \"cpu-total\"", Start: ast.Position{ Column: 26, Line: 51, }, }, }, Left: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 31, Line: 51, }, File: "check_test.flux", Source: "r.cpu", Start: ast.Position{ Column: 26, Line: 51, }, }, }, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 27, Line: 51, }, File: "check_test.flux", Source: "r", Start: ast.Position{ Column: 26, Line: 51, }, }, }, Name: "r", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 31, Line: 51, }, File: "check_test.flux", Source: "cpu", Start: ast.Position{ Column: 28, Line: 51, }, }, }, Name: "cpu", }, }, Operator: 17, Right: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 46, Line: 51, }, File: "check_test.flux", Source: "\"cpu-total\"", Start: ast.Position{ Column: 35, Line: 51, }, }, }, Value: "cpu-total", }, }, Params: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 21, Line: 51, }, File: "check_test.flux", Source: "r", Start: ast.Position{ Column: 20, Line: 51, }, }, }, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 21, Line: 51, }, File: "check_test.flux", Source: "r", Start: ast.Position{ Column: 20, Line: 51, }, }, }, Name: "r", }, Value: nil, }}, }, }}, With: nil, }}, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 47, Line: 51, }, File: "check_test.flux", Source: "filter(fn: (r) => r.cpu == \"cpu-total\")", Start: ast.Position{ Column: 8, Line: 51, }, }, }, Callee: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 14, Line: 51, }, File: "check_test.flux", Source: "filter", Start: ast.Position{ Column: 8, Line: 51, }, }, }, Name: "filter", }, }, }, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 25, Line: 52, }, File: "check_test.flux", Source: "table\n |> range(start: -1m)\n |> filter(fn: (r) => r._measurement == \"cpu\")\n |> filter(fn: (r) => r._field == \"usage_idle\")\n |> filter(fn: (r) => r.cpu == \"cpu-total\")\n |> v1.fieldsAsCols()", Start: ast.Position{ Column: 25, Line: 47, }, }, }, Call: &ast.CallExpression{ Arguments: nil, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 25, Line: 52, }, File: "check_test.flux", Source: "v1.fieldsAsCols()", Start: ast.Position{ Column: 8, Line: 52, }, }, }, Callee: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 23, Line: 52, }, File: "check_test.flux", Source: "v1.fieldsAsCols", Start: ast.Position{ Column: 8, Line: 52, }, }, }, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 10, Line: 52, }, File: "check_test.flux", Source: "v1", Start: ast.Position{ Column: 8, Line: 52, }, }, }, Name: "v1", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 23, Line: 52, }, File: "check_test.flux", Source: "fieldsAsCols", Start: ast.Position{ Column: 11, Line: 52, }, }, }, Name: "fieldsAsCols", }, }, }, }, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 67, Line: 53, }, File: "check_test.flux", Source: "table\n |> range(start: -1m)\n |> filter(fn: (r) => r._measurement == \"cpu\")\n |> filter(fn: (r) => r._field == \"usage_idle\")\n |> filter(fn: (r) => r.cpu == \"cpu-total\")\n |> v1.fieldsAsCols() // pivot data so there is a \"usage_idle\" column\n |> aggregateWindow(every: 20s, fn: mean, column: \"usage_idle\")", Start: ast.Position{ Column: 25, Line: 47, }, }, }, Call: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 66, Line: 53, }, File: "check_test.flux", Source: "every: 20s, fn: mean, column: \"usage_idle\"", Start: ast.Position{ Column: 24, Line: 53, }, }, }, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 34, Line: 53, }, File: "check_test.flux", Source: "every: 20s", Start: ast.Position{ Column: 24, Line: 53, }, }, }, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 29, Line: 53, }, File: "check_test.flux", Source: "every", Start: ast.Position{ Column: 24, Line: 53, }, }, }, Name: "every", }, Value: &ast.DurationLiteral{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 34, Line: 53, }, File: "check_test.flux", Source: "20s", Start: ast.Position{ Column: 31, Line: 53, }, }, }, Values: []ast.Duration{ast.Duration{ Magnitude: int64(20), Unit: "s", }}, }, }, &ast.Property{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 44, Line: 53, }, File: "check_test.flux", Source: "fn: mean", Start: ast.Position{ Column: 36, Line: 53, }, }, }, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 38, Line: 53, }, File: "check_test.flux", Source: "fn", Start: ast.Position{ Column: 36, Line: 53, }, }, }, Name: "fn", }, Value: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 44, Line: 53, }, File: "check_test.flux", Source: "mean", Start: ast.Position{ Column: 40, Line: 53, }, }, }, Name: "mean", }, }, &ast.Property{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 66, Line: 53, }, File: "check_test.flux", Source: "column: \"usage_idle\"", Start: ast.Position{ Column: 46, Line: 53, }, }, }, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 52, Line: 53, }, File: "check_test.flux", Source: "column", Start: ast.Position{ Column: 46, Line: 53, }, }, }, Name: "column", }, Value: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 66, Line: 53, }, File: "check_test.flux", Source: "\"usage_idle\"", Start: ast.Position{ Column: 54, Line: 53, }, }, }, Value: "usage_idle", }, }}, With: nil, }}, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 67, Line: 53, }, File: "check_test.flux", Source: "aggregateWindow(every: 20s, fn: mean, column: \"usage_idle\")", Start: ast.Position{ Column: 8, Line: 53, }, }, }, Callee: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 23, Line: 53, }, File: "check_test.flux", Source: "aggregateWindow", Start: ast.Position{ Column: 8, Line: 53, }, }, }, Name: "aggregateWindow", }, }, }, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 6, Line: 60, }, File: "check_test.flux", Source: "table\n |> range(start: -1m)\n |> filter(fn: (r) => r._measurement == \"cpu\")\n |> filter(fn: (r) => r._field == \"usage_idle\")\n |> filter(fn: (r) => r.cpu == \"cpu-total\")\n |> v1.fieldsAsCols() // pivot data so there is a \"usage_idle\" column\n |> aggregateWindow(every: 20s, fn: mean, column: \"usage_idle\")\n |> monitor.check(\n data: data,\n messageFn: messageFn,\n info: info,\n warn: warn,\n crit: crit,\n )", Start: ast.Position{ Column: 25, Line: 47, }, }, }, Call: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 19, Line: 59, }, File: "check_test.flux", Source: "data: data,\n messageFn: messageFn,\n info: info,\n warn: warn,\n crit: crit", Start: ast.Position{ Column: 9, Line: 55, }, }, }, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 19, Line: 55, }, File: "check_test.flux", Source: "data: data", Start: ast.Position{ Column: 9, Line: 55, }, }, }, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 13, Line: 55, }, File: "check_test.flux", Source: "data", Start: ast.Position{ Column: 9, Line: 55, }, }, }, Name: "data", }, Value: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 19, Line: 55, }, File: "check_test.flux", Source: "data", Start: ast.Position{ Column: 15, Line: 55, }, }, }, Name: "data", }, }, &ast.Property{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 29, Line: 56, }, File: "check_test.flux", Source: "messageFn: messageFn", Start: ast.Position{ Column: 9, Line: 56, }, }, }, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 18, Line: 56, }, File: "check_test.flux", Source: "messageFn", Start: ast.Position{ Column: 9, Line: 56, }, }, }, Name: "messageFn", }, Value: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 29, Line: 56, }, File: "check_test.flux", Source: "messageFn", Start: ast.Position{ Column: 20, Line: 56, }, }, }, Name: "messageFn", }, }, &ast.Property{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 19, Line: 57, }, File: "check_test.flux", Source: "info: info", Start: ast.Position{ Column: 9, Line: 57, }, }, }, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 13, Line: 57, }, File: "check_test.flux", Source: "info", Start: ast.Position{ Column: 9, Line: 57, }, }, }, Name: "info", }, Value: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 19, Line: 57, }, File: "check_test.flux", Source: "info", Start: ast.Position{ Column: 15, Line: 57, }, }, }, Name: "info", }, }, &ast.Property{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 19, Line: 58, }, File: "check_test.flux", Source: "warn: warn", Start: ast.Position{ Column: 9, Line: 58, }, }, }, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 13, Line: 58, }, File: "check_test.flux", Source: "warn", Start: ast.Position{ Column: 9, Line: 58, }, }, }, Name: "warn", }, Value: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 19, Line: 58, }, File: "check_test.flux", Source: "warn", Start: ast.Position{ Column: 15, Line: 58, }, }, }, Name: "warn", }, }, &ast.Property{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 19, Line: 59, }, File: "check_test.flux", Source: "crit: crit", Start: ast.Position{ Column: 9, Line: 59, }, }, }, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 13, Line: 59, }, File: "check_test.flux", Source: "crit", Start: ast.Position{ Column: 9, Line: 59, }, }, }, Name: "crit", }, Value: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 19, Line: 59, }, File: "check_test.flux", Source: "crit", Start: ast.Position{ Column: 15, Line: 59, }, }, }, Name: "crit", }, }}, With: nil, }}, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 6, Line: 60, }, File: "check_test.flux", Source: "monitor.check(\n data: data,\n messageFn: messageFn,\n info: info,\n warn: warn,\n crit: crit,\n )", Start: ast.Position{ Column: 8, Line: 54, }, }, }, Callee: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 21, Line: 54, }, File: "check_test.flux", Source: "monitor.check", Start: ast.Position{ Column: 8, Line: 54, }, }, }, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 15, Line: 54, }, File: "check_test.flux", Source: "monitor", Start: ast.Position{ Column: 8, Line: 54, }, }, }, Name: "monitor", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 21, Line: 54, }, File: "check_test.flux", Source: "check", Start: ast.Position{ Column: 16, Line: 54, }, }, }, Name: "check", }, }, }, }, Params: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 20, Line: 47, }, File: "check_test.flux", Source: "table=<-", Start: ast.Position{ Column: 12, Line: 47, }, }, }, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 17, Line: 47, }, File: "check_test.flux", Source: "table", Start: ast.Position{ Column: 12, Line: 47, }, }, }, Name: "table", }, Value: &ast.PipeLiteral{BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 20, Line: 47, }, File: "check_test.flux", Source: "<-", Start: ast.Position{ Column: 18, Line: 47, }, }, }}, }}, }, }, &ast.TestStatement{ Assignment: &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 97, Line: 63, }, File: "check_test.flux", Source: "monitor_check = () =>\n ({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_check}", Start: ast.Position{ Column: 6, Line: 62, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 19, Line: 62, }, File: "check_test.flux", Source: "monitor_check", Start: ast.Position{ Column: 6, Line: 62, }, }, }, Name: "monitor_check", }, Init: &ast.FunctionExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 97, Line: 63, }, File: "check_test.flux", Source: "() =>\n ({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_check}", Start: ast.Position{ Column: 22, Line: 62, }, }, }, Body: &ast.ObjectExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 97, Line: 63, }, File: "check_test.flux", Source: "{input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_check}", Start: ast.Position{ Column: 6, Line: 63, }, }, }, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 46, Line: 63, }, File: "check_test.flux", Source: "input: testing.loadStorage(csv: inData)", Start: ast.Position{ Column: 7, Line: 63, }, }, }, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 12, Line: 63, }, File: "check_test.flux", Source: "input", Start: ast.Position{ Column: 7, Line: 63, }, }, }, Name: "input", }, Value: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 45, Line: 63, }, File: "check_test.flux", Source: "csv: inData", Start: ast.Position{ Column: 34, Line: 63, }, }, }, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 45, Line: 63, }, File: "check_test.flux", Source: "csv: inData", Start: ast.Position{ Column: 34, Line: 63, }, }, }, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 37, Line: 63, }, File: "check_test.flux", Source: "csv", Start: ast.Position{ Column: 34, Line: 63, }, }, }, Name: "csv", }, Value: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 45, Line: 63, }, File: "check_test.flux", Source: "inData", Start: ast.Position{ Column: 39, Line: 63, }, }, }, Name: "inData", }, }}, With: nil, }}, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 46, Line: 63, }, File: "check_test.flux", Source: "testing.loadStorage(csv: inData)", Start: ast.Position{ Column: 14, Line: 63, }, }, }, Callee: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 33, Line: 63, }, File: "check_test.flux", Source: "testing.loadStorage", Start: ast.Position{ Column: 14, Line: 63, }, }, }, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 21, Line: 63, }, File: "check_test.flux", Source: "testing", Start: ast.Position{ Column: 14, Line: 63, }, }, }, Name: "testing", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 33, Line: 63, }, File: "check_test.flux", Source: "loadStorage", Start: ast.Position{ Column: 22, Line: 63, }, }, }, Name: "loadStorage", }, }, }, }, &ast.Property{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 83, Line: 63, }, File: "check_test.flux", Source: "want: testing.loadMem(csv: outData)", Start: ast.Position{ Column: 48, Line: 63, }, }, }, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 52, Line: 63, }, File: "check_test.flux", Source: "want", Start: ast.Position{ Column: 48, Line: 63, }, }, }, Name: "want", }, Value: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 82, Line: 63, }, File: "check_test.flux", Source: "csv: outData", Start: ast.Position{ Column: 70, Line: 63, }, }, }, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 82, Line: 63, }, File: "check_test.flux", Source: "csv: outData", Start: ast.Position{ Column: 70, Line: 63, }, }, }, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 73, Line: 63, }, File: "check_test.flux", Source: "csv", Start: ast.Position{ Column: 70, Line: 63, }, }, }, Name: "csv", }, Value: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 82, Line: 63, }, File: "check_test.flux", Source: "outData", Start: ast.Position{ Column: 75, Line: 63, }, }, }, Name: "outData", }, }}, With: nil, }}, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 83, Line: 63, }, File: "check_test.flux", Source: "testing.loadMem(csv: outData)", Start: ast.Position{ Column: 54, Line: 63, }, }, }, Callee: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 69, Line: 63, }, File: "check_test.flux", Source: "testing.loadMem", Start: ast.Position{ Column: 54, Line: 63, }, }, }, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 61, Line: 63, }, File: "check_test.flux", Source: "testing", Start: ast.Position{ Column: 54, Line: 63, }, }, }, Name: "testing", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 69, Line: 63, }, File: "check_test.flux", Source: "loadMem", Start: ast.Position{ Column: 62, Line: 63, }, }, }, Name: "loadMem", }, }, }, }, &ast.Property{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 96, Line: 63, }, File: "check_test.flux", Source: "fn: t_check", Start: ast.Position{ Column: 85, Line: 63, }, }, }, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 87, Line: 63, }, File: "check_test.flux", Source: "fn", Start: ast.Position{ Column: 85, Line: 63, }, }, }, Name: "fn", }, Value: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 96, Line: 63, }, File: "check_test.flux", Source: "t_check", Start: ast.Position{ Column: 89, Line: 63, }, }, }, Name: "t_check", }, }}, With: nil, }, Params: nil, }, }, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 97, Line: 63, }, File: "check_test.flux", Source: "test monitor_check = () =>\n ({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_check}", Start: ast.Position{ Column: 1, Line: 62, }, }, }, }}, Imports: []*ast.ImportDeclaration{&ast.ImportDeclaration{ As: nil, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 37, Line: 3, }, File: "check_test.flux", Source: "import \"influxdata/influxdb/monitor\"", Start: ast.Position{ Column: 1, Line: 3, }, }, }, Path: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 37, Line: 3, }, File: "check_test.flux", Source: "\"influxdata/influxdb/monitor\"", Start: ast.Position{ Column: 8, Line: 3, }, }, }, Value: "influxdata/influxdb/monitor", }, }, &ast.ImportDeclaration{ As: nil, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 32, Line: 4, }, File: "check_test.flux", Source: "import \"influxdata/influxdb/v1\"", Start: ast.Position{ Column: 1, Line: 4, }, }, }, Path: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 32, Line: 4, }, File: "check_test.flux", Source: "\"influxdata/influxdb/v1\"", Start: ast.Position{ Column: 8, Line: 4, }, }, }, Value: "influxdata/influxdb/v1", }, }, &ast.ImportDeclaration{ As: nil, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 17, Line: 5, }, File: "check_test.flux", Source: "import \"testing\"", Start: ast.Position{ Column: 1, Line: 5, }, }, }, Path: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 17, Line: 5, }, File: "check_test.flux", Source: "\"testing\"", Start: ast.Position{ Column: 8, Line: 5, }, }, }, Value: "testing", }, }}, Name: "check_test.flux", Package: &ast.PackageClause{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 21, Line: 1, }, File: "check_test.flux", Source: "package monitor_test", Start: ast.Position{ Column: 1, Line: 1, }, }, }, Name: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 21, Line: 1, }, File: "check_test.flux", Source: "monitor_test", Start: ast.Position{ Column: 9, Line: 1, }, }, }, Name: "main", }, }, }}, Package: "main", Path: "", }, &ast.Package{ BaseNode: ast.BaseNode{ Errors: nil, Loc: nil, }, Files: []*ast.File{&ast.File{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 100, Line: 52, }, File: "deadman_add_test.flux", Source: "package monitor_test\n\nimport \"influxdata/influxdb/monitor\"\nimport \"testing\"\nimport \"experimental\"\n\noption now = () => 2018-05-22T20:00:00Z\n\ninData = \"\n#datatype,string,long,dateTime:RFC3339,long,string,string\n#group,false,false,false,false,true,true\n#default,_result,,,,,\n,result,table,_time,_value,_field,_measurement\n,,0,2018-05-22T19:30:00Z,11,A,cpu\n,,0,2018-05-22T18:30:00Z,11,A,cpu\n,,0,2018-05-22T17:30:00Z,11,A,cpu\n,,0,2018-05-22T16:30:00Z,11,A,cpu\n,,0,2018-05-22T15:30:00Z,11,A,cpu\n,,1,2018-05-22T15:30:00Z,11,B,cpu\n,,1,2018-05-22T16:30:00Z,11,B,cpu\n,,1,2018-05-22T17:30:00Z,11,B,cpu\n,,1,2018-05-22T18:30:00Z,11,B,cpu\n,,1,2018-05-22T19:30:00Z,11,B,cpu\n,,2,2018-05-22T18:30:00Z,11,C,cpu\n,,2,2018-05-22T14:30:00Z,11,C,cpu\n,,2,2018-05-22T17:30:00Z,11,C,cpu\n,,2,2018-05-22T15:30:00Z,11,C,cpu\n,,2,2018-05-22T16:30:00Z,11,C,cpu\n,,3,2018-05-22T18:30:00Z,11,D,cpu\n,,3,2018-05-22T15:30:00Z,11,D,cpu\n,,3,2018-05-22T19:30:00Z,11,D,cpu\n,,3,2018-05-22T16:30:00Z,11,D,cpu\n,,3,2018-05-22T17:30:00Z,11,D,cpu\n\"\n\noutData = \"\n#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,dateTime:RFC3339,long,string,string,boolean\n#group,false,false,true,true,false,false,true,true,false\n#default,_result,,,,,,,,\n,result,table,_start,_stop,_time,_value,_field,_measurement,dead\n,,0,2018-05-22T15:00:00Z,2018-05-22T20:00:00Z,2018-05-22T19:30:00Z,11,A,cpu,false\n,,1,2018-05-22T15:00:00Z,2018-05-22T20:00:00Z,2018-05-22T19:30:00Z,11,B,cpu,false\n,,2,2018-05-22T15:00:00Z,2018-05-22T20:00:00Z,2018-05-22T18:30:00Z,11,C,cpu,true\n,,3,2018-05-22T15:00:00Z,2018-05-22T20:00:00Z,2018-05-22T19:30:00Z,11,D,cpu,false\n\"\n\nt_deadman_add = (table=<-) => table\n |> range(start: -5h)\n |> monitor.deadman(t: experimental.addDuration(d: -1h, to: now()))\n\ntest deadman_add = () =>\n\t({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_deadman_add}", Start: ast.Position{ Column: 1, Line: 1, }, }, }, Body: []ast.Statement{&ast.OptionStatement{ Assignment: &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 40, Line: 7, }, File: "deadman_add_test.flux", Source: "now = () => 2018-05-22T20:00:00Z", Start: ast.Position{ Column: 8, Line: 7, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 11, Line: 7, }, File: "deadman_add_test.flux", Source: "now", Start: ast.Position{ Column: 8, Line: 7, }, }, }, Name: "now", }, Init: &ast.FunctionExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 40, Line: 7, }, File: "deadman_add_test.flux", Source: "() => 2018-05-22T20:00:00Z", Start: ast.Position{ Column: 14, Line: 7, }, }, }, Body: &ast.DateTimeLiteral{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 40, Line: 7, }, File: "deadman_add_test.flux", Source: "2018-05-22T20:00:00Z", Start: ast.Position{ Column: 20, Line: 7, }, }, }, Value: parser.MustParseTime("2018-05-22T20:00:00Z"), }, Params: nil, }, }, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 40, Line: 7, }, File: "deadman_add_test.flux", Source: "option now = () => 2018-05-22T20:00:00Z", Start: ast.Position{ Column: 1, Line: 7, }, }, }, }, &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 2, Line: 34, }, File: "deadman_add_test.flux", Source: "inData = \"\n#datatype,string,long,dateTime:RFC3339,long,string,string\n#group,false,false,false,false,true,true\n#default,_result,,,,,\n,result,table,_time,_value,_field,_measurement\n,,0,2018-05-22T19:30:00Z,11,A,cpu\n,,0,2018-05-22T18:30:00Z,11,A,cpu\n,,0,2018-05-22T17:30:00Z,11,A,cpu\n,,0,2018-05-22T16:30:00Z,11,A,cpu\n,,0,2018-05-22T15:30:00Z,11,A,cpu\n,,1,2018-05-22T15:30:00Z,11,B,cpu\n,,1,2018-05-22T16:30:00Z,11,B,cpu\n,,1,2018-05-22T17:30:00Z,11,B,cpu\n,,1,2018-05-22T18:30:00Z,11,B,cpu\n,,1,2018-05-22T19:30:00Z,11,B,cpu\n,,2,2018-05-22T18:30:00Z,11,C,cpu\n,,2,2018-05-22T14:30:00Z,11,C,cpu\n,,2,2018-05-22T17:30:00Z,11,C,cpu\n,,2,2018-05-22T15:30:00Z,11,C,cpu\n,,2,2018-05-22T16:30:00Z,11,C,cpu\n,,3,2018-05-22T18:30:00Z,11,D,cpu\n,,3,2018-05-22T15:30:00Z,11,D,cpu\n,,3,2018-05-22T19:30:00Z,11,D,cpu\n,,3,2018-05-22T16:30:00Z,11,D,cpu\n,,3,2018-05-22T17:30:00Z,11,D,cpu\n\"", Start: ast.Position{ Column: 1, Line: 9, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 7, Line: 9, }, File: "deadman_add_test.flux", Source: "inData", Start: ast.Position{ Column: 1, Line: 9, }, }, }, Name: "inData", }, Init: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 2, Line: 34, }, File: "deadman_add_test.flux", Source: "\"\n#datatype,string,long,dateTime:RFC3339,long,string,string\n#group,false,false,false,false,true,true\n#default,_result,,,,,\n,result,table,_time,_value,_field,_measurement\n,,0,2018-05-22T19:30:00Z,11,A,cpu\n,,0,2018-05-22T18:30:00Z,11,A,cpu\n,,0,2018-05-22T17:30:00Z,11,A,cpu\n,,0,2018-05-22T16:30:00Z,11,A,cpu\n,,0,2018-05-22T15:30:00Z,11,A,cpu\n,,1,2018-05-22T15:30:00Z,11,B,cpu\n,,1,2018-05-22T16:30:00Z,11,B,cpu\n,,1,2018-05-22T17:30:00Z,11,B,cpu\n,,1,2018-05-22T18:30:00Z,11,B,cpu\n,,1,2018-05-22T19:30:00Z,11,B,cpu\n,,2,2018-05-22T18:30:00Z,11,C,cpu\n,,2,2018-05-22T14:30:00Z,11,C,cpu\n,,2,2018-05-22T17:30:00Z,11,C,cpu\n,,2,2018-05-22T15:30:00Z,11,C,cpu\n,,2,2018-05-22T16:30:00Z,11,C,cpu\n,,3,2018-05-22T18:30:00Z,11,D,cpu\n,,3,2018-05-22T15:30:00Z,11,D,cpu\n,,3,2018-05-22T19:30:00Z,11,D,cpu\n,,3,2018-05-22T16:30:00Z,11,D,cpu\n,,3,2018-05-22T17:30:00Z,11,D,cpu\n\"", Start: ast.Position{ Column: 10, Line: 9, }, }, }, Value: "\n#datatype,string,long,dateTime:RFC3339,long,string,string\n#group,false,false,false,false,true,true\n#default,_result,,,,,\n,result,table,_time,_value,_field,_measurement\n,,0,2018-05-22T19:30:00Z,11,A,cpu\n,,0,2018-05-22T18:30:00Z,11,A,cpu\n,,0,2018-05-22T17:30:00Z,11,A,cpu\n,,0,2018-05-22T16:30:00Z,11,A,cpu\n,,0,2018-05-22T15:30:00Z,11,A,cpu\n,,1,2018-05-22T15:30:00Z,11,B,cpu\n,,1,2018-05-22T16:30:00Z,11,B,cpu\n,,1,2018-05-22T17:30:00Z,11,B,cpu\n,,1,2018-05-22T18:30:00Z,11,B,cpu\n,,1,2018-05-22T19:30:00Z,11,B,cpu\n,,2,2018-05-22T18:30:00Z,11,C,cpu\n,,2,2018-05-22T14:30:00Z,11,C,cpu\n,,2,2018-05-22T17:30:00Z,11,C,cpu\n,,2,2018-05-22T15:30:00Z,11,C,cpu\n,,2,2018-05-22T16:30:00Z,11,C,cpu\n,,3,2018-05-22T18:30:00Z,11,D,cpu\n,,3,2018-05-22T15:30:00Z,11,D,cpu\n,,3,2018-05-22T19:30:00Z,11,D,cpu\n,,3,2018-05-22T16:30:00Z,11,D,cpu\n,,3,2018-05-22T17:30:00Z,11,D,cpu\n", }, }, &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 2, Line: 45, }, File: "deadman_add_test.flux", Source: "outData = \"\n#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,dateTime:RFC3339,long,string,string,boolean\n#group,false,false,true,true,false,false,true,true,false\n#default,_result,,,,,,,,\n,result,table,_start,_stop,_time,_value,_field,_measurement,dead\n,,0,2018-05-22T15:00:00Z,2018-05-22T20:00:00Z,2018-05-22T19:30:00Z,11,A,cpu,false\n,,1,2018-05-22T15:00:00Z,2018-05-22T20:00:00Z,2018-05-22T19:30:00Z,11,B,cpu,false\n,,2,2018-05-22T15:00:00Z,2018-05-22T20:00:00Z,2018-05-22T18:30:00Z,11,C,cpu,true\n,,3,2018-05-22T15:00:00Z,2018-05-22T20:00:00Z,2018-05-22T19:30:00Z,11,D,cpu,false\n\"", Start: ast.Position{ Column: 1, Line: 36, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 8, Line: 36, }, File: "deadman_add_test.flux", Source: "outData", Start: ast.Position{ Column: 1, Line: 36, }, }, }, Name: "outData", }, Init: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 2, Line: 45, }, File: "deadman_add_test.flux", Source: "\"\n#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,dateTime:RFC3339,long,string,string,boolean\n#group,false,false,true,true,false,false,true,true,false\n#default,_result,,,,,,,,\n,result,table,_start,_stop,_time,_value,_field,_measurement,dead\n,,0,2018-05-22T15:00:00Z,2018-05-22T20:00:00Z,2018-05-22T19:30:00Z,11,A,cpu,false\n,,1,2018-05-22T15:00:00Z,2018-05-22T20:00:00Z,2018-05-22T19:30:00Z,11,B,cpu,false\n,,2,2018-05-22T15:00:00Z,2018-05-22T20:00:00Z,2018-05-22T18:30:00Z,11,C,cpu,true\n,,3,2018-05-22T15:00:00Z,2018-05-22T20:00:00Z,2018-05-22T19:30:00Z,11,D,cpu,false\n\"", Start: ast.Position{ Column: 11, Line: 36, }, }, }, Value: "\n#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,dateTime:RFC3339,long,string,string,boolean\n#group,false,false,true,true,false,false,true,true,false\n#default,_result,,,,,,,,\n,result,table,_start,_stop,_time,_value,_field,_measurement,dead\n,,0,2018-05-22T15:00:00Z,2018-05-22T20:00:00Z,2018-05-22T19:30:00Z,11,A,cpu,false\n,,1,2018-05-22T15:00:00Z,2018-05-22T20:00:00Z,2018-05-22T19:30:00Z,11,B,cpu,false\n,,2,2018-05-22T15:00:00Z,2018-05-22T20:00:00Z,2018-05-22T18:30:00Z,11,C,cpu,true\n,,3,2018-05-22T15:00:00Z,2018-05-22T20:00:00Z,2018-05-22T19:30:00Z,11,D,cpu,false\n", }, }, &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 71, Line: 49, }, File: "deadman_add_test.flux", Source: "t_deadman_add = (table=<-) => table\n |> range(start: -5h)\n |> monitor.deadman(t: experimental.addDuration(d: -1h, to: now()))", Start: ast.Position{ Column: 1, Line: 47, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 14, Line: 47, }, File: "deadman_add_test.flux", Source: "t_deadman_add", Start: ast.Position{ Column: 1, Line: 47, }, }, }, Name: "t_deadman_add", }, Init: &ast.FunctionExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 71, Line: 49, }, File: "deadman_add_test.flux", Source: "(table=<-) => table\n |> range(start: -5h)\n |> monitor.deadman(t: experimental.addDuration(d: -1h, to: now()))", Start: ast.Position{ Column: 17, Line: 47, }, }, }, Body: &ast.PipeExpression{ Argument: &ast.PipeExpression{ Argument: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 36, Line: 47, }, File: "deadman_add_test.flux", Source: "table", Start: ast.Position{ Column: 31, Line: 47, }, }, }, Name: "table", }, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 25, Line: 48, }, File: "deadman_add_test.flux", Source: "table\n |> range(start: -5h)", Start: ast.Position{ Column: 31, Line: 47, }, }, }, Call: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 24, Line: 48, }, File: "deadman_add_test.flux", Source: "start: -5h", Start: ast.Position{ Column: 14, Line: 48, }, }, }, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 24, Line: 48, }, File: "deadman_add_test.flux", Source: "start: -5h", Start: ast.Position{ Column: 14, Line: 48, }, }, }, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 19, Line: 48, }, File: "deadman_add_test.flux", Source: "start", Start: ast.Position{ Column: 14, Line: 48, }, }, }, Name: "start", }, Value: &ast.UnaryExpression{ Argument: &ast.DurationLiteral{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 24, Line: 48, }, File: "deadman_add_test.flux", Source: "5h", Start: ast.Position{ Column: 22, Line: 48, }, }, }, Values: []ast.Duration{ast.Duration{ Magnitude: int64(5), Unit: "h", }}, }, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 24, Line: 48, }, File: "deadman_add_test.flux", Source: "-5h", Start: ast.Position{ Column: 21, Line: 48, }, }, }, Operator: 6, }, }}, With: nil, }}, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 25, Line: 48, }, File: "deadman_add_test.flux", Source: "range(start: -5h)", Start: ast.Position{ Column: 8, Line: 48, }, }, }, Callee: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 13, Line: 48, }, File: "deadman_add_test.flux", Source: "range", Start: ast.Position{ Column: 8, Line: 48, }, }, }, Name: "range", }, }, }, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 71, Line: 49, }, File: "deadman_add_test.flux", Source: "table\n |> range(start: -5h)\n |> monitor.deadman(t: experimental.addDuration(d: -1h, to: now()))", Start: ast.Position{ Column: 31, Line: 47, }, }, }, Call: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 70, Line: 49, }, File: "deadman_add_test.flux", Source: "t: experimental.addDuration(d: -1h, to: now())", Start: ast.Position{ Column: 24, Line: 49, }, }, }, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 70, Line: 49, }, File: "deadman_add_test.flux", Source: "t: experimental.addDuration(d: -1h, to: now())", Start: ast.Position{ Column: 24, Line: 49, }, }, }, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 25, Line: 49, }, File: "deadman_add_test.flux", Source: "t", Start: ast.Position{ Column: 24, Line: 49, }, }, }, Name: "t", }, Value: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 69, Line: 49, }, File: "deadman_add_test.flux", Source: "d: -1h, to: now()", Start: ast.Position{ Column: 52, Line: 49, }, }, }, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 58, Line: 49, }, File: "deadman_add_test.flux", Source: "d: -1h", Start: ast.Position{ Column: 52, Line: 49, }, }, }, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 53, Line: 49, }, File: "deadman_add_test.flux", Source: "d", Start: ast.Position{ Column: 52, Line: 49, }, }, }, Name: "d", }, Value: &ast.UnaryExpression{ Argument: &ast.DurationLiteral{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 58, Line: 49, }, File: "deadman_add_test.flux", Source: "1h", Start: ast.Position{ Column: 56, Line: 49, }, }, }, Values: []ast.Duration{ast.Duration{ Magnitude: int64(1), Unit: "h", }}, }, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 58, Line: 49, }, File: "deadman_add_test.flux", Source: "-1h", Start: ast.Position{ Column: 55, Line: 49, }, }, }, Operator: 6, }, }, &ast.Property{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 69, Line: 49, }, File: "deadman_add_test.flux", Source: "to: now()", Start: ast.Position{ Column: 60, Line: 49, }, }, }, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 62, Line: 49, }, File: "deadman_add_test.flux", Source: "to", Start: ast.Position{ Column: 60, Line: 49, }, }, }, Name: "to", }, Value: &ast.CallExpression{ Arguments: nil, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 69, Line: 49, }, File: "deadman_add_test.flux", Source: "now()", Start: ast.Position{ Column: 64, Line: 49, }, }, }, Callee: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 67, Line: 49, }, File: "deadman_add_test.flux", Source: "now", Start: ast.Position{ Column: 64, Line: 49, }, }, }, Name: "now", }, }, }}, With: nil, }}, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 70, Line: 49, }, File: "deadman_add_test.flux", Source: "experimental.addDuration(d: -1h, to: now())", Start: ast.Position{ Column: 27, Line: 49, }, }, }, Callee: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 51, Line: 49, }, File: "deadman_add_test.flux", Source: "experimental.addDuration", Start: ast.Position{ Column: 27, Line: 49, }, }, }, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 39, Line: 49, }, File: "deadman_add_test.flux", Source: "experimental", Start: ast.Position{ Column: 27, Line: 49, }, }, }, Name: "experimental", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 51, Line: 49, }, File: "deadman_add_test.flux", Source: "addDuration", Start: ast.Position{ Column: 40, Line: 49, }, }, }, Name: "addDuration", }, }, }, }}, With: nil, }}, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 71, Line: 49, }, File: "deadman_add_test.flux", Source: "monitor.deadman(t: experimental.addDuration(d: -1h, to: now()))", Start: ast.Position{ Column: 8, Line: 49, }, }, }, Callee: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 23, Line: 49, }, File: "deadman_add_test.flux", Source: "monitor.deadman", Start: ast.Position{ Column: 8, Line: 49, }, }, }, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 15, Line: 49, }, File: "deadman_add_test.flux", Source: "monitor", Start: ast.Position{ Column: 8, Line: 49, }, }, }, Name: "monitor", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 23, Line: 49, }, File: "deadman_add_test.flux", Source: "deadman", Start: ast.Position{ Column: 16, Line: 49, }, }, }, Name: "deadman", }, }, }, }, Params: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 26, Line: 47, }, File: "deadman_add_test.flux", Source: "table=<-", Start: ast.Position{ Column: 18, Line: 47, }, }, }, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 23, Line: 47, }, File: "deadman_add_test.flux", Source: "table", Start: ast.Position{ Column: 18, Line: 47, }, }, }, Name: "table", }, Value: &ast.PipeLiteral{BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 26, Line: 47, }, File: "deadman_add_test.flux", Source: "<-", Start: ast.Position{ Column: 24, Line: 47, }, }, }}, }}, }, }, &ast.TestStatement{ Assignment: &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 100, Line: 52, }, File: "deadman_add_test.flux", Source: "deadman_add = () =>\n\t({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_deadman_add}", Start: ast.Position{ Column: 6, Line: 51, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 17, Line: 51, }, File: "deadman_add_test.flux", Source: "deadman_add", Start: ast.Position{ Column: 6, Line: 51, }, }, }, Name: "deadman_add", }, Init: &ast.FunctionExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 100, Line: 52, }, File: "deadman_add_test.flux", Source: "() =>\n\t({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_deadman_add}", Start: ast.Position{ Column: 20, Line: 51, }, }, }, Body: &ast.ObjectExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 100, Line: 52, }, File: "deadman_add_test.flux", Source: "{input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_deadman_add}", Start: ast.Position{ Column: 3, Line: 52, }, }, }, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 43, Line: 52, }, File: "deadman_add_test.flux", Source: "input: testing.loadStorage(csv: inData)", Start: ast.Position{ Column: 4, Line: 52, }, }, }, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 9, Line: 52, }, File: "deadman_add_test.flux", Source: "input", Start: ast.Position{ Column: 4, Line: 52, }, }, }, Name: "input", }, Value: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 52, }, File: "deadman_add_test.flux", Source: "csv: inData", Start: ast.Position{ Column: 31, Line: 52, }, }, }, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 52, }, File: "deadman_add_test.flux", Source: "csv: inData", Start: ast.Position{ Column: 31, Line: 52, }, }, }, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 34, Line: 52, }, File: "deadman_add_test.flux", Source: "csv", Start: ast.Position{ Column: 31, Line: 52, }, }, }, Name: "csv", }, Value: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 52, }, File: "deadman_add_test.flux", Source: "inData", Start: ast.Position{ Column: 36, Line: 52, }, }, }, Name: "inData", }, }}, With: nil, }}, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 43, Line: 52, }, File: "deadman_add_test.flux", Source: "testing.loadStorage(csv: inData)", Start: ast.Position{ Column: 11, Line: 52, }, }, }, Callee: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 30, Line: 52, }, File: "deadman_add_test.flux", Source: "testing.loadStorage", Start: ast.Position{ Column: 11, Line: 52, }, }, }, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 18, Line: 52, }, File: "deadman_add_test.flux", Source: "testing", Start: ast.Position{ Column: 11, Line: 52, }, }, }, Name: "testing", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 30, Line: 52, }, File: "deadman_add_test.flux", Source: "loadStorage", Start: ast.Position{ Column: 19, Line: 52, }, }, }, Name: "loadStorage", }, }, }, }, &ast.Property{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 80, Line: 52, }, File: "deadman_add_test.flux", Source: "want: testing.loadMem(csv: outData)", Start: ast.Position{ Column: 45, Line: 52, }, }, }, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 49, Line: 52, }, File: "deadman_add_test.flux", Source: "want", Start: ast.Position{ Column: 45, Line: 52, }, }, }, Name: "want", }, Value: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 79, Line: 52, }, File: "deadman_add_test.flux", Source: "csv: outData", Start: ast.Position{ Column: 67, Line: 52, }, }, }, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 79, Line: 52, }, File: "deadman_add_test.flux", Source: "csv: outData", Start: ast.Position{ Column: 67, Line: 52, }, }, }, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 70, Line: 52, }, File: "deadman_add_test.flux", Source: "csv", Start: ast.Position{ Column: 67, Line: 52, }, }, }, Name: "csv", }, Value: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 79, Line: 52, }, File: "deadman_add_test.flux", Source: "outData", Start: ast.Position{ Column: 72, Line: 52, }, }, }, Name: "outData", }, }}, With: nil, }}, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 80, Line: 52, }, File: "deadman_add_test.flux", Source: "testing.loadMem(csv: outData)", Start: ast.Position{ Column: 51, Line: 52, }, }, }, Callee: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 66, Line: 52, }, File: "deadman_add_test.flux", Source: "testing.loadMem", Start: ast.Position{ Column: 51, Line: 52, }, }, }, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 58, Line: 52, }, File: "deadman_add_test.flux", Source: "testing", Start: ast.Position{ Column: 51, Line: 52, }, }, }, Name: "testing", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 66, Line: 52, }, File: "deadman_add_test.flux", Source: "loadMem", Start: ast.Position{ Column: 59, Line: 52, }, }, }, Name: "loadMem", }, }, }, }, &ast.Property{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 99, Line: 52, }, File: "deadman_add_test.flux", Source: "fn: t_deadman_add", Start: ast.Position{ Column: 82, Line: 52, }, }, }, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 84, Line: 52, }, File: "deadman_add_test.flux", Source: "fn", Start: ast.Position{ Column: 82, Line: 52, }, }, }, Name: "fn", }, Value: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 99, Line: 52, }, File: "deadman_add_test.flux", Source: "t_deadman_add", Start: ast.Position{ Column: 86, Line: 52, }, }, }, Name: "t_deadman_add", }, }}, With: nil, }, Params: nil, }, }, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 100, Line: 52, }, File: "deadman_add_test.flux", Source: "test deadman_add = () =>\n\t({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_deadman_add}", Start: ast.Position{ Column: 1, Line: 51, }, }, }, }}, Imports: []*ast.ImportDeclaration{&ast.ImportDeclaration{ As: nil, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 37, Line: 3, }, File: "deadman_add_test.flux", Source: "import \"influxdata/influxdb/monitor\"", Start: ast.Position{ Column: 1, Line: 3, }, }, }, Path: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 37, Line: 3, }, File: "deadman_add_test.flux", Source: "\"influxdata/influxdb/monitor\"", Start: ast.Position{ Column: 8, Line: 3, }, }, }, Value: "influxdata/influxdb/monitor", }, }, &ast.ImportDeclaration{ As: nil, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 17, Line: 4, }, File: "deadman_add_test.flux", Source: "import \"testing\"", Start: ast.Position{ Column: 1, Line: 4, }, }, }, Path: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 17, Line: 4, }, File: "deadman_add_test.flux", Source: "\"testing\"", Start: ast.Position{ Column: 8, Line: 4, }, }, }, Value: "testing", }, }, &ast.ImportDeclaration{ As: nil, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 22, Line: 5, }, File: "deadman_add_test.flux", Source: "import \"experimental\"", Start: ast.Position{ Column: 1, Line: 5, }, }, }, Path: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 22, Line: 5, }, File: "deadman_add_test.flux", Source: "\"experimental\"", Start: ast.Position{ Column: 8, Line: 5, }, }, }, Value: "experimental", }, }}, Name: "deadman_add_test.flux", Package: &ast.PackageClause{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 21, Line: 1, }, File: "deadman_add_test.flux", Source: "package monitor_test", Start: ast.Position{ Column: 1, Line: 1, }, }, }, Name: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 21, Line: 1, }, File: "deadman_add_test.flux", Source: "monitor_test", Start: ast.Position{ Column: 9, Line: 1, }, }, }, Name: "main", }, }, }}, Package: "main", Path: "", }, &ast.Package{ BaseNode: ast.BaseNode{ Errors: nil, Loc: nil, }, Files: []*ast.File{&ast.File{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 100, Line: 52, }, File: "deadman_sub_test.flux", Source: "package monitor_test\n\nimport \"influxdata/influxdb/monitor\"\nimport \"testing\"\nimport \"experimental\"\n\noption now = () => 2018-05-22T20:00:00Z\n\ninData = \"\n#datatype,string,long,dateTime:RFC3339,long,string,string\n#group,false,false,false,false,true,true\n#default,_result,,,,,\n,result,table,_time,_value,_field,_measurement\n,,0,2018-05-22T19:30:00Z,11,A,cpu\n,,0,2018-05-22T18:30:00Z,11,A,cpu\n,,0,2018-05-22T17:30:00Z,11,A,cpu\n,,0,2018-05-22T16:30:00Z,11,A,cpu\n,,0,2018-05-22T15:30:00Z,11,A,cpu\n,,1,2018-05-22T15:30:00Z,11,B,cpu\n,,1,2018-05-22T16:30:00Z,11,B,cpu\n,,1,2018-05-22T17:30:00Z,11,B,cpu\n,,1,2018-05-22T18:30:00Z,11,B,cpu\n,,1,2018-05-22T19:30:00Z,11,B,cpu\n,,2,2018-05-22T18:30:00Z,11,C,cpu\n,,2,2018-05-22T14:30:00Z,11,C,cpu\n,,2,2018-05-22T17:30:00Z,11,C,cpu\n,,2,2018-05-22T15:30:00Z,11,C,cpu\n,,2,2018-05-22T16:30:00Z,11,C,cpu\n,,3,2018-05-22T18:30:00Z,11,D,cpu\n,,3,2018-05-22T15:30:00Z,11,D,cpu\n,,3,2018-05-22T19:30:00Z,11,D,cpu\n,,3,2018-05-22T16:30:00Z,11,D,cpu\n,,3,2018-05-22T17:30:00Z,11,D,cpu\n\"\n\noutData = \"\n#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,dateTime:RFC3339,long,string,string,boolean\n#group,false,false,true,true,false,false,true,true,false\n#default,_result,,,,,,,,\n,result,table,_start,_stop,_time,_value,_field,_measurement,dead\n,,0,2018-05-22T15:00:00Z,2018-05-22T20:00:00Z,2018-05-22T19:30:00Z,11,A,cpu,false\n,,1,2018-05-22T15:00:00Z,2018-05-22T20:00:00Z,2018-05-22T19:30:00Z,11,B,cpu,false\n,,2,2018-05-22T15:00:00Z,2018-05-22T20:00:00Z,2018-05-22T18:30:00Z,11,C,cpu,true\n,,3,2018-05-22T15:00:00Z,2018-05-22T20:00:00Z,2018-05-22T19:30:00Z,11,D,cpu,false\n\"\n\nt_deadman_sub = (table=<-) => table\n |> range(start: -5h)\n |> monitor.deadman(t: experimental.subDuration(d: 1h, from: now()))\n\ntest deadman_sub = () =>\n\t({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_deadman_sub}", Start: ast.Position{ Column: 1, Line: 1, }, }, }, Body: []ast.Statement{&ast.OptionStatement{ Assignment: &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 40, Line: 7, }, File: "deadman_sub_test.flux", Source: "now = () => 2018-05-22T20:00:00Z", Start: ast.Position{ Column: 8, Line: 7, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 11, Line: 7, }, File: "deadman_sub_test.flux", Source: "now", Start: ast.Position{ Column: 8, Line: 7, }, }, }, Name: "now", }, Init: &ast.FunctionExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 40, Line: 7, }, File: "deadman_sub_test.flux", Source: "() => 2018-05-22T20:00:00Z", Start: ast.Position{ Column: 14, Line: 7, }, }, }, Body: &ast.DateTimeLiteral{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 40, Line: 7, }, File: "deadman_sub_test.flux", Source: "2018-05-22T20:00:00Z", Start: ast.Position{ Column: 20, Line: 7, }, }, }, Value: parser.MustParseTime("2018-05-22T20:00:00Z"), }, Params: nil, }, }, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 40, Line: 7, }, File: "deadman_sub_test.flux", Source: "option now = () => 2018-05-22T20:00:00Z", Start: ast.Position{ Column: 1, Line: 7, }, }, }, }, &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 2, Line: 34, }, File: "deadman_sub_test.flux", Source: "inData = \"\n#datatype,string,long,dateTime:RFC3339,long,string,string\n#group,false,false,false,false,true,true\n#default,_result,,,,,\n,result,table,_time,_value,_field,_measurement\n,,0,2018-05-22T19:30:00Z,11,A,cpu\n,,0,2018-05-22T18:30:00Z,11,A,cpu\n,,0,2018-05-22T17:30:00Z,11,A,cpu\n,,0,2018-05-22T16:30:00Z,11,A,cpu\n,,0,2018-05-22T15:30:00Z,11,A,cpu\n,,1,2018-05-22T15:30:00Z,11,B,cpu\n,,1,2018-05-22T16:30:00Z,11,B,cpu\n,,1,2018-05-22T17:30:00Z,11,B,cpu\n,,1,2018-05-22T18:30:00Z,11,B,cpu\n,,1,2018-05-22T19:30:00Z,11,B,cpu\n,,2,2018-05-22T18:30:00Z,11,C,cpu\n,,2,2018-05-22T14:30:00Z,11,C,cpu\n,,2,2018-05-22T17:30:00Z,11,C,cpu\n,,2,2018-05-22T15:30:00Z,11,C,cpu\n,,2,2018-05-22T16:30:00Z,11,C,cpu\n,,3,2018-05-22T18:30:00Z,11,D,cpu\n,,3,2018-05-22T15:30:00Z,11,D,cpu\n,,3,2018-05-22T19:30:00Z,11,D,cpu\n,,3,2018-05-22T16:30:00Z,11,D,cpu\n,,3,2018-05-22T17:30:00Z,11,D,cpu\n\"", Start: ast.Position{ Column: 1, Line: 9, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 7, Line: 9, }, File: "deadman_sub_test.flux", Source: "inData", Start: ast.Position{ Column: 1, Line: 9, }, }, }, Name: "inData", }, Init: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 2, Line: 34, }, File: "deadman_sub_test.flux", Source: "\"\n#datatype,string,long,dateTime:RFC3339,long,string,string\n#group,false,false,false,false,true,true\n#default,_result,,,,,\n,result,table,_time,_value,_field,_measurement\n,,0,2018-05-22T19:30:00Z,11,A,cpu\n,,0,2018-05-22T18:30:00Z,11,A,cpu\n,,0,2018-05-22T17:30:00Z,11,A,cpu\n,,0,2018-05-22T16:30:00Z,11,A,cpu\n,,0,2018-05-22T15:30:00Z,11,A,cpu\n,,1,2018-05-22T15:30:00Z,11,B,cpu\n,,1,2018-05-22T16:30:00Z,11,B,cpu\n,,1,2018-05-22T17:30:00Z,11,B,cpu\n,,1,2018-05-22T18:30:00Z,11,B,cpu\n,,1,2018-05-22T19:30:00Z,11,B,cpu\n,,2,2018-05-22T18:30:00Z,11,C,cpu\n,,2,2018-05-22T14:30:00Z,11,C,cpu\n,,2,2018-05-22T17:30:00Z,11,C,cpu\n,,2,2018-05-22T15:30:00Z,11,C,cpu\n,,2,2018-05-22T16:30:00Z,11,C,cpu\n,,3,2018-05-22T18:30:00Z,11,D,cpu\n,,3,2018-05-22T15:30:00Z,11,D,cpu\n,,3,2018-05-22T19:30:00Z,11,D,cpu\n,,3,2018-05-22T16:30:00Z,11,D,cpu\n,,3,2018-05-22T17:30:00Z,11,D,cpu\n\"", Start: ast.Position{ Column: 10, Line: 9, }, }, }, Value: "\n#datatype,string,long,dateTime:RFC3339,long,string,string\n#group,false,false,false,false,true,true\n#default,_result,,,,,\n,result,table,_time,_value,_field,_measurement\n,,0,2018-05-22T19:30:00Z,11,A,cpu\n,,0,2018-05-22T18:30:00Z,11,A,cpu\n,,0,2018-05-22T17:30:00Z,11,A,cpu\n,,0,2018-05-22T16:30:00Z,11,A,cpu\n,,0,2018-05-22T15:30:00Z,11,A,cpu\n,,1,2018-05-22T15:30:00Z,11,B,cpu\n,,1,2018-05-22T16:30:00Z,11,B,cpu\n,,1,2018-05-22T17:30:00Z,11,B,cpu\n,,1,2018-05-22T18:30:00Z,11,B,cpu\n,,1,2018-05-22T19:30:00Z,11,B,cpu\n,,2,2018-05-22T18:30:00Z,11,C,cpu\n,,2,2018-05-22T14:30:00Z,11,C,cpu\n,,2,2018-05-22T17:30:00Z,11,C,cpu\n,,2,2018-05-22T15:30:00Z,11,C,cpu\n,,2,2018-05-22T16:30:00Z,11,C,cpu\n,,3,2018-05-22T18:30:00Z,11,D,cpu\n,,3,2018-05-22T15:30:00Z,11,D,cpu\n,,3,2018-05-22T19:30:00Z,11,D,cpu\n,,3,2018-05-22T16:30:00Z,11,D,cpu\n,,3,2018-05-22T17:30:00Z,11,D,cpu\n", }, }, &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 2, Line: 45, }, File: "deadman_sub_test.flux", Source: "outData = \"\n#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,dateTime:RFC3339,long,string,string,boolean\n#group,false,false,true,true,false,false,true,true,false\n#default,_result,,,,,,,,\n,result,table,_start,_stop,_time,_value,_field,_measurement,dead\n,,0,2018-05-22T15:00:00Z,2018-05-22T20:00:00Z,2018-05-22T19:30:00Z,11,A,cpu,false\n,,1,2018-05-22T15:00:00Z,2018-05-22T20:00:00Z,2018-05-22T19:30:00Z,11,B,cpu,false\n,,2,2018-05-22T15:00:00Z,2018-05-22T20:00:00Z,2018-05-22T18:30:00Z,11,C,cpu,true\n,,3,2018-05-22T15:00:00Z,2018-05-22T20:00:00Z,2018-05-22T19:30:00Z,11,D,cpu,false\n\"", Start: ast.Position{ Column: 1, Line: 36, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 8, Line: 36, }, File: "deadman_sub_test.flux", Source: "outData", Start: ast.Position{ Column: 1, Line: 36, }, }, }, Name: "outData", }, Init: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 2, Line: 45, }, File: "deadman_sub_test.flux", Source: "\"\n#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,dateTime:RFC3339,long,string,string,boolean\n#group,false,false,true,true,false,false,true,true,false\n#default,_result,,,,,,,,\n,result,table,_start,_stop,_time,_value,_field,_measurement,dead\n,,0,2018-05-22T15:00:00Z,2018-05-22T20:00:00Z,2018-05-22T19:30:00Z,11,A,cpu,false\n,,1,2018-05-22T15:00:00Z,2018-05-22T20:00:00Z,2018-05-22T19:30:00Z,11,B,cpu,false\n,,2,2018-05-22T15:00:00Z,2018-05-22T20:00:00Z,2018-05-22T18:30:00Z,11,C,cpu,true\n,,3,2018-05-22T15:00:00Z,2018-05-22T20:00:00Z,2018-05-22T19:30:00Z,11,D,cpu,false\n\"", Start: ast.Position{ Column: 11, Line: 36, }, }, }, Value: "\n#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,dateTime:RFC3339,long,string,string,boolean\n#group,false,false,true,true,false,false,true,true,false\n#default,_result,,,,,,,,\n,result,table,_start,_stop,_time,_value,_field,_measurement,dead\n,,0,2018-05-22T15:00:00Z,2018-05-22T20:00:00Z,2018-05-22T19:30:00Z,11,A,cpu,false\n,,1,2018-05-22T15:00:00Z,2018-05-22T20:00:00Z,2018-05-22T19:30:00Z,11,B,cpu,false\n,,2,2018-05-22T15:00:00Z,2018-05-22T20:00:00Z,2018-05-22T18:30:00Z,11,C,cpu,true\n,,3,2018-05-22T15:00:00Z,2018-05-22T20:00:00Z,2018-05-22T19:30:00Z,11,D,cpu,false\n", }, }, &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 72, Line: 49, }, File: "deadman_sub_test.flux", Source: "t_deadman_sub = (table=<-) => table\n |> range(start: -5h)\n |> monitor.deadman(t: experimental.subDuration(d: 1h, from: now()))", Start: ast.Position{ Column: 1, Line: 47, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 14, Line: 47, }, File: "deadman_sub_test.flux", Source: "t_deadman_sub", Start: ast.Position{ Column: 1, Line: 47, }, }, }, Name: "t_deadman_sub", }, Init: &ast.FunctionExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 72, Line: 49, }, File: "deadman_sub_test.flux", Source: "(table=<-) => table\n |> range(start: -5h)\n |> monitor.deadman(t: experimental.subDuration(d: 1h, from: now()))", Start: ast.Position{ Column: 17, Line: 47, }, }, }, Body: &ast.PipeExpression{ Argument: &ast.PipeExpression{ Argument: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 36, Line: 47, }, File: "deadman_sub_test.flux", Source: "table", Start: ast.Position{ Column: 31, Line: 47, }, }, }, Name: "table", }, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 25, Line: 48, }, File: "deadman_sub_test.flux", Source: "table\n |> range(start: -5h)", Start: ast.Position{ Column: 31, Line: 47, }, }, }, Call: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 24, Line: 48, }, File: "deadman_sub_test.flux", Source: "start: -5h", Start: ast.Position{ Column: 14, Line: 48, }, }, }, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 24, Line: 48, }, File: "deadman_sub_test.flux", Source: "start: -5h", Start: ast.Position{ Column: 14, Line: 48, }, }, }, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 19, Line: 48, }, File: "deadman_sub_test.flux", Source: "start", Start: ast.Position{ Column: 14, Line: 48, }, }, }, Name: "start", }, Value: &ast.UnaryExpression{ Argument: &ast.DurationLiteral{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 24, Line: 48, }, File: "deadman_sub_test.flux", Source: "5h", Start: ast.Position{ Column: 22, Line: 48, }, }, }, Values: []ast.Duration{ast.Duration{ Magnitude: int64(5), Unit: "h", }}, }, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 24, Line: 48, }, File: "deadman_sub_test.flux", Source: "-5h", Start: ast.Position{ Column: 21, Line: 48, }, }, }, Operator: 6, }, }}, With: nil, }}, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 25, Line: 48, }, File: "deadman_sub_test.flux", Source: "range(start: -5h)", Start: ast.Position{ Column: 8, Line: 48, }, }, }, Callee: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 13, Line: 48, }, File: "deadman_sub_test.flux", Source: "range", Start: ast.Position{ Column: 8, Line: 48, }, }, }, Name: "range", }, }, }, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 72, Line: 49, }, File: "deadman_sub_test.flux", Source: "table\n |> range(start: -5h)\n |> monitor.deadman(t: experimental.subDuration(d: 1h, from: now()))", Start: ast.Position{ Column: 31, Line: 47, }, }, }, Call: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 71, Line: 49, }, File: "deadman_sub_test.flux", Source: "t: experimental.subDuration(d: 1h, from: now())", Start: ast.Position{ Column: 24, Line: 49, }, }, }, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 71, Line: 49, }, File: "deadman_sub_test.flux", Source: "t: experimental.subDuration(d: 1h, from: now())", Start: ast.Position{ Column: 24, Line: 49, }, }, }, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 25, Line: 49, }, File: "deadman_sub_test.flux", Source: "t", Start: ast.Position{ Column: 24, Line: 49, }, }, }, Name: "t", }, Value: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 70, Line: 49, }, File: "deadman_sub_test.flux", Source: "d: 1h, from: now()", Start: ast.Position{ Column: 52, Line: 49, }, }, }, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 57, Line: 49, }, File: "deadman_sub_test.flux", Source: "d: 1h", Start: ast.Position{ Column: 52, Line: 49, }, }, }, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 53, Line: 49, }, File: "deadman_sub_test.flux", Source: "d", Start: ast.Position{ Column: 52, Line: 49, }, }, }, Name: "d", }, Value: &ast.DurationLiteral{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 57, Line: 49, }, File: "deadman_sub_test.flux", Source: "1h", Start: ast.Position{ Column: 55, Line: 49, }, }, }, Values: []ast.Duration{ast.Duration{ Magnitude: int64(1), Unit: "h", }}, }, }, &ast.Property{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 70, Line: 49, }, File: "deadman_sub_test.flux", Source: "from: now()", Start: ast.Position{ Column: 59, Line: 49, }, }, }, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 63, Line: 49, }, File: "deadman_sub_test.flux", Source: "from", Start: ast.Position{ Column: 59, Line: 49, }, }, }, Name: "from", }, Value: &ast.CallExpression{ Arguments: nil, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 70, Line: 49, }, File: "deadman_sub_test.flux", Source: "now()", Start: ast.Position{ Column: 65, Line: 49, }, }, }, Callee: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 68, Line: 49, }, File: "deadman_sub_test.flux", Source: "now", Start: ast.Position{ Column: 65, Line: 49, }, }, }, Name: "now", }, }, }}, With: nil, }}, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 71, Line: 49, }, File: "deadman_sub_test.flux", Source: "experimental.subDuration(d: 1h, from: now())", Start: ast.Position{ Column: 27, Line: 49, }, }, }, Callee: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 51, Line: 49, }, File: "deadman_sub_test.flux", Source: "experimental.subDuration", Start: ast.Position{ Column: 27, Line: 49, }, }, }, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 39, Line: 49, }, File: "deadman_sub_test.flux", Source: "experimental", Start: ast.Position{ Column: 27, Line: 49, }, }, }, Name: "experimental", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 51, Line: 49, }, File: "deadman_sub_test.flux", Source: "subDuration", Start: ast.Position{ Column: 40, Line: 49, }, }, }, Name: "subDuration", }, }, }, }}, With: nil, }}, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 72, Line: 49, }, File: "deadman_sub_test.flux", Source: "monitor.deadman(t: experimental.subDuration(d: 1h, from: now()))", Start: ast.Position{ Column: 8, Line: 49, }, }, }, Callee: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 23, Line: 49, }, File: "deadman_sub_test.flux", Source: "monitor.deadman", Start: ast.Position{ Column: 8, Line: 49, }, }, }, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 15, Line: 49, }, File: "deadman_sub_test.flux", Source: "monitor", Start: ast.Position{ Column: 8, Line: 49, }, }, }, Name: "monitor", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 23, Line: 49, }, File: "deadman_sub_test.flux", Source: "deadman", Start: ast.Position{ Column: 16, Line: 49, }, }, }, Name: "deadman", }, }, }, }, Params: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 26, Line: 47, }, File: "deadman_sub_test.flux", Source: "table=<-", Start: ast.Position{ Column: 18, Line: 47, }, }, }, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 23, Line: 47, }, File: "deadman_sub_test.flux", Source: "table", Start: ast.Position{ Column: 18, Line: 47, }, }, }, Name: "table", }, Value: &ast.PipeLiteral{BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 26, Line: 47, }, File: "deadman_sub_test.flux", Source: "<-", Start: ast.Position{ Column: 24, Line: 47, }, }, }}, }}, }, }, &ast.TestStatement{ Assignment: &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 100, Line: 52, }, File: "deadman_sub_test.flux", Source: "deadman_sub = () =>\n\t({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_deadman_sub}", Start: ast.Position{ Column: 6, Line: 51, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 17, Line: 51, }, File: "deadman_sub_test.flux", Source: "deadman_sub", Start: ast.Position{ Column: 6, Line: 51, }, }, }, Name: "deadman_sub", }, Init: &ast.FunctionExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 100, Line: 52, }, File: "deadman_sub_test.flux", Source: "() =>\n\t({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_deadman_sub}", Start: ast.Position{ Column: 20, Line: 51, }, }, }, Body: &ast.ObjectExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 100, Line: 52, }, File: "deadman_sub_test.flux", Source: "{input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_deadman_sub}", Start: ast.Position{ Column: 3, Line: 52, }, }, }, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 43, Line: 52, }, File: "deadman_sub_test.flux", Source: "input: testing.loadStorage(csv: inData)", Start: ast.Position{ Column: 4, Line: 52, }, }, }, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 9, Line: 52, }, File: "deadman_sub_test.flux", Source: "input", Start: ast.Position{ Column: 4, Line: 52, }, }, }, Name: "input", }, Value: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 52, }, File: "deadman_sub_test.flux", Source: "csv: inData", Start: ast.Position{ Column: 31, Line: 52, }, }, }, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 52, }, File: "deadman_sub_test.flux", Source: "csv: inData", Start: ast.Position{ Column: 31, Line: 52, }, }, }, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 34, Line: 52, }, File: "deadman_sub_test.flux", Source: "csv", Start: ast.Position{ Column: 31, Line: 52, }, }, }, Name: "csv", }, Value: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 52, }, File: "deadman_sub_test.flux", Source: "inData", Start: ast.Position{ Column: 36, Line: 52, }, }, }, Name: "inData", }, }}, With: nil, }}, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 43, Line: 52, }, File: "deadman_sub_test.flux", Source: "testing.loadStorage(csv: inData)", Start: ast.Position{ Column: 11, Line: 52, }, }, }, Callee: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 30, Line: 52, }, File: "deadman_sub_test.flux", Source: "testing.loadStorage", Start: ast.Position{ Column: 11, Line: 52, }, }, }, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 18, Line: 52, }, File: "deadman_sub_test.flux", Source: "testing", Start: ast.Position{ Column: 11, Line: 52, }, }, }, Name: "testing", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 30, Line: 52, }, File: "deadman_sub_test.flux", Source: "loadStorage", Start: ast.Position{ Column: 19, Line: 52, }, }, }, Name: "loadStorage", }, }, }, }, &ast.Property{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 80, Line: 52, }, File: "deadman_sub_test.flux", Source: "want: testing.loadMem(csv: outData)", Start: ast.Position{ Column: 45, Line: 52, }, }, }, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 49, Line: 52, }, File: "deadman_sub_test.flux", Source: "want", Start: ast.Position{ Column: 45, Line: 52, }, }, }, Name: "want", }, Value: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 79, Line: 52, }, File: "deadman_sub_test.flux", Source: "csv: outData", Start: ast.Position{ Column: 67, Line: 52, }, }, }, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 79, Line: 52, }, File: "deadman_sub_test.flux", Source: "csv: outData", Start: ast.Position{ Column: 67, Line: 52, }, }, }, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 70, Line: 52, }, File: "deadman_sub_test.flux", Source: "csv", Start: ast.Position{ Column: 67, Line: 52, }, }, }, Name: "csv", }, Value: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 79, Line: 52, }, File: "deadman_sub_test.flux", Source: "outData", Start: ast.Position{ Column: 72, Line: 52, }, }, }, Name: "outData", }, }}, With: nil, }}, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 80, Line: 52, }, File: "deadman_sub_test.flux", Source: "testing.loadMem(csv: outData)", Start: ast.Position{ Column: 51, Line: 52, }, }, }, Callee: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 66, Line: 52, }, File: "deadman_sub_test.flux", Source: "testing.loadMem", Start: ast.Position{ Column: 51, Line: 52, }, }, }, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 58, Line: 52, }, File: "deadman_sub_test.flux", Source: "testing", Start: ast.Position{ Column: 51, Line: 52, }, }, }, Name: "testing", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 66, Line: 52, }, File: "deadman_sub_test.flux", Source: "loadMem", Start: ast.Position{ Column: 59, Line: 52, }, }, }, Name: "loadMem", }, }, }, }, &ast.Property{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 99, Line: 52, }, File: "deadman_sub_test.flux", Source: "fn: t_deadman_sub", Start: ast.Position{ Column: 82, Line: 52, }, }, }, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 84, Line: 52, }, File: "deadman_sub_test.flux", Source: "fn", Start: ast.Position{ Column: 82, Line: 52, }, }, }, Name: "fn", }, Value: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 99, Line: 52, }, File: "deadman_sub_test.flux", Source: "t_deadman_sub", Start: ast.Position{ Column: 86, Line: 52, }, }, }, Name: "t_deadman_sub", }, }}, With: nil, }, Params: nil, }, }, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 100, Line: 52, }, File: "deadman_sub_test.flux", Source: "test deadman_sub = () =>\n\t({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_deadman_sub}", Start: ast.Position{ Column: 1, Line: 51, }, }, }, }}, Imports: []*ast.ImportDeclaration{&ast.ImportDeclaration{ As: nil, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 37, Line: 3, }, File: "deadman_sub_test.flux", Source: "import \"influxdata/influxdb/monitor\"", Start: ast.Position{ Column: 1, Line: 3, }, }, }, Path: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 37, Line: 3, }, File: "deadman_sub_test.flux", Source: "\"influxdata/influxdb/monitor\"", Start: ast.Position{ Column: 8, Line: 3, }, }, }, Value: "influxdata/influxdb/monitor", }, }, &ast.ImportDeclaration{ As: nil, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 17, Line: 4, }, File: "deadman_sub_test.flux", Source: "import \"testing\"", Start: ast.Position{ Column: 1, Line: 4, }, }, }, Path: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 17, Line: 4, }, File: "deadman_sub_test.flux", Source: "\"testing\"", Start: ast.Position{ Column: 8, Line: 4, }, }, }, Value: "testing", }, }, &ast.ImportDeclaration{ As: nil, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 22, Line: 5, }, File: "deadman_sub_test.flux", Source: "import \"experimental\"", Start: ast.Position{ Column: 1, Line: 5, }, }, }, Path: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 22, Line: 5, }, File: "deadman_sub_test.flux", Source: "\"experimental\"", Start: ast.Position{ Column: 8, Line: 5, }, }, }, Value: "experimental", }, }}, Name: "deadman_sub_test.flux", Package: &ast.PackageClause{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 21, Line: 1, }, File: "deadman_sub_test.flux", Source: "package monitor_test", Start: ast.Position{ Column: 1, Line: 1, }, }, }, Name: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 21, Line: 1, }, File: "deadman_sub_test.flux", Source: "monitor_test", Start: ast.Position{ Column: 9, Line: 1, }, }, }, Name: "main", }, }, }}, Package: "main", Path: "", }, &ast.Package{ BaseNode: ast.BaseNode{ Errors: nil, Loc: nil, }, Files: []*ast.File{&ast.File{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 98, Line: 68, }, File: "notify_test.flux", Source: "package monitor_test\n\nimport \"influxdata/influxdb/monitor\"\nimport \"influxdata/influxdb/v1\"\nimport \"testing\"\nimport \"experimental\"\n\noption now = () => 2018-05-22T19:54:40Z\n\noption monitor.log = (tables=<-) => tables |> drop(columns:[\"_start\", \"_stop\"])\n\n// Note this input data is identical to the output data of the check test case, post pivot.\ninData = \"\n#datatype,string,long,string,string,string,string,string,dateTime:RFC3339,string,string,string,string,string,string,double\n#group,false,false,true,true,true,true,true,false,true,true,true,true,true,true,false\n#default,got,,,,,,,,,,,,,,\n,result,table,_check_id,_check_name,_level,_measurement,_source_measurement,_time,_type,aaa,bbb,cpu,host,_field,_value\n,,0,000000000000000a,cpu threshold check,crit,statuses,cpu,2018-05-22T19:54:20Z,threshold,vaaa,vbbb,cpu-total,host.local,usage_idle,4.800000000000001\n,,1,000000000000000a,cpu threshold check,ok,statuses,cpu,2018-05-22T19:54:20Z,threshold,vaaa,vbbb,cpu-total,host.local,usage_idle,90.62382797849732\n,,2,000000000000000a,cpu threshold check,warn,statuses,cpu,2018-05-22T19:54:20Z,threshold,vaaa,vbbb,cpu-total,host.local,usage_idle,7.05\n\n#datatype,string,long,string,string,string,string,string,dateTime:RFC3339,string,string,string,string,string,string,string\n#group,false,false,true,true,true,true,true,false,true,true,true,true,true,true,false\n#default,got,,,,,,,,,,,,,,\n,result,table,_check_id,_check_name,_level,_measurement,_source_measurement,_time,_type,aaa,bbb,cpu,host,_field,_value\n,,1,000000000000000a,cpu threshold check,ok,statuses,cpu,2018-05-22T19:54:20Z,threshold,vaaa,vbbb,cpu-total,host.local,_message,whoa!\n,,2,000000000000000a,cpu threshold check,warn,statuses,cpu,2018-05-22T19:54:20Z,threshold,vaaa,vbbb,cpu-total,host.local,_message,whoa!\n,,0,000000000000000a,cpu threshold check,crit,statuses,cpu,2018-05-22T19:54:20Z,threshold,vaaa,vbbb,cpu-total,host.local,_message,whoa!\n\n#datatype,string,long,string,string,string,string,string,dateTime:RFC3339,string,string,string,string,string,string,long\n#group,false,false,true,true,true,true,true,false,true,true,true,true,true,true,false\n#default,got,,,,,,,,,,,,,,\n,result,table,_check_id,_check_name,_level,_measurement,_source_measurement,_time,_type,aaa,bbb,cpu,host,_field,_value\n,,0,000000000000000a,cpu threshold check,crit,statuses,cpu,2018-05-22T19:54:20Z,threshold,vaaa,vbbb,cpu-total,host.local,_source_timestamp,1527018840000000000\n,,1,000000000000000a,cpu threshold check,ok,statuses,cpu,2018-05-22T19:54:20Z,threshold,vaaa,vbbb,cpu-total,host.local,_source_timestamp,1527018820000000000\n,,2,000000000000000a,cpu threshold check,warn,statuses,cpu,2018-05-22T19:54:20Z,threshold,vaaa,vbbb,cpu-total,host.local,_source_timestamp,1527018860000000000\n\"\n\noutData = \"\n#datatype,string,long,string,string,string,string,string,string,string,string,string,string,long,long,dateTime:RFC3339,string,string,string,string,string,double,string\n#group,false,false,true,true,true,true,true,true,true,true,false,true,false,false,false,true,true,true,true,true,false,true\n#default,got,,,,,,,,,,,,,,,,,,,,,\n,result,table,_notification_rule_id,_notification_rule_name,_notification_endpoint_id,_notification_endpoint_name,_check_id,_check_name,_level,_measurement,_message,_source_measurement,_status_timestamp,_source_timestamp,_time,_type,aaa,bbb,cpu,host,usage_idle,_sent\n,,0,0000000000000001,http-rule,00000000000002,http-endpoint,000000000000000a,cpu threshold check,crit,notifications,whoa!,cpu,1527018860000000000,1527018840000000000,2018-05-22T19:54:40Z,threshold,vaaa,vbbb,cpu-total,host.local,4.800000000000001,true\n,,1,0000000000000001,http-rule,00000000000002,http-endpoint,000000000000000a,cpu threshold check,ok,notifications,whoa!,cpu,1527018860000000000,1527018820000000000,2018-05-22T19:54:40Z,threshold,vaaa,vbbb,cpu-total,host.local,90.62382797849732,true\n,,2,0000000000000001,http-rule,00000000000002,http-endpoint,000000000000000a,cpu threshold check,warn,notifications,whoa!,cpu,1527018860000000000,1527018860000000000,2018-05-22T19:54:40Z,threshold,vaaa,vbbb,cpu-total,host.local,7.05,true\n\"\n\nendpoint = () => (tables=<-) => tables |> experimental.set(o: {_sent: \"true\"})\n\nnotification = {\n _notification_rule_id: \"0000000000000001\",\n _notification_rule_name: \"http-rule\",\n _notification_endpoint_id: \"00000000000002\",\n _notification_endpoint_name: \"http-endpoint\",\n}\n\n\nt_notify = (table=<-) => table\n |> range(start: -1m)\n |> v1.fieldsAsCols()\n |> monitor.notify(\n data: notification,\n endpoint: endpoint()\n )\n\ntest monitor_notify = () =>\n ({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_notify}", Start: ast.Position{ Column: 1, Line: 1, }, }, }, Body: []ast.Statement{&ast.OptionStatement{ Assignment: &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 40, Line: 8, }, File: "notify_test.flux", Source: "now = () => 2018-05-22T19:54:40Z", Start: ast.Position{ Column: 8, Line: 8, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 11, Line: 8, }, File: "notify_test.flux", Source: "now", Start: ast.Position{ Column: 8, Line: 8, }, }, }, Name: "now", }, Init: &ast.FunctionExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 40, Line: 8, }, File: "notify_test.flux", Source: "() => 2018-05-22T19:54:40Z", Start: ast.Position{ Column: 14, Line: 8, }, }, }, Body: &ast.DateTimeLiteral{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 40, Line: 8, }, File: "notify_test.flux", Source: "2018-05-22T19:54:40Z", Start: ast.Position{ Column: 20, Line: 8, }, }, }, Value: parser.MustParseTime("2018-05-22T19:54:40Z"), }, Params: nil, }, }, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 40, Line: 8, }, File: "notify_test.flux", Source: "option now = () => 2018-05-22T19:54:40Z", Start: ast.Position{ Column: 1, Line: 8, }, }, }, }, &ast.OptionStatement{ Assignment: &ast.MemberAssignment{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 80, Line: 10, }, File: "notify_test.flux", Source: "monitor.log = (tables=<-) => tables |> drop(columns:[\"_start\", \"_stop\"])", Start: ast.Position{ Column: 8, Line: 10, }, }, }, Init: &ast.FunctionExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 80, Line: 10, }, File: "notify_test.flux", Source: "(tables=<-) => tables |> drop(columns:[\"_start\", \"_stop\"])", Start: ast.Position{ Column: 22, Line: 10, }, }, }, Body: &ast.PipeExpression{ Argument: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 43, Line: 10, }, File: "notify_test.flux", Source: "tables", Start: ast.Position{ Column: 37, Line: 10, }, }, }, Name: "tables", }, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 80, Line: 10, }, File: "notify_test.flux", Source: "tables |> drop(columns:[\"_start\", \"_stop\"])", Start: ast.Position{ Column: 37, Line: 10, }, }, }, Call: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 79, Line: 10, }, File: "notify_test.flux", Source: "columns:[\"_start\", \"_stop\"]", Start: ast.Position{ Column: 52, Line: 10, }, }, }, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 79, Line: 10, }, File: "notify_test.flux", Source: "columns:[\"_start\", \"_stop\"]", Start: ast.Position{ Column: 52, Line: 10, }, }, }, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 59, Line: 10, }, File: "notify_test.flux", Source: "columns", Start: ast.Position{ Column: 52, Line: 10, }, }, }, Name: "columns", }, Value: &ast.ArrayExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 79, Line: 10, }, File: "notify_test.flux", Source: "[\"_start\", \"_stop\"]", Start: ast.Position{ Column: 60, Line: 10, }, }, }, Elements: []ast.Expression{&ast.StringLiteral{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 69, Line: 10, }, File: "notify_test.flux", Source: "\"_start\"", Start: ast.Position{ Column: 61, Line: 10, }, }, }, Value: "_start", }, &ast.StringLiteral{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 78, Line: 10, }, File: "notify_test.flux", Source: "\"_stop\"", Start: ast.Position{ Column: 71, Line: 10, }, }, }, Value: "_stop", }}, }, }}, With: nil, }}, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 80, Line: 10, }, File: "notify_test.flux", Source: "drop(columns:[\"_start\", \"_stop\"])", Start: ast.Position{ Column: 47, Line: 10, }, }, }, Callee: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 51, Line: 10, }, File: "notify_test.flux", Source: "drop", Start: ast.Position{ Column: 47, Line: 10, }, }, }, Name: "drop", }, }, }, Params: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 32, Line: 10, }, File: "notify_test.flux", Source: "tables=<-", Start: ast.Position{ Column: 23, Line: 10, }, }, }, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 29, Line: 10, }, File: "notify_test.flux", Source: "tables", Start: ast.Position{ Column: 23, Line: 10, }, }, }, Name: "tables", }, Value: &ast.PipeLiteral{BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 32, Line: 10, }, File: "notify_test.flux", Source: "<-", Start: ast.Position{ Column: 30, Line: 10, }, }, }}, }}, }, Member: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 19, Line: 10, }, File: "notify_test.flux", Source: "monitor.log", Start: ast.Position{ Column: 8, Line: 10, }, }, }, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 15, Line: 10, }, File: "notify_test.flux", Source: "monitor", Start: ast.Position{ Column: 8, Line: 10, }, }, }, Name: "monitor", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 19, Line: 10, }, File: "notify_test.flux", Source: "log", Start: ast.Position{ Column: 16, Line: 10, }, }, }, Name: "log", }, }, }, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 80, Line: 10, }, File: "notify_test.flux", Source: "option monitor.log = (tables=<-) => tables |> drop(columns:[\"_start\", \"_stop\"])", Start: ast.Position{ Column: 1, Line: 10, }, }, }, }, &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 2, Line: 37, }, File: "notify_test.flux", Source: "inData = \"\n#datatype,string,long,string,string,string,string,string,dateTime:RFC3339,string,string,string,string,string,string,double\n#group,false,false,true,true,true,true,true,false,true,true,true,true,true,true,false\n#default,got,,,,,,,,,,,,,,\n,result,table,_check_id,_check_name,_level,_measurement,_source_measurement,_time,_type,aaa,bbb,cpu,host,_field,_value\n,,0,000000000000000a,cpu threshold check,crit,statuses,cpu,2018-05-22T19:54:20Z,threshold,vaaa,vbbb,cpu-total,host.local,usage_idle,4.800000000000001\n,,1,000000000000000a,cpu threshold check,ok,statuses,cpu,2018-05-22T19:54:20Z,threshold,vaaa,vbbb,cpu-total,host.local,usage_idle,90.62382797849732\n,,2,000000000000000a,cpu threshold check,warn,statuses,cpu,2018-05-22T19:54:20Z,threshold,vaaa,vbbb,cpu-total,host.local,usage_idle,7.05\n\n#datatype,string,long,string,string,string,string,string,dateTime:RFC3339,string,string,string,string,string,string,string\n#group,false,false,true,true,true,true,true,false,true,true,true,true,true,true,false\n#default,got,,,,,,,,,,,,,,\n,result,table,_check_id,_check_name,_level,_measurement,_source_measurement,_time,_type,aaa,bbb,cpu,host,_field,_value\n,,1,000000000000000a,cpu threshold check,ok,statuses,cpu,2018-05-22T19:54:20Z,threshold,vaaa,vbbb,cpu-total,host.local,_message,whoa!\n,,2,000000000000000a,cpu threshold check,warn,statuses,cpu,2018-05-22T19:54:20Z,threshold,vaaa,vbbb,cpu-total,host.local,_message,whoa!\n,,0,000000000000000a,cpu threshold check,crit,statuses,cpu,2018-05-22T19:54:20Z,threshold,vaaa,vbbb,cpu-total,host.local,_message,whoa!\n\n#datatype,string,long,string,string,string,string,string,dateTime:RFC3339,string,string,string,string,string,string,long\n#group,false,false,true,true,true,true,true,false,true,true,true,true,true,true,false\n#default,got,,,,,,,,,,,,,,\n,result,table,_check_id,_check_name,_level,_measurement,_source_measurement,_time,_type,aaa,bbb,cpu,host,_field,_value\n,,0,000000000000000a,cpu threshold check,crit,statuses,cpu,2018-05-22T19:54:20Z,threshold,vaaa,vbbb,cpu-total,host.local,_source_timestamp,1527018840000000000\n,,1,000000000000000a,cpu threshold check,ok,statuses,cpu,2018-05-22T19:54:20Z,threshold,vaaa,vbbb,cpu-total,host.local,_source_timestamp,1527018820000000000\n,,2,000000000000000a,cpu threshold check,warn,statuses,cpu,2018-05-22T19:54:20Z,threshold,vaaa,vbbb,cpu-total,host.local,_source_timestamp,1527018860000000000\n\"", Start: ast.Position{ Column: 1, Line: 13, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 7, Line: 13, }, File: "notify_test.flux", Source: "inData", Start: ast.Position{ Column: 1, Line: 13, }, }, }, Name: "inData", }, Init: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 2, Line: 37, }, File: "notify_test.flux", Source: "\"\n#datatype,string,long,string,string,string,string,string,dateTime:RFC3339,string,string,string,string,string,string,double\n#group,false,false,true,true,true,true,true,false,true,true,true,true,true,true,false\n#default,got,,,,,,,,,,,,,,\n,result,table,_check_id,_check_name,_level,_measurement,_source_measurement,_time,_type,aaa,bbb,cpu,host,_field,_value\n,,0,000000000000000a,cpu threshold check,crit,statuses,cpu,2018-05-22T19:54:20Z,threshold,vaaa,vbbb,cpu-total,host.local,usage_idle,4.800000000000001\n,,1,000000000000000a,cpu threshold check,ok,statuses,cpu,2018-05-22T19:54:20Z,threshold,vaaa,vbbb,cpu-total,host.local,usage_idle,90.62382797849732\n,,2,000000000000000a,cpu threshold check,warn,statuses,cpu,2018-05-22T19:54:20Z,threshold,vaaa,vbbb,cpu-total,host.local,usage_idle,7.05\n\n#datatype,string,long,string,string,string,string,string,dateTime:RFC3339,string,string,string,string,string,string,string\n#group,false,false,true,true,true,true,true,false,true,true,true,true,true,true,false\n#default,got,,,,,,,,,,,,,,\n,result,table,_check_id,_check_name,_level,_measurement,_source_measurement,_time,_type,aaa,bbb,cpu,host,_field,_value\n,,1,000000000000000a,cpu threshold check,ok,statuses,cpu,2018-05-22T19:54:20Z,threshold,vaaa,vbbb,cpu-total,host.local,_message,whoa!\n,,2,000000000000000a,cpu threshold check,warn,statuses,cpu,2018-05-22T19:54:20Z,threshold,vaaa,vbbb,cpu-total,host.local,_message,whoa!\n,,0,000000000000000a,cpu threshold check,crit,statuses,cpu,2018-05-22T19:54:20Z,threshold,vaaa,vbbb,cpu-total,host.local,_message,whoa!\n\n#datatype,string,long,string,string,string,string,string,dateTime:RFC3339,string,string,string,string,string,string,long\n#group,false,false,true,true,true,true,true,false,true,true,true,true,true,true,false\n#default,got,,,,,,,,,,,,,,\n,result,table,_check_id,_check_name,_level,_measurement,_source_measurement,_time,_type,aaa,bbb,cpu,host,_field,_value\n,,0,000000000000000a,cpu threshold check,crit,statuses,cpu,2018-05-22T19:54:20Z,threshold,vaaa,vbbb,cpu-total,host.local,_source_timestamp,1527018840000000000\n,,1,000000000000000a,cpu threshold check,ok,statuses,cpu,2018-05-22T19:54:20Z,threshold,vaaa,vbbb,cpu-total,host.local,_source_timestamp,1527018820000000000\n,,2,000000000000000a,cpu threshold check,warn,statuses,cpu,2018-05-22T19:54:20Z,threshold,vaaa,vbbb,cpu-total,host.local,_source_timestamp,1527018860000000000\n\"", Start: ast.Position{ Column: 10, Line: 13, }, }, }, Value: "\n#datatype,string,long,string,string,string,string,string,dateTime:RFC3339,string,string,string,string,string,string,double\n#group,false,false,true,true,true,true,true,false,true,true,true,true,true,true,false\n#default,got,,,,,,,,,,,,,,\n,result,table,_check_id,_check_name,_level,_measurement,_source_measurement,_time,_type,aaa,bbb,cpu,host,_field,_value\n,,0,000000000000000a,cpu threshold check,crit,statuses,cpu,2018-05-22T19:54:20Z,threshold,vaaa,vbbb,cpu-total,host.local,usage_idle,4.800000000000001\n,,1,000000000000000a,cpu threshold check,ok,statuses,cpu,2018-05-22T19:54:20Z,threshold,vaaa,vbbb,cpu-total,host.local,usage_idle,90.62382797849732\n,,2,000000000000000a,cpu threshold check,warn,statuses,cpu,2018-05-22T19:54:20Z,threshold,vaaa,vbbb,cpu-total,host.local,usage_idle,7.05\n\n#datatype,string,long,string,string,string,string,string,dateTime:RFC3339,string,string,string,string,string,string,string\n#group,false,false,true,true,true,true,true,false,true,true,true,true,true,true,false\n#default,got,,,,,,,,,,,,,,\n,result,table,_check_id,_check_name,_level,_measurement,_source_measurement,_time,_type,aaa,bbb,cpu,host,_field,_value\n,,1,000000000000000a,cpu threshold check,ok,statuses,cpu,2018-05-22T19:54:20Z,threshold,vaaa,vbbb,cpu-total,host.local,_message,whoa!\n,,2,000000000000000a,cpu threshold check,warn,statuses,cpu,2018-05-22T19:54:20Z,threshold,vaaa,vbbb,cpu-total,host.local,_message,whoa!\n,,0,000000000000000a,cpu threshold check,crit,statuses,cpu,2018-05-22T19:54:20Z,threshold,vaaa,vbbb,cpu-total,host.local,_message,whoa!\n\n#datatype,string,long,string,string,string,string,string,dateTime:RFC3339,string,string,string,string,string,string,long\n#group,false,false,true,true,true,true,true,false,true,true,true,true,true,true,false\n#default,got,,,,,,,,,,,,,,\n,result,table,_check_id,_check_name,_level,_measurement,_source_measurement,_time,_type,aaa,bbb,cpu,host,_field,_value\n,,0,000000000000000a,cpu threshold check,crit,statuses,cpu,2018-05-22T19:54:20Z,threshold,vaaa,vbbb,cpu-total,host.local,_source_timestamp,1527018840000000000\n,,1,000000000000000a,cpu threshold check,ok,statuses,cpu,2018-05-22T19:54:20Z,threshold,vaaa,vbbb,cpu-total,host.local,_source_timestamp,1527018820000000000\n,,2,000000000000000a,cpu threshold check,warn,statuses,cpu,2018-05-22T19:54:20Z,threshold,vaaa,vbbb,cpu-total,host.local,_source_timestamp,1527018860000000000\n", }, }, &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 2, Line: 47, }, File: "notify_test.flux", Source: "outData = \"\n#datatype,string,long,string,string,string,string,string,string,string,string,string,string,long,long,dateTime:RFC3339,string,string,string,string,string,double,string\n#group,false,false,true,true,true,true,true,true,true,true,false,true,false,false,false,true,true,true,true,true,false,true\n#default,got,,,,,,,,,,,,,,,,,,,,,\n,result,table,_notification_rule_id,_notification_rule_name,_notification_endpoint_id,_notification_endpoint_name,_check_id,_check_name,_level,_measurement,_message,_source_measurement,_status_timestamp,_source_timestamp,_time,_type,aaa,bbb,cpu,host,usage_idle,_sent\n,,0,0000000000000001,http-rule,00000000000002,http-endpoint,000000000000000a,cpu threshold check,crit,notifications,whoa!,cpu,1527018860000000000,1527018840000000000,2018-05-22T19:54:40Z,threshold,vaaa,vbbb,cpu-total,host.local,4.800000000000001,true\n,,1,0000000000000001,http-rule,00000000000002,http-endpoint,000000000000000a,cpu threshold check,ok,notifications,whoa!,cpu,1527018860000000000,1527018820000000000,2018-05-22T19:54:40Z,threshold,vaaa,vbbb,cpu-total,host.local,90.62382797849732,true\n,,2,0000000000000001,http-rule,00000000000002,http-endpoint,000000000000000a,cpu threshold check,warn,notifications,whoa!,cpu,1527018860000000000,1527018860000000000,2018-05-22T19:54:40Z,threshold,vaaa,vbbb,cpu-total,host.local,7.05,true\n\"", Start: ast.Position{ Column: 1, Line: 39, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 8, Line: 39, }, File: "notify_test.flux", Source: "outData", Start: ast.Position{ Column: 1, Line: 39, }, }, }, Name: "outData", }, Init: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 2, Line: 47, }, File: "notify_test.flux", Source: "\"\n#datatype,string,long,string,string,string,string,string,string,string,string,string,string,long,long,dateTime:RFC3339,string,string,string,string,string,double,string\n#group,false,false,true,true,true,true,true,true,true,true,false,true,false,false,false,true,true,true,true,true,false,true\n#default,got,,,,,,,,,,,,,,,,,,,,,\n,result,table,_notification_rule_id,_notification_rule_name,_notification_endpoint_id,_notification_endpoint_name,_check_id,_check_name,_level,_measurement,_message,_source_measurement,_status_timestamp,_source_timestamp,_time,_type,aaa,bbb,cpu,host,usage_idle,_sent\n,,0,0000000000000001,http-rule,00000000000002,http-endpoint,000000000000000a,cpu threshold check,crit,notifications,whoa!,cpu,1527018860000000000,1527018840000000000,2018-05-22T19:54:40Z,threshold,vaaa,vbbb,cpu-total,host.local,4.800000000000001,true\n,,1,0000000000000001,http-rule,00000000000002,http-endpoint,000000000000000a,cpu threshold check,ok,notifications,whoa!,cpu,1527018860000000000,1527018820000000000,2018-05-22T19:54:40Z,threshold,vaaa,vbbb,cpu-total,host.local,90.62382797849732,true\n,,2,0000000000000001,http-rule,00000000000002,http-endpoint,000000000000000a,cpu threshold check,warn,notifications,whoa!,cpu,1527018860000000000,1527018860000000000,2018-05-22T19:54:40Z,threshold,vaaa,vbbb,cpu-total,host.local,7.05,true\n\"", Start: ast.Position{ Column: 11, Line: 39, }, }, }, Value: "\n#datatype,string,long,string,string,string,string,string,string,string,string,string,string,long,long,dateTime:RFC3339,string,string,string,string,string,double,string\n#group,false,false,true,true,true,true,true,true,true,true,false,true,false,false,false,true,true,true,true,true,false,true\n#default,got,,,,,,,,,,,,,,,,,,,,,\n,result,table,_notification_rule_id,_notification_rule_name,_notification_endpoint_id,_notification_endpoint_name,_check_id,_check_name,_level,_measurement,_message,_source_measurement,_status_timestamp,_source_timestamp,_time,_type,aaa,bbb,cpu,host,usage_idle,_sent\n,,0,0000000000000001,http-rule,00000000000002,http-endpoint,000000000000000a,cpu threshold check,crit,notifications,whoa!,cpu,1527018860000000000,1527018840000000000,2018-05-22T19:54:40Z,threshold,vaaa,vbbb,cpu-total,host.local,4.800000000000001,true\n,,1,0000000000000001,http-rule,00000000000002,http-endpoint,000000000000000a,cpu threshold check,ok,notifications,whoa!,cpu,1527018860000000000,1527018820000000000,2018-05-22T19:54:40Z,threshold,vaaa,vbbb,cpu-total,host.local,90.62382797849732,true\n,,2,0000000000000001,http-rule,00000000000002,http-endpoint,000000000000000a,cpu threshold check,warn,notifications,whoa!,cpu,1527018860000000000,1527018860000000000,2018-05-22T19:54:40Z,threshold,vaaa,vbbb,cpu-total,host.local,7.05,true\n", }, }, &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 79, Line: 49, }, File: "notify_test.flux", Source: "endpoint = () => (tables=<-) => tables |> experimental.set(o: {_sent: \"true\"})", Start: ast.Position{ Column: 1, Line: 49, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 9, Line: 49, }, File: "notify_test.flux", Source: "endpoint", Start: ast.Position{ Column: 1, Line: 49, }, }, }, Name: "endpoint", }, Init: &ast.FunctionExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 79, Line: 49, }, File: "notify_test.flux", Source: "() => (tables=<-) => tables |> experimental.set(o: {_sent: \"true\"})", Start: ast.Position{ Column: 12, Line: 49, }, }, }, Body: &ast.FunctionExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 79, Line: 49, }, File: "notify_test.flux", Source: "(tables=<-) => tables |> experimental.set(o: {_sent: \"true\"})", Start: ast.Position{ Column: 18, Line: 49, }, }, }, Body: &ast.PipeExpression{ Argument: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 39, Line: 49, }, File: "notify_test.flux", Source: "tables", Start: ast.Position{ Column: 33, Line: 49, }, }, }, Name: "tables", }, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 79, Line: 49, }, File: "notify_test.flux", Source: "tables |> experimental.set(o: {_sent: \"true\"})", Start: ast.Position{ Column: 33, Line: 49, }, }, }, Call: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 78, Line: 49, }, File: "notify_test.flux", Source: "o: {_sent: \"true\"}", Start: ast.Position{ Column: 60, Line: 49, }, }, }, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 78, Line: 49, }, File: "notify_test.flux", Source: "o: {_sent: \"true\"}", Start: ast.Position{ Column: 60, Line: 49, }, }, }, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 61, Line: 49, }, File: "notify_test.flux", Source: "o", Start: ast.Position{ Column: 60, Line: 49, }, }, }, Name: "o", }, Value: &ast.ObjectExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 78, Line: 49, }, File: "notify_test.flux", Source: "{_sent: \"true\"}", Start: ast.Position{ Column: 63, Line: 49, }, }, }, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 77, Line: 49, }, File: "notify_test.flux", Source: "_sent: \"true\"", Start: ast.Position{ Column: 64, Line: 49, }, }, }, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 69, Line: 49, }, File: "notify_test.flux", Source: "_sent", Start: ast.Position{ Column: 64, Line: 49, }, }, }, Name: "_sent", }, Value: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 77, Line: 49, }, File: "notify_test.flux", Source: "\"true\"", Start: ast.Position{ Column: 71, Line: 49, }, }, }, Value: "true", }, }}, With: nil, }, }}, With: nil, }}, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 79, Line: 49, }, File: "notify_test.flux", Source: "experimental.set(o: {_sent: \"true\"})", Start: ast.Position{ Column: 43, Line: 49, }, }, }, Callee: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 59, Line: 49, }, File: "notify_test.flux", Source: "experimental.set", Start: ast.Position{ Column: 43, Line: 49, }, }, }, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 55, Line: 49, }, File: "notify_test.flux", Source: "experimental", Start: ast.Position{ Column: 43, Line: 49, }, }, }, Name: "experimental", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 59, Line: 49, }, File: "notify_test.flux", Source: "set", Start: ast.Position{ Column: 56, Line: 49, }, }, }, Name: "set", }, }, }, }, Params: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 28, Line: 49, }, File: "notify_test.flux", Source: "tables=<-", Start: ast.Position{ Column: 19, Line: 49, }, }, }, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 25, Line: 49, }, File: "notify_test.flux", Source: "tables", Start: ast.Position{ Column: 19, Line: 49, }, }, }, Name: "tables", }, Value: &ast.PipeLiteral{BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 28, Line: 49, }, File: "notify_test.flux", Source: "<-", Start: ast.Position{ Column: 26, Line: 49, }, }, }}, }}, }, Params: nil, }, }, &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 2, Line: 56, }, File: "notify_test.flux", Source: "notification = {\n _notification_rule_id: \"0000000000000001\",\n _notification_rule_name: \"http-rule\",\n _notification_endpoint_id: \"00000000000002\",\n _notification_endpoint_name: \"http-endpoint\",\n}", Start: ast.Position{ Column: 1, Line: 51, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 13, Line: 51, }, File: "notify_test.flux", Source: "notification", Start: ast.Position{ Column: 1, Line: 51, }, }, }, Name: "notification", }, Init: &ast.ObjectExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 2, Line: 56, }, File: "notify_test.flux", Source: "{\n _notification_rule_id: \"0000000000000001\",\n _notification_rule_name: \"http-rule\",\n _notification_endpoint_id: \"00000000000002\",\n _notification_endpoint_name: \"http-endpoint\",\n}", Start: ast.Position{ Column: 16, Line: 51, }, }, }, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 46, Line: 52, }, File: "notify_test.flux", Source: "_notification_rule_id: \"0000000000000001\"", Start: ast.Position{ Column: 5, Line: 52, }, }, }, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 26, Line: 52, }, File: "notify_test.flux", Source: "_notification_rule_id", Start: ast.Position{ Column: 5, Line: 52, }, }, }, Name: "_notification_rule_id", }, Value: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 46, Line: 52, }, File: "notify_test.flux", Source: "\"0000000000000001\"", Start: ast.Position{ Column: 28, Line: 52, }, }, }, Value: "0000000000000001", }, }, &ast.Property{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 41, Line: 53, }, File: "notify_test.flux", Source: "_notification_rule_name: \"http-rule\"", Start: ast.Position{ Column: 5, Line: 53, }, }, }, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 28, Line: 53, }, File: "notify_test.flux", Source: "_notification_rule_name", Start: ast.Position{ Column: 5, Line: 53, }, }, }, Name: "_notification_rule_name", }, Value: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 41, Line: 53, }, File: "notify_test.flux", Source: "\"http-rule\"", Start: ast.Position{ Column: 30, Line: 53, }, }, }, Value: "http-rule", }, }, &ast.Property{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 48, Line: 54, }, File: "notify_test.flux", Source: "_notification_endpoint_id: \"00000000000002\"", Start: ast.Position{ Column: 5, Line: 54, }, }, }, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 30, Line: 54, }, File: "notify_test.flux", Source: "_notification_endpoint_id", Start: ast.Position{ Column: 5, Line: 54, }, }, }, Name: "_notification_endpoint_id", }, Value: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 48, Line: 54, }, File: "notify_test.flux", Source: "\"00000000000002\"", Start: ast.Position{ Column: 32, Line: 54, }, }, }, Value: "00000000000002", }, }, &ast.Property{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 49, Line: 55, }, File: "notify_test.flux", Source: "_notification_endpoint_name: \"http-endpoint\"", Start: ast.Position{ Column: 5, Line: 55, }, }, }, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 32, Line: 55, }, File: "notify_test.flux", Source: "_notification_endpoint_name", Start: ast.Position{ Column: 5, Line: 55, }, }, }, Name: "_notification_endpoint_name", }, Value: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 49, Line: 55, }, File: "notify_test.flux", Source: "\"http-endpoint\"", Start: ast.Position{ Column: 34, Line: 55, }, }, }, Value: "http-endpoint", }, }}, With: nil, }, }, &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 6, Line: 65, }, File: "notify_test.flux", Source: "t_notify = (table=<-) => table\n |> range(start: -1m)\n |> v1.fieldsAsCols()\n |> monitor.notify(\n data: notification,\n endpoint: endpoint()\n )", Start: ast.Position{ Column: 1, Line: 59, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 9, Line: 59, }, File: "notify_test.flux", Source: "t_notify", Start: ast.Position{ Column: 1, Line: 59, }, }, }, Name: "t_notify", }, Init: &ast.FunctionExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 6, Line: 65, }, File: "notify_test.flux", Source: "(table=<-) => table\n |> range(start: -1m)\n |> v1.fieldsAsCols()\n |> monitor.notify(\n data: notification,\n endpoint: endpoint()\n )", Start: ast.Position{ Column: 12, Line: 59, }, }, }, Body: &ast.PipeExpression{ Argument: &ast.PipeExpression{ Argument: &ast.PipeExpression{ Argument: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 31, Line: 59, }, File: "notify_test.flux", Source: "table", Start: ast.Position{ Column: 26, Line: 59, }, }, }, Name: "table", }, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 25, Line: 60, }, File: "notify_test.flux", Source: "table\n |> range(start: -1m)", Start: ast.Position{ Column: 26, Line: 59, }, }, }, Call: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 24, Line: 60, }, File: "notify_test.flux", Source: "start: -1m", Start: ast.Position{ Column: 14, Line: 60, }, }, }, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 24, Line: 60, }, File: "notify_test.flux", Source: "start: -1m", Start: ast.Position{ Column: 14, Line: 60, }, }, }, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 19, Line: 60, }, File: "notify_test.flux", Source: "start", Start: ast.Position{ Column: 14, Line: 60, }, }, }, Name: "start", }, Value: &ast.UnaryExpression{ Argument: &ast.DurationLiteral{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 24, Line: 60, }, File: "notify_test.flux", Source: "1m", Start: ast.Position{ Column: 22, Line: 60, }, }, }, Values: []ast.Duration{ast.Duration{ Magnitude: int64(1), Unit: "m", }}, }, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 24, Line: 60, }, File: "notify_test.flux", Source: "-1m", Start: ast.Position{ Column: 21, Line: 60, }, }, }, Operator: 6, }, }}, With: nil, }}, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 25, Line: 60, }, File: "notify_test.flux", Source: "range(start: -1m)", Start: ast.Position{ Column: 8, Line: 60, }, }, }, Callee: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 13, Line: 60, }, File: "notify_test.flux", Source: "range", Start: ast.Position{ Column: 8, Line: 60, }, }, }, Name: "range", }, }, }, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 25, Line: 61, }, File: "notify_test.flux", Source: "table\n |> range(start: -1m)\n |> v1.fieldsAsCols()", Start: ast.Position{ Column: 26, Line: 59, }, }, }, Call: &ast.CallExpression{ Arguments: nil, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 25, Line: 61, }, File: "notify_test.flux", Source: "v1.fieldsAsCols()", Start: ast.Position{ Column: 8, Line: 61, }, }, }, Callee: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 23, Line: 61, }, File: "notify_test.flux", Source: "v1.fieldsAsCols", Start: ast.Position{ Column: 8, Line: 61, }, }, }, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 10, Line: 61, }, File: "notify_test.flux", Source: "v1", Start: ast.Position{ Column: 8, Line: 61, }, }, }, Name: "v1", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 23, Line: 61, }, File: "notify_test.flux", Source: "fieldsAsCols", Start: ast.Position{ Column: 11, Line: 61, }, }, }, Name: "fieldsAsCols", }, }, }, }, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 6, Line: 65, }, File: "notify_test.flux", Source: "table\n |> range(start: -1m)\n |> v1.fieldsAsCols()\n |> monitor.notify(\n data: notification,\n endpoint: endpoint()\n )", Start: ast.Position{ Column: 26, Line: 59, }, }, }, Call: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 29, Line: 64, }, File: "notify_test.flux", Source: "data: notification,\n endpoint: endpoint()", Start: ast.Position{ Column: 9, Line: 63, }, }, }, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 27, Line: 63, }, File: "notify_test.flux", Source: "data: notification", Start: ast.Position{ Column: 9, Line: 63, }, }, }, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 13, Line: 63, }, File: "notify_test.flux", Source: "data", Start: ast.Position{ Column: 9, Line: 63, }, }, }, Name: "data", }, Value: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 27, Line: 63, }, File: "notify_test.flux", Source: "notification", Start: ast.Position{ Column: 15, Line: 63, }, }, }, Name: "notification", }, }, &ast.Property{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 29, Line: 64, }, File: "notify_test.flux", Source: "endpoint: endpoint()", Start: ast.Position{ Column: 9, Line: 64, }, }, }, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 17, Line: 64, }, File: "notify_test.flux", Source: "endpoint", Start: ast.Position{ Column: 9, Line: 64, }, }, }, Name: "endpoint", }, Value: &ast.CallExpression{ Arguments: nil, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 29, Line: 64, }, File: "notify_test.flux", Source: "endpoint()", Start: ast.Position{ Column: 19, Line: 64, }, }, }, Callee: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 27, Line: 64, }, File: "notify_test.flux", Source: "endpoint", Start: ast.Position{ Column: 19, Line: 64, }, }, }, Name: "endpoint", }, }, }}, With: nil, }}, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 6, Line: 65, }, File: "notify_test.flux", Source: "monitor.notify(\n data: notification,\n endpoint: endpoint()\n )", Start: ast.Position{ Column: 8, Line: 62, }, }, }, Callee: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 22, Line: 62, }, File: "notify_test.flux", Source: "monitor.notify", Start: ast.Position{ Column: 8, Line: 62, }, }, }, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 15, Line: 62, }, File: "notify_test.flux", Source: "monitor", Start: ast.Position{ Column: 8, Line: 62, }, }, }, Name: "monitor", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 22, Line: 62, }, File: "notify_test.flux", Source: "notify", Start: ast.Position{ Column: 16, Line: 62, }, }, }, Name: "notify", }, }, }, }, Params: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 21, Line: 59, }, File: "notify_test.flux", Source: "table=<-", Start: ast.Position{ Column: 13, Line: 59, }, }, }, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 18, Line: 59, }, File: "notify_test.flux", Source: "table", Start: ast.Position{ Column: 13, Line: 59, }, }, }, Name: "table", }, Value: &ast.PipeLiteral{BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 21, Line: 59, }, File: "notify_test.flux", Source: "<-", Start: ast.Position{ Column: 19, Line: 59, }, }, }}, }}, }, }, &ast.TestStatement{ Assignment: &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 98, Line: 68, }, File: "notify_test.flux", Source: "monitor_notify = () =>\n ({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_notify}", Start: ast.Position{ Column: 6, Line: 67, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 20, Line: 67, }, File: "notify_test.flux", Source: "monitor_notify", Start: ast.Position{ Column: 6, Line: 67, }, }, }, Name: "monitor_notify", }, Init: &ast.FunctionExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 98, Line: 68, }, File: "notify_test.flux", Source: "() =>\n ({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_notify}", Start: ast.Position{ Column: 23, Line: 67, }, }, }, Body: &ast.ObjectExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 98, Line: 68, }, File: "notify_test.flux", Source: "{input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_notify}", Start: ast.Position{ Column: 6, Line: 68, }, }, }, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 46, Line: 68, }, File: "notify_test.flux", Source: "input: testing.loadStorage(csv: inData)", Start: ast.Position{ Column: 7, Line: 68, }, }, }, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 12, Line: 68, }, File: "notify_test.flux", Source: "input", Start: ast.Position{ Column: 7, Line: 68, }, }, }, Name: "input", }, Value: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 45, Line: 68, }, File: "notify_test.flux", Source: "csv: inData", Start: ast.Position{ Column: 34, Line: 68, }, }, }, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 45, Line: 68, }, File: "notify_test.flux", Source: "csv: inData", Start: ast.Position{ Column: 34, Line: 68, }, }, }, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 37, Line: 68, }, File: "notify_test.flux", Source: "csv", Start: ast.Position{ Column: 34, Line: 68, }, }, }, Name: "csv", }, Value: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 45, Line: 68, }, File: "notify_test.flux", Source: "inData", Start: ast.Position{ Column: 39, Line: 68, }, }, }, Name: "inData", }, }}, With: nil, }}, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 46, Line: 68, }, File: "notify_test.flux", Source: "testing.loadStorage(csv: inData)", Start: ast.Position{ Column: 14, Line: 68, }, }, }, Callee: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 33, Line: 68, }, File: "notify_test.flux", Source: "testing.loadStorage", Start: ast.Position{ Column: 14, Line: 68, }, }, }, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 21, Line: 68, }, File: "notify_test.flux", Source: "testing", Start: ast.Position{ Column: 14, Line: 68, }, }, }, Name: "testing", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 33, Line: 68, }, File: "notify_test.flux", Source: "loadStorage", Start: ast.Position{ Column: 22, Line: 68, }, }, }, Name: "loadStorage", }, }, }, }, &ast.Property{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 83, Line: 68, }, File: "notify_test.flux", Source: "want: testing.loadMem(csv: outData)", Start: ast.Position{ Column: 48, Line: 68, }, }, }, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 52, Line: 68, }, File: "notify_test.flux", Source: "want", Start: ast.Position{ Column: 48, Line: 68, }, }, }, Name: "want", }, Value: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 82, Line: 68, }, File: "notify_test.flux", Source: "csv: outData", Start: ast.Position{ Column: 70, Line: 68, }, }, }, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 82, Line: 68, }, File: "notify_test.flux", Source: "csv: outData", Start: ast.Position{ Column: 70, Line: 68, }, }, }, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 73, Line: 68, }, File: "notify_test.flux", Source: "csv", Start: ast.Position{ Column: 70, Line: 68, }, }, }, Name: "csv", }, Value: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 82, Line: 68, }, File: "notify_test.flux", Source: "outData", Start: ast.Position{ Column: 75, Line: 68, }, }, }, Name: "outData", }, }}, With: nil, }}, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 83, Line: 68, }, File: "notify_test.flux", Source: "testing.loadMem(csv: outData)", Start: ast.Position{ Column: 54, Line: 68, }, }, }, Callee: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 69, Line: 68, }, File: "notify_test.flux", Source: "testing.loadMem", Start: ast.Position{ Column: 54, Line: 68, }, }, }, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 61, Line: 68, }, File: "notify_test.flux", Source: "testing", Start: ast.Position{ Column: 54, Line: 68, }, }, }, Name: "testing", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 69, Line: 68, }, File: "notify_test.flux", Source: "loadMem", Start: ast.Position{ Column: 62, Line: 68, }, }, }, Name: "loadMem", }, }, }, }, &ast.Property{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 97, Line: 68, }, File: "notify_test.flux", Source: "fn: t_notify", Start: ast.Position{ Column: 85, Line: 68, }, }, }, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 87, Line: 68, }, File: "notify_test.flux", Source: "fn", Start: ast.Position{ Column: 85, Line: 68, }, }, }, Name: "fn", }, Value: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 97, Line: 68, }, File: "notify_test.flux", Source: "t_notify", Start: ast.Position{ Column: 89, Line: 68, }, }, }, Name: "t_notify", }, }}, With: nil, }, Params: nil, }, }, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 98, Line: 68, }, File: "notify_test.flux", Source: "test monitor_notify = () =>\n ({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_notify}", Start: ast.Position{ Column: 1, Line: 67, }, }, }, }}, Imports: []*ast.ImportDeclaration{&ast.ImportDeclaration{ As: nil, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 37, Line: 3, }, File: "notify_test.flux", Source: "import \"influxdata/influxdb/monitor\"", Start: ast.Position{ Column: 1, Line: 3, }, }, }, Path: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 37, Line: 3, }, File: "notify_test.flux", Source: "\"influxdata/influxdb/monitor\"", Start: ast.Position{ Column: 8, Line: 3, }, }, }, Value: "influxdata/influxdb/monitor", }, }, &ast.ImportDeclaration{ As: nil, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 32, Line: 4, }, File: "notify_test.flux", Source: "import \"influxdata/influxdb/v1\"", Start: ast.Position{ Column: 1, Line: 4, }, }, }, Path: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 32, Line: 4, }, File: "notify_test.flux", Source: "\"influxdata/influxdb/v1\"", Start: ast.Position{ Column: 8, Line: 4, }, }, }, Value: "influxdata/influxdb/v1", }, }, &ast.ImportDeclaration{ As: nil, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 17, Line: 5, }, File: "notify_test.flux", Source: "import \"testing\"", Start: ast.Position{ Column: 1, Line: 5, }, }, }, Path: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 17, Line: 5, }, File: "notify_test.flux", Source: "\"testing\"", Start: ast.Position{ Column: 8, Line: 5, }, }, }, Value: "testing", }, }, &ast.ImportDeclaration{ As: nil, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 22, Line: 6, }, File: "notify_test.flux", Source: "import \"experimental\"", Start: ast.Position{ Column: 1, Line: 6, }, }, }, Path: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 22, Line: 6, }, File: "notify_test.flux", Source: "\"experimental\"", Start: ast.Position{ Column: 8, Line: 6, }, }, }, Value: "experimental", }, }}, Name: "notify_test.flux", Package: &ast.PackageClause{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 21, Line: 1, }, File: "notify_test.flux", Source: "package monitor_test", Start: ast.Position{ Column: 1, Line: 1, }, }, }, Name: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 21, Line: 1, }, File: "notify_test.flux", Source: "monitor_test", Start: ast.Position{ Column: 9, Line: 1, }, }, }, Name: "main", }, }, }}, Package: "main", Path: "", }, &ast.Package{ BaseNode: ast.BaseNode{ Errors: nil, Loc: nil, }, Files: []*ast.File{&ast.File{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 105, Line: 56, }, File: "state_changes_test.flux", Source: "package monitor_test\n\nimport \"influxdata/influxdb/monitor\"\nimport \"influxdata/influxdb/v1\"\nimport \"testing\"\nimport \"experimental\"\n\noption now = () => 2018-05-22T19:54:40Z\n\noption monitor.log = (tables=<-) => tables |> drop(columns:[\"_start\", \"_stop\"])\n\n// Note this input data is identical to the output data of the check test case, post pivot.\ninData = \"\n#datatype,string,long,string,string,string,string,string,dateTime:RFC3339,string,string,string,string,string,string,double\n#group,false,false,true,true,true,true,true,false,true,true,true,true,true,true,false\n#default,got,,,,,,,,,,,,,,\n,result,table,_check_id,_check_name,_level,_measurement,_source_measurement,_time,_type,aaa,bbb,cpu,host,_field,_value\n,,0,000000000000000a,cpu threshold check,crit,statuses,cpu,2018-05-22T19:54:20Z,threshold,vaaa,vbbb,cpu-total,host.local,usage_idle,4.800000000000001\n,,1,000000000000000a,cpu threshold check,ok,statuses,cpu,2018-05-22T19:54:21Z,threshold,vaaa,vbbb,cpu-total,host.local,usage_idle,90.62382797849732\n,,2,000000000000000a,cpu threshold check,warn,statuses,cpu,2018-05-22T19:54:22Z,threshold,vaaa,vbbb,cpu-total,host.local,usage_idle,7.05\n\n#datatype,string,long,string,string,string,string,string,dateTime:RFC3339,string,string,string,string,string,string,string\n#group,false,false,true,true,true,true,true,false,true,true,true,true,true,true,false\n#default,got,,,,,,,,,,,,,,\n,result,table,_check_id,_check_name,_level,_measurement,_source_measurement,_time,_type,aaa,bbb,cpu,host,_field,_value\n,,0,000000000000000a,cpu threshold check,crit,statuses,cpu,2018-05-22T19:54:20Z,threshold,vaaa,vbbb,cpu-total,host.local,_message,whoa!\n,,1,000000000000000a,cpu threshold check,ok,statuses,cpu,2018-05-22T19:54:21Z,threshold,vaaa,vbbb,cpu-total,host.local,_message,whoa!\n,,2,000000000000000a,cpu threshold check,warn,statuses,cpu,2018-05-22T19:54:22Z,threshold,vaaa,vbbb,cpu-total,host.local,_message,whoa!\n\n#datatype,string,long,string,string,string,string,string,dateTime:RFC3339,string,string,string,string,string,string,long\n#group,false,false,true,true,true,true,true,false,true,true,true,true,true,true,false\n#default,got,,,,,,,,,,,,,,\n,result,table,_check_id,_check_name,_level,_measurement,_source_measurement,_time,_type,aaa,bbb,cpu,host,_field,_value\n,,0,000000000000000a,cpu threshold check,crit,statuses,cpu,2018-05-22T19:54:20Z,threshold,vaaa,vbbb,cpu-total,host.local,_source_timestamp,1527018840000000000\n,,1,000000000000000a,cpu threshold check,ok,statuses,cpu,2018-05-22T19:54:21Z,threshold,vaaa,vbbb,cpu-total,host.local,_source_timestamp,1527018820000000000\n,,2,000000000000000a,cpu threshold check,warn,statuses,cpu,2018-05-22T19:54:22Z,threshold,vaaa,vbbb,cpu-total,host.local,_source_timestamp,1527018860000000000\n\"\n\noutData = \"\n#datatype,string,long,string,string,string,string,string,string,long,dateTime:RFC3339,string,string,string,string,string,double\n#group,false,false,true,true,true,true,false,true,false,false,true,true,true,true,true,false\n#default,got,,,,,,,,,,,,,,,\n,result,table,_check_id,_check_name,_level,_measurement,_message,_source_measurement,_source_timestamp,_time,_type,aaa,bbb,cpu,host,usage_idle\n,,2,000000000000000a,cpu threshold check,warn,statuses,whoa!,cpu,1527018860000000000,2018-05-22T19:54:22Z,threshold,vaaa,vbbb,cpu-total,host.local,7.05\n\"\n\nt_state_changes = (table=<-) => table\n |> range(start: -1m)\n |> v1.fieldsAsCols()\n |> monitor.stateChanges(\n toLevel: \"warn\",\n )\n |> drop(columns: [\"_start\",\"_stop\"])\n\ntest monitor_state_changes = () =>\n ({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_state_changes}", Start: ast.Position{ Column: 1, Line: 1, }, }, }, Body: []ast.Statement{&ast.OptionStatement{ Assignment: &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 40, Line: 8, }, File: "state_changes_test.flux", Source: "now = () => 2018-05-22T19:54:40Z", Start: ast.Position{ Column: 8, Line: 8, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 11, Line: 8, }, File: "state_changes_test.flux", Source: "now", Start: ast.Position{ Column: 8, Line: 8, }, }, }, Name: "now", }, Init: &ast.FunctionExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 40, Line: 8, }, File: "state_changes_test.flux", Source: "() => 2018-05-22T19:54:40Z", Start: ast.Position{ Column: 14, Line: 8, }, }, }, Body: &ast.DateTimeLiteral{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 40, Line: 8, }, File: "state_changes_test.flux", Source: "2018-05-22T19:54:40Z", Start: ast.Position{ Column: 20, Line: 8, }, }, }, Value: parser.MustParseTime("2018-05-22T19:54:40Z"), }, Params: nil, }, }, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 40, Line: 8, }, File: "state_changes_test.flux", Source: "option now = () => 2018-05-22T19:54:40Z", Start: ast.Position{ Column: 1, Line: 8, }, }, }, }, &ast.OptionStatement{ Assignment: &ast.MemberAssignment{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 80, Line: 10, }, File: "state_changes_test.flux", Source: "monitor.log = (tables=<-) => tables |> drop(columns:[\"_start\", \"_stop\"])", Start: ast.Position{ Column: 8, Line: 10, }, }, }, Init: &ast.FunctionExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 80, Line: 10, }, File: "state_changes_test.flux", Source: "(tables=<-) => tables |> drop(columns:[\"_start\", \"_stop\"])", Start: ast.Position{ Column: 22, Line: 10, }, }, }, Body: &ast.PipeExpression{ Argument: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 43, Line: 10, }, File: "state_changes_test.flux", Source: "tables", Start: ast.Position{ Column: 37, Line: 10, }, }, }, Name: "tables", }, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 80, Line: 10, }, File: "state_changes_test.flux", Source: "tables |> drop(columns:[\"_start\", \"_stop\"])", Start: ast.Position{ Column: 37, Line: 10, }, }, }, Call: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 79, Line: 10, }, File: "state_changes_test.flux", Source: "columns:[\"_start\", \"_stop\"]", Start: ast.Position{ Column: 52, Line: 10, }, }, }, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 79, Line: 10, }, File: "state_changes_test.flux", Source: "columns:[\"_start\", \"_stop\"]", Start: ast.Position{ Column: 52, Line: 10, }, }, }, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 59, Line: 10, }, File: "state_changes_test.flux", Source: "columns", Start: ast.Position{ Column: 52, Line: 10, }, }, }, Name: "columns", }, Value: &ast.ArrayExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 79, Line: 10, }, File: "state_changes_test.flux", Source: "[\"_start\", \"_stop\"]", Start: ast.Position{ Column: 60, Line: 10, }, }, }, Elements: []ast.Expression{&ast.StringLiteral{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 69, Line: 10, }, File: "state_changes_test.flux", Source: "\"_start\"", Start: ast.Position{ Column: 61, Line: 10, }, }, }, Value: "_start", }, &ast.StringLiteral{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 78, Line: 10, }, File: "state_changes_test.flux", Source: "\"_stop\"", Start: ast.Position{ Column: 71, Line: 10, }, }, }, Value: "_stop", }}, }, }}, With: nil, }}, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 80, Line: 10, }, File: "state_changes_test.flux", Source: "drop(columns:[\"_start\", \"_stop\"])", Start: ast.Position{ Column: 47, Line: 10, }, }, }, Callee: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 51, Line: 10, }, File: "state_changes_test.flux", Source: "drop", Start: ast.Position{ Column: 47, Line: 10, }, }, }, Name: "drop", }, }, }, Params: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 32, Line: 10, }, File: "state_changes_test.flux", Source: "tables=<-", Start: ast.Position{ Column: 23, Line: 10, }, }, }, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 29, Line: 10, }, File: "state_changes_test.flux", Source: "tables", Start: ast.Position{ Column: 23, Line: 10, }, }, }, Name: "tables", }, Value: &ast.PipeLiteral{BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 32, Line: 10, }, File: "state_changes_test.flux", Source: "<-", Start: ast.Position{ Column: 30, Line: 10, }, }, }}, }}, }, Member: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 19, Line: 10, }, File: "state_changes_test.flux", Source: "monitor.log", Start: ast.Position{ Column: 8, Line: 10, }, }, }, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 15, Line: 10, }, File: "state_changes_test.flux", Source: "monitor", Start: ast.Position{ Column: 8, Line: 10, }, }, }, Name: "monitor", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 19, Line: 10, }, File: "state_changes_test.flux", Source: "log", Start: ast.Position{ Column: 16, Line: 10, }, }, }, Name: "log", }, }, }, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 80, Line: 10, }, File: "state_changes_test.flux", Source: "option monitor.log = (tables=<-) => tables |> drop(columns:[\"_start\", \"_stop\"])", Start: ast.Position{ Column: 1, Line: 10, }, }, }, }, &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 2, Line: 37, }, File: "state_changes_test.flux", Source: "inData = \"\n#datatype,string,long,string,string,string,string,string,dateTime:RFC3339,string,string,string,string,string,string,double\n#group,false,false,true,true,true,true,true,false,true,true,true,true,true,true,false\n#default,got,,,,,,,,,,,,,,\n,result,table,_check_id,_check_name,_level,_measurement,_source_measurement,_time,_type,aaa,bbb,cpu,host,_field,_value\n,,0,000000000000000a,cpu threshold check,crit,statuses,cpu,2018-05-22T19:54:20Z,threshold,vaaa,vbbb,cpu-total,host.local,usage_idle,4.800000000000001\n,,1,000000000000000a,cpu threshold check,ok,statuses,cpu,2018-05-22T19:54:21Z,threshold,vaaa,vbbb,cpu-total,host.local,usage_idle,90.62382797849732\n,,2,000000000000000a,cpu threshold check,warn,statuses,cpu,2018-05-22T19:54:22Z,threshold,vaaa,vbbb,cpu-total,host.local,usage_idle,7.05\n\n#datatype,string,long,string,string,string,string,string,dateTime:RFC3339,string,string,string,string,string,string,string\n#group,false,false,true,true,true,true,true,false,true,true,true,true,true,true,false\n#default,got,,,,,,,,,,,,,,\n,result,table,_check_id,_check_name,_level,_measurement,_source_measurement,_time,_type,aaa,bbb,cpu,host,_field,_value\n,,0,000000000000000a,cpu threshold check,crit,statuses,cpu,2018-05-22T19:54:20Z,threshold,vaaa,vbbb,cpu-total,host.local,_message,whoa!\n,,1,000000000000000a,cpu threshold check,ok,statuses,cpu,2018-05-22T19:54:21Z,threshold,vaaa,vbbb,cpu-total,host.local,_message,whoa!\n,,2,000000000000000a,cpu threshold check,warn,statuses,cpu,2018-05-22T19:54:22Z,threshold,vaaa,vbbb,cpu-total,host.local,_message,whoa!\n\n#datatype,string,long,string,string,string,string,string,dateTime:RFC3339,string,string,string,string,string,string,long\n#group,false,false,true,true,true,true,true,false,true,true,true,true,true,true,false\n#default,got,,,,,,,,,,,,,,\n,result,table,_check_id,_check_name,_level,_measurement,_source_measurement,_time,_type,aaa,bbb,cpu,host,_field,_value\n,,0,000000000000000a,cpu threshold check,crit,statuses,cpu,2018-05-22T19:54:20Z,threshold,vaaa,vbbb,cpu-total,host.local,_source_timestamp,1527018840000000000\n,,1,000000000000000a,cpu threshold check,ok,statuses,cpu,2018-05-22T19:54:21Z,threshold,vaaa,vbbb,cpu-total,host.local,_source_timestamp,1527018820000000000\n,,2,000000000000000a,cpu threshold check,warn,statuses,cpu,2018-05-22T19:54:22Z,threshold,vaaa,vbbb,cpu-total,host.local,_source_timestamp,1527018860000000000\n\"", Start: ast.Position{ Column: 1, Line: 13, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 7, Line: 13, }, File: "state_changes_test.flux", Source: "inData", Start: ast.Position{ Column: 1, Line: 13, }, }, }, Name: "inData", }, Init: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 2, Line: 37, }, File: "state_changes_test.flux", Source: "\"\n#datatype,string,long,string,string,string,string,string,dateTime:RFC3339,string,string,string,string,string,string,double\n#group,false,false,true,true,true,true,true,false,true,true,true,true,true,true,false\n#default,got,,,,,,,,,,,,,,\n,result,table,_check_id,_check_name,_level,_measurement,_source_measurement,_time,_type,aaa,bbb,cpu,host,_field,_value\n,,0,000000000000000a,cpu threshold check,crit,statuses,cpu,2018-05-22T19:54:20Z,threshold,vaaa,vbbb,cpu-total,host.local,usage_idle,4.800000000000001\n,,1,000000000000000a,cpu threshold check,ok,statuses,cpu,2018-05-22T19:54:21Z,threshold,vaaa,vbbb,cpu-total,host.local,usage_idle,90.62382797849732\n,,2,000000000000000a,cpu threshold check,warn,statuses,cpu,2018-05-22T19:54:22Z,threshold,vaaa,vbbb,cpu-total,host.local,usage_idle,7.05\n\n#datatype,string,long,string,string,string,string,string,dateTime:RFC3339,string,string,string,string,string,string,string\n#group,false,false,true,true,true,true,true,false,true,true,true,true,true,true,false\n#default,got,,,,,,,,,,,,,,\n,result,table,_check_id,_check_name,_level,_measurement,_source_measurement,_time,_type,aaa,bbb,cpu,host,_field,_value\n,,0,000000000000000a,cpu threshold check,crit,statuses,cpu,2018-05-22T19:54:20Z,threshold,vaaa,vbbb,cpu-total,host.local,_message,whoa!\n,,1,000000000000000a,cpu threshold check,ok,statuses,cpu,2018-05-22T19:54:21Z,threshold,vaaa,vbbb,cpu-total,host.local,_message,whoa!\n,,2,000000000000000a,cpu threshold check,warn,statuses,cpu,2018-05-22T19:54:22Z,threshold,vaaa,vbbb,cpu-total,host.local,_message,whoa!\n\n#datatype,string,long,string,string,string,string,string,dateTime:RFC3339,string,string,string,string,string,string,long\n#group,false,false,true,true,true,true,true,false,true,true,true,true,true,true,false\n#default,got,,,,,,,,,,,,,,\n,result,table,_check_id,_check_name,_level,_measurement,_source_measurement,_time,_type,aaa,bbb,cpu,host,_field,_value\n,,0,000000000000000a,cpu threshold check,crit,statuses,cpu,2018-05-22T19:54:20Z,threshold,vaaa,vbbb,cpu-total,host.local,_source_timestamp,1527018840000000000\n,,1,000000000000000a,cpu threshold check,ok,statuses,cpu,2018-05-22T19:54:21Z,threshold,vaaa,vbbb,cpu-total,host.local,_source_timestamp,1527018820000000000\n,,2,000000000000000a,cpu threshold check,warn,statuses,cpu,2018-05-22T19:54:22Z,threshold,vaaa,vbbb,cpu-total,host.local,_source_timestamp,1527018860000000000\n\"", Start: ast.Position{ Column: 10, Line: 13, }, }, }, Value: "\n#datatype,string,long,string,string,string,string,string,dateTime:RFC3339,string,string,string,string,string,string,double\n#group,false,false,true,true,true,true,true,false,true,true,true,true,true,true,false\n#default,got,,,,,,,,,,,,,,\n,result,table,_check_id,_check_name,_level,_measurement,_source_measurement,_time,_type,aaa,bbb,cpu,host,_field,_value\n,,0,000000000000000a,cpu threshold check,crit,statuses,cpu,2018-05-22T19:54:20Z,threshold,vaaa,vbbb,cpu-total,host.local,usage_idle,4.800000000000001\n,,1,000000000000000a,cpu threshold check,ok,statuses,cpu,2018-05-22T19:54:21Z,threshold,vaaa,vbbb,cpu-total,host.local,usage_idle,90.62382797849732\n,,2,000000000000000a,cpu threshold check,warn,statuses,cpu,2018-05-22T19:54:22Z,threshold,vaaa,vbbb,cpu-total,host.local,usage_idle,7.05\n\n#datatype,string,long,string,string,string,string,string,dateTime:RFC3339,string,string,string,string,string,string,string\n#group,false,false,true,true,true,true,true,false,true,true,true,true,true,true,false\n#default,got,,,,,,,,,,,,,,\n,result,table,_check_id,_check_name,_level,_measurement,_source_measurement,_time,_type,aaa,bbb,cpu,host,_field,_value\n,,0,000000000000000a,cpu threshold check,crit,statuses,cpu,2018-05-22T19:54:20Z,threshold,vaaa,vbbb,cpu-total,host.local,_message,whoa!\n,,1,000000000000000a,cpu threshold check,ok,statuses,cpu,2018-05-22T19:54:21Z,threshold,vaaa,vbbb,cpu-total,host.local,_message,whoa!\n,,2,000000000000000a,cpu threshold check,warn,statuses,cpu,2018-05-22T19:54:22Z,threshold,vaaa,vbbb,cpu-total,host.local,_message,whoa!\n\n#datatype,string,long,string,string,string,string,string,dateTime:RFC3339,string,string,string,string,string,string,long\n#group,false,false,true,true,true,true,true,false,true,true,true,true,true,true,false\n#default,got,,,,,,,,,,,,,,\n,result,table,_check_id,_check_name,_level,_measurement,_source_measurement,_time,_type,aaa,bbb,cpu,host,_field,_value\n,,0,000000000000000a,cpu threshold check,crit,statuses,cpu,2018-05-22T19:54:20Z,threshold,vaaa,vbbb,cpu-total,host.local,_source_timestamp,1527018840000000000\n,,1,000000000000000a,cpu threshold check,ok,statuses,cpu,2018-05-22T19:54:21Z,threshold,vaaa,vbbb,cpu-total,host.local,_source_timestamp,1527018820000000000\n,,2,000000000000000a,cpu threshold check,warn,statuses,cpu,2018-05-22T19:54:22Z,threshold,vaaa,vbbb,cpu-total,host.local,_source_timestamp,1527018860000000000\n", }, }, &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 2, Line: 45, }, File: "state_changes_test.flux", Source: "outData = \"\n#datatype,string,long,string,string,string,string,string,string,long,dateTime:RFC3339,string,string,string,string,string,double\n#group,false,false,true,true,true,true,false,true,false,false,true,true,true,true,true,false\n#default,got,,,,,,,,,,,,,,,\n,result,table,_check_id,_check_name,_level,_measurement,_message,_source_measurement,_source_timestamp,_time,_type,aaa,bbb,cpu,host,usage_idle\n,,2,000000000000000a,cpu threshold check,warn,statuses,whoa!,cpu,1527018860000000000,2018-05-22T19:54:22Z,threshold,vaaa,vbbb,cpu-total,host.local,7.05\n\"", Start: ast.Position{ Column: 1, Line: 39, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 8, Line: 39, }, File: "state_changes_test.flux", Source: "outData", Start: ast.Position{ Column: 1, Line: 39, }, }, }, Name: "outData", }, Init: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 2, Line: 45, }, File: "state_changes_test.flux", Source: "\"\n#datatype,string,long,string,string,string,string,string,string,long,dateTime:RFC3339,string,string,string,string,string,double\n#group,false,false,true,true,true,true,false,true,false,false,true,true,true,true,true,false\n#default,got,,,,,,,,,,,,,,,\n,result,table,_check_id,_check_name,_level,_measurement,_message,_source_measurement,_source_timestamp,_time,_type,aaa,bbb,cpu,host,usage_idle\n,,2,000000000000000a,cpu threshold check,warn,statuses,whoa!,cpu,1527018860000000000,2018-05-22T19:54:22Z,threshold,vaaa,vbbb,cpu-total,host.local,7.05\n\"", Start: ast.Position{ Column: 11, Line: 39, }, }, }, Value: "\n#datatype,string,long,string,string,string,string,string,string,long,dateTime:RFC3339,string,string,string,string,string,double\n#group,false,false,true,true,true,true,false,true,false,false,true,true,true,true,true,false\n#default,got,,,,,,,,,,,,,,,\n,result,table,_check_id,_check_name,_level,_measurement,_message,_source_measurement,_source_timestamp,_time,_type,aaa,bbb,cpu,host,usage_idle\n,,2,000000000000000a,cpu threshold check,warn,statuses,whoa!,cpu,1527018860000000000,2018-05-22T19:54:22Z,threshold,vaaa,vbbb,cpu-total,host.local,7.05\n", }, }, &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 41, Line: 53, }, File: "state_changes_test.flux", Source: "t_state_changes = (table=<-) => table\n |> range(start: -1m)\n |> v1.fieldsAsCols()\n |> monitor.stateChanges(\n toLevel: \"warn\",\n )\n |> drop(columns: [\"_start\",\"_stop\"])", Start: ast.Position{ Column: 1, Line: 47, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 16, Line: 47, }, File: "state_changes_test.flux", Source: "t_state_changes", Start: ast.Position{ Column: 1, Line: 47, }, }, }, Name: "t_state_changes", }, Init: &ast.FunctionExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 41, Line: 53, }, File: "state_changes_test.flux", Source: "(table=<-) => table\n |> range(start: -1m)\n |> v1.fieldsAsCols()\n |> monitor.stateChanges(\n toLevel: \"warn\",\n )\n |> drop(columns: [\"_start\",\"_stop\"])", Start: ast.Position{ Column: 19, Line: 47, }, }, }, Body: &ast.PipeExpression{ Argument: &ast.PipeExpression{ Argument: &ast.PipeExpression{ Argument: &ast.PipeExpression{ Argument: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 38, Line: 47, }, File: "state_changes_test.flux", Source: "table", Start: ast.Position{ Column: 33, Line: 47, }, }, }, Name: "table", }, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 25, Line: 48, }, File: "state_changes_test.flux", Source: "table\n |> range(start: -1m)", Start: ast.Position{ Column: 33, Line: 47, }, }, }, Call: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 24, Line: 48, }, File: "state_changes_test.flux", Source: "start: -1m", Start: ast.Position{ Column: 14, Line: 48, }, }, }, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 24, Line: 48, }, File: "state_changes_test.flux", Source: "start: -1m", Start: ast.Position{ Column: 14, Line: 48, }, }, }, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 19, Line: 48, }, File: "state_changes_test.flux", Source: "start", Start: ast.Position{ Column: 14, Line: 48, }, }, }, Name: "start", }, Value: &ast.UnaryExpression{ Argument: &ast.DurationLiteral{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 24, Line: 48, }, File: "state_changes_test.flux", Source: "1m", Start: ast.Position{ Column: 22, Line: 48, }, }, }, Values: []ast.Duration{ast.Duration{ Magnitude: int64(1), Unit: "m", }}, }, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 24, Line: 48, }, File: "state_changes_test.flux", Source: "-1m", Start: ast.Position{ Column: 21, Line: 48, }, }, }, Operator: 6, }, }}, With: nil, }}, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 25, Line: 48, }, File: "state_changes_test.flux", Source: "range(start: -1m)", Start: ast.Position{ Column: 8, Line: 48, }, }, }, Callee: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 13, Line: 48, }, File: "state_changes_test.flux", Source: "range", Start: ast.Position{ Column: 8, Line: 48, }, }, }, Name: "range", }, }, }, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 25, Line: 49, }, File: "state_changes_test.flux", Source: "table\n |> range(start: -1m)\n |> v1.fieldsAsCols()", Start: ast.Position{ Column: 33, Line: 47, }, }, }, Call: &ast.CallExpression{ Arguments: nil, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 25, Line: 49, }, File: "state_changes_test.flux", Source: "v1.fieldsAsCols()", Start: ast.Position{ Column: 8, Line: 49, }, }, }, Callee: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 23, Line: 49, }, File: "state_changes_test.flux", Source: "v1.fieldsAsCols", Start: ast.Position{ Column: 8, Line: 49, }, }, }, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 10, Line: 49, }, File: "state_changes_test.flux", Source: "v1", Start: ast.Position{ Column: 8, Line: 49, }, }, }, Name: "v1", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 23, Line: 49, }, File: "state_changes_test.flux", Source: "fieldsAsCols", Start: ast.Position{ Column: 11, Line: 49, }, }, }, Name: "fieldsAsCols", }, }, }, }, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 6, Line: 52, }, File: "state_changes_test.flux", Source: "table\n |> range(start: -1m)\n |> v1.fieldsAsCols()\n |> monitor.stateChanges(\n toLevel: \"warn\",\n )", Start: ast.Position{ Column: 33, Line: 47, }, }, }, Call: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 24, Line: 51, }, File: "state_changes_test.flux", Source: "toLevel: \"warn\"", Start: ast.Position{ Column: 9, Line: 51, }, }, }, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 24, Line: 51, }, File: "state_changes_test.flux", Source: "toLevel: \"warn\"", Start: ast.Position{ Column: 9, Line: 51, }, }, }, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 16, Line: 51, }, File: "state_changes_test.flux", Source: "toLevel", Start: ast.Position{ Column: 9, Line: 51, }, }, }, Name: "toLevel", }, Value: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 24, Line: 51, }, File: "state_changes_test.flux", Source: "\"warn\"", Start: ast.Position{ Column: 18, Line: 51, }, }, }, Value: "warn", }, }}, With: nil, }}, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 6, Line: 52, }, File: "state_changes_test.flux", Source: "monitor.stateChanges(\n toLevel: \"warn\",\n )", Start: ast.Position{ Column: 8, Line: 50, }, }, }, Callee: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 28, Line: 50, }, File: "state_changes_test.flux", Source: "monitor.stateChanges", Start: ast.Position{ Column: 8, Line: 50, }, }, }, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 15, Line: 50, }, File: "state_changes_test.flux", Source: "monitor", Start: ast.Position{ Column: 8, Line: 50, }, }, }, Name: "monitor", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 28, Line: 50, }, File: "state_changes_test.flux", Source: "stateChanges", Start: ast.Position{ Column: 16, Line: 50, }, }, }, Name: "stateChanges", }, }, }, }, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 41, Line: 53, }, File: "state_changes_test.flux", Source: "table\n |> range(start: -1m)\n |> v1.fieldsAsCols()\n |> monitor.stateChanges(\n toLevel: \"warn\",\n )\n |> drop(columns: [\"_start\",\"_stop\"])", Start: ast.Position{ Column: 33, Line: 47, }, }, }, Call: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 40, Line: 53, }, File: "state_changes_test.flux", Source: "columns: [\"_start\",\"_stop\"]", Start: ast.Position{ Column: 13, Line: 53, }, }, }, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 40, Line: 53, }, File: "state_changes_test.flux", Source: "columns: [\"_start\",\"_stop\"]", Start: ast.Position{ Column: 13, Line: 53, }, }, }, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 20, Line: 53, }, File: "state_changes_test.flux", Source: "columns", Start: ast.Position{ Column: 13, Line: 53, }, }, }, Name: "columns", }, Value: &ast.ArrayExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 40, Line: 53, }, File: "state_changes_test.flux", Source: "[\"_start\",\"_stop\"]", Start: ast.Position{ Column: 22, Line: 53, }, }, }, Elements: []ast.Expression{&ast.StringLiteral{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 31, Line: 53, }, File: "state_changes_test.flux", Source: "\"_start\"", Start: ast.Position{ Column: 23, Line: 53, }, }, }, Value: "_start", }, &ast.StringLiteral{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 39, Line: 53, }, File: "state_changes_test.flux", Source: "\"_stop\"", Start: ast.Position{ Column: 32, Line: 53, }, }, }, Value: "_stop", }}, }, }}, With: nil, }}, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 41, Line: 53, }, File: "state_changes_test.flux", Source: "drop(columns: [\"_start\",\"_stop\"])", Start: ast.Position{ Column: 8, Line: 53, }, }, }, Callee: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 12, Line: 53, }, File: "state_changes_test.flux", Source: "drop", Start: ast.Position{ Column: 8, Line: 53, }, }, }, Name: "drop", }, }, }, Params: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 28, Line: 47, }, File: "state_changes_test.flux", Source: "table=<-", Start: ast.Position{ Column: 20, Line: 47, }, }, }, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 25, Line: 47, }, File: "state_changes_test.flux", Source: "table", Start: ast.Position{ Column: 20, Line: 47, }, }, }, Name: "table", }, Value: &ast.PipeLiteral{BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 28, Line: 47, }, File: "state_changes_test.flux", Source: "<-", Start: ast.Position{ Column: 26, Line: 47, }, }, }}, }}, }, }, &ast.TestStatement{ Assignment: &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 105, Line: 56, }, File: "state_changes_test.flux", Source: "monitor_state_changes = () =>\n ({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_state_changes}", Start: ast.Position{ Column: 6, Line: 55, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 27, Line: 55, }, File: "state_changes_test.flux", Source: "monitor_state_changes", Start: ast.Position{ Column: 6, Line: 55, }, }, }, Name: "monitor_state_changes", }, Init: &ast.FunctionExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 105, Line: 56, }, File: "state_changes_test.flux", Source: "() =>\n ({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_state_changes}", Start: ast.Position{ Column: 30, Line: 55, }, }, }, Body: &ast.ObjectExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 105, Line: 56, }, File: "state_changes_test.flux", Source: "{input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_state_changes}", Start: ast.Position{ Column: 6, Line: 56, }, }, }, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 46, Line: 56, }, File: "state_changes_test.flux", Source: "input: testing.loadStorage(csv: inData)", Start: ast.Position{ Column: 7, Line: 56, }, }, }, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 12, Line: 56, }, File: "state_changes_test.flux", Source: "input", Start: ast.Position{ Column: 7, Line: 56, }, }, }, Name: "input", }, Value: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 45, Line: 56, }, File: "state_changes_test.flux", Source: "csv: inData", Start: ast.Position{ Column: 34, Line: 56, }, }, }, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 45, Line: 56, }, File: "state_changes_test.flux", Source: "csv: inData", Start: ast.Position{ Column: 34, Line: 56, }, }, }, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 37, Line: 56, }, File: "state_changes_test.flux", Source: "csv", Start: ast.Position{ Column: 34, Line: 56, }, }, }, Name: "csv", }, Value: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 45, Line: 56, }, File: "state_changes_test.flux", Source: "inData", Start: ast.Position{ Column: 39, Line: 56, }, }, }, Name: "inData", }, }}, With: nil, }}, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 46, Line: 56, }, File: "state_changes_test.flux", Source: "testing.loadStorage(csv: inData)", Start: ast.Position{ Column: 14, Line: 56, }, }, }, Callee: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 33, Line: 56, }, File: "state_changes_test.flux", Source: "testing.loadStorage", Start: ast.Position{ Column: 14, Line: 56, }, }, }, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 21, Line: 56, }, File: "state_changes_test.flux", Source: "testing", Start: ast.Position{ Column: 14, Line: 56, }, }, }, Name: "testing", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 33, Line: 56, }, File: "state_changes_test.flux", Source: "loadStorage", Start: ast.Position{ Column: 22, Line: 56, }, }, }, Name: "loadStorage", }, }, }, }, &ast.Property{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 83, Line: 56, }, File: "state_changes_test.flux", Source: "want: testing.loadMem(csv: outData)", Start: ast.Position{ Column: 48, Line: 56, }, }, }, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 52, Line: 56, }, File: "state_changes_test.flux", Source: "want", Start: ast.Position{ Column: 48, Line: 56, }, }, }, Name: "want", }, Value: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 82, Line: 56, }, File: "state_changes_test.flux", Source: "csv: outData", Start: ast.Position{ Column: 70, Line: 56, }, }, }, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 82, Line: 56, }, File: "state_changes_test.flux", Source: "csv: outData", Start: ast.Position{ Column: 70, Line: 56, }, }, }, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 73, Line: 56, }, File: "state_changes_test.flux", Source: "csv", Start: ast.Position{ Column: 70, Line: 56, }, }, }, Name: "csv", }, Value: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 82, Line: 56, }, File: "state_changes_test.flux", Source: "outData", Start: ast.Position{ Column: 75, Line: 56, }, }, }, Name: "outData", }, }}, With: nil, }}, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 83, Line: 56, }, File: "state_changes_test.flux", Source: "testing.loadMem(csv: outData)", Start: ast.Position{ Column: 54, Line: 56, }, }, }, Callee: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 69, Line: 56, }, File: "state_changes_test.flux", Source: "testing.loadMem", Start: ast.Position{ Column: 54, Line: 56, }, }, }, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 61, Line: 56, }, File: "state_changes_test.flux", Source: "testing", Start: ast.Position{ Column: 54, Line: 56, }, }, }, Name: "testing", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 69, Line: 56, }, File: "state_changes_test.flux", Source: "loadMem", Start: ast.Position{ Column: 62, Line: 56, }, }, }, Name: "loadMem", }, }, }, }, &ast.Property{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 104, Line: 56, }, File: "state_changes_test.flux", Source: "fn: t_state_changes", Start: ast.Position{ Column: 85, Line: 56, }, }, }, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 87, Line: 56, }, File: "state_changes_test.flux", Source: "fn", Start: ast.Position{ Column: 85, Line: 56, }, }, }, Name: "fn", }, Value: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 104, Line: 56, }, File: "state_changes_test.flux", Source: "t_state_changes", Start: ast.Position{ Column: 89, Line: 56, }, }, }, Name: "t_state_changes", }, }}, With: nil, }, Params: nil, }, }, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 105, Line: 56, }, File: "state_changes_test.flux", Source: "test monitor_state_changes = () =>\n ({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_state_changes}", Start: ast.Position{ Column: 1, Line: 55, }, }, }, }}, Imports: []*ast.ImportDeclaration{&ast.ImportDeclaration{ As: nil, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 37, Line: 3, }, File: "state_changes_test.flux", Source: "import \"influxdata/influxdb/monitor\"", Start: ast.Position{ Column: 1, Line: 3, }, }, }, Path: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 37, Line: 3, }, File: "state_changes_test.flux", Source: "\"influxdata/influxdb/monitor\"", Start: ast.Position{ Column: 8, Line: 3, }, }, }, Value: "influxdata/influxdb/monitor", }, }, &ast.ImportDeclaration{ As: nil, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 32, Line: 4, }, File: "state_changes_test.flux", Source: "import \"influxdata/influxdb/v1\"", Start: ast.Position{ Column: 1, Line: 4, }, }, }, Path: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 32, Line: 4, }, File: "state_changes_test.flux", Source: "\"influxdata/influxdb/v1\"", Start: ast.Position{ Column: 8, Line: 4, }, }, }, Value: "influxdata/influxdb/v1", }, }, &ast.ImportDeclaration{ As: nil, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 17, Line: 5, }, File: "state_changes_test.flux", Source: "import \"testing\"", Start: ast.Position{ Column: 1, Line: 5, }, }, }, Path: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 17, Line: 5, }, File: "state_changes_test.flux", Source: "\"testing\"", Start: ast.Position{ Column: 8, Line: 5, }, }, }, Value: "testing", }, }, &ast.ImportDeclaration{ As: nil, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 22, Line: 6, }, File: "state_changes_test.flux", Source: "import \"experimental\"", Start: ast.Position{ Column: 1, Line: 6, }, }, }, Path: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 22, Line: 6, }, File: "state_changes_test.flux", Source: "\"experimental\"", Start: ast.Position{ Column: 8, Line: 6, }, }, }, Value: "experimental", }, }}, Name: "state_changes_test.flux", Package: &ast.PackageClause{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 21, Line: 1, }, File: "state_changes_test.flux", Source: "package monitor_test", Start: ast.Position{ Column: 1, Line: 1, }, }, }, Name: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 21, Line: 1, }, File: "state_changes_test.flux", Source: "monitor_test", Start: ast.Position{ Column: 9, Line: 1, }, }, }, Name: "main", }, }, }}, Package: "main", Path: "", }}
Functions ¶
This section is empty.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.