Documentation ¶
Index ¶
Constants ¶
View Source
const DurationKind = "duration"
Variables ¶
View Source
var FluxTestPackages = []*ast.Package{&ast.Package{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: nil, }, Files: []*ast.File{&ast.File{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 98, Line: 52, }, File: "duration_test.flux", Source: "package events_test\n\nimport \"testing\"\nimport \"contrib/tomhollingworth/events\"\n\noption now = () => (2018-05-22T19:54:16Z)\n\ninData = \"\n#datatype,string,long,dateTime:RFC3339,double,string,string,string,string,string,string\n#group,false,false,false,false,true,true,true,true,true,true\n#default,_result,,,,,,,,,\n,result,table,_time,_value,_field,_measurement,device,fstype,host,path\n,,0,2018-05-22T19:53:26Z,34.98234271799806,used_percent,disk,disk1s1,apfs,host.local,/\n,,0,2018-05-22T19:53:36Z,34.98234941084654,used_percent,disk,disk1s1,apfs,host.local,/\n,,0,2018-05-22T19:53:46Z,34.982447293755506,used_percent,disk,disk1s1,apfs,host.local,/\n,,0,2018-05-22T19:53:56Z,34.982447293755506,used_percent,disk,disk1s1,apfs,host.local,/\n,,0,2018-05-22T19:54:06Z,34.98204153981662,used_percent,disk,disk1s1,apfs,host.local,/\n,,0,2018-05-22T19:54:16Z,34.982252364543626,used_percent,disk,disk1s1,apfs,host.local,/\n,,1,2018-05-22T19:53:26Z,34.98234271799806,used_percent,disk,disk1s2,apfs,host.local,/\n,,1,2018-05-22T19:53:36Z,34.98234941084654,used_percent,disk,disk1s2,apfs,host.local,/\n,,1,2018-05-22T19:53:46Z,34.982447293755506,used_percent,disk,disk1s2,apfs,host.local,/\n,,1,2018-05-22T19:53:56Z,34.982447293755506,used_percent,disk,disk1s2,apfs,host.local,/\n,,1,2018-05-22T19:54:06Z,34.98204153981662,used_percent,disk,disk1s2,apfs,host.local,/\n,,1,2018-05-22T19:54:16Z,34.982252364543626,used_percent,disk,disk1s2,apfs,host.local,/\n\"\n\noutData = \"\n#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,dateTime:RFC3339,double,string,string,string,string,string,string,long\n#group,false,false,true,true,false,false,true,true,true,true,true,true,false\n#default,_result,,,,,,,,,,,,\n,result,table,_start,_stop,_time,_value,_field,_measurement,device,fstype,host,path,duration\n,,0,2018-05-22T19:53:26Z,2018-05-22T19:54:36Z,2018-05-22T19:53:26Z,34.98234271799806,used_percent,disk,disk1s1,apfs,host.local,/,10\n,,0,2018-05-22T19:53:26Z,2018-05-22T19:54:36Z,2018-05-22T19:53:36Z,34.98234941084654,used_percent,disk,disk1s1,apfs,host.local,/,10\n,,0,2018-05-22T19:53:26Z,2018-05-22T19:54:36Z,2018-05-22T19:53:46Z,34.982447293755506,used_percent,disk,disk1s1,apfs,host.local,/,10\n,,0,2018-05-22T19:53:26Z,2018-05-22T19:54:36Z,2018-05-22T19:53:56Z,34.982447293755506,used_percent,disk,disk1s1,apfs,host.local,/,10\n,,0,2018-05-22T19:53:26Z,2018-05-22T19:54:36Z,2018-05-22T19:54:06Z,34.98204153981662,used_percent,disk,disk1s1,apfs,host.local,/,10\n,,0,2018-05-22T19:53:26Z,2018-05-22T19:54:36Z,2018-05-22T19:54:16Z,34.982252364543626,used_percent,disk,disk1s1,apfs,host.local,/,20\n,,1,2018-05-22T19:53:26Z,2018-05-22T19:54:36Z,2018-05-22T19:53:26Z,34.98234271799806,used_percent,disk,disk1s2,apfs,host.local,/,10\n,,1,2018-05-22T19:53:26Z,2018-05-22T19:54:36Z,2018-05-22T19:53:36Z,34.98234941084654,used_percent,disk,disk1s2,apfs,host.local,/,10\n,,1,2018-05-22T19:53:26Z,2018-05-22T19:54:36Z,2018-05-22T19:53:46Z,34.982447293755506,used_percent,disk,disk1s2,apfs,host.local,/,10\n,,1,2018-05-22T19:53:26Z,2018-05-22T19:54:36Z,2018-05-22T19:53:56Z,34.982447293755506,used_percent,disk,disk1s2,apfs,host.local,/,10\n,,1,2018-05-22T19:53:26Z,2018-05-22T19:54:36Z,2018-05-22T19:54:06Z,34.98204153981662,used_percent,disk,disk1s2,apfs,host.local,/,10\n,,1,2018-05-22T19:53:26Z,2018-05-22T19:54:36Z,2018-05-22T19:54:16Z,34.982252364543626,used_percent,disk,disk1s2,apfs,host.local,/,20\n\"\n\nt_duration = (table=<-) =>\n\t(table\n |> range(start:2018-05-22T19:53:26Z, stop:2018-05-22T19:54:36Z)\n\t\t|> events.duration())\n\ntest _duration = () =>\n\t({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_duration})", Start: ast.Position{ Column: 1, Line: 1, }, }, }, Body: []ast.Statement{&ast.OptionStatement{ Assignment: &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 6, }, File: "duration_test.flux", Source: "now = () => (2018-05-22T19:54:16Z)", Start: ast.Position{ Column: 8, Line: 6, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 11, Line: 6, }, File: "duration_test.flux", Source: "now", Start: ast.Position{ Column: 8, Line: 6, }, }, }, Name: "now", }, Init: &ast.FunctionExpression{ Arrow: nil, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 6, }, File: "duration_test.flux", Source: "() => (2018-05-22T19:54:16Z)", Start: ast.Position{ Column: 14, Line: 6, }, }, }, Body: &ast.ParenExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 6, }, File: "duration_test.flux", Source: "(2018-05-22T19:54:16Z)", Start: ast.Position{ Column: 20, Line: 6, }, }, }, Expression: &ast.DateTimeLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 41, Line: 6, }, File: "duration_test.flux", Source: "2018-05-22T19:54:16Z", Start: ast.Position{ Column: 21, Line: 6, }, }, }, Value: parser.MustParseTime("2018-05-22T19:54:16Z"), }, Lparen: nil, Rparen: nil, }, Lparen: nil, Params: []*ast.Property{}, Rparan: nil, }, }, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 6, }, File: "duration_test.flux", Source: "option now = () => (2018-05-22T19:54:16Z)", Start: ast.Position{ Column: 1, Line: 6, }, }, }, }, &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 2, Line: 25, }, File: "duration_test.flux", Source: "inData = \"\n#datatype,string,long,dateTime:RFC3339,double,string,string,string,string,string,string\n#group,false,false,false,false,true,true,true,true,true,true\n#default,_result,,,,,,,,,\n,result,table,_time,_value,_field,_measurement,device,fstype,host,path\n,,0,2018-05-22T19:53:26Z,34.98234271799806,used_percent,disk,disk1s1,apfs,host.local,/\n,,0,2018-05-22T19:53:36Z,34.98234941084654,used_percent,disk,disk1s1,apfs,host.local,/\n,,0,2018-05-22T19:53:46Z,34.982447293755506,used_percent,disk,disk1s1,apfs,host.local,/\n,,0,2018-05-22T19:53:56Z,34.982447293755506,used_percent,disk,disk1s1,apfs,host.local,/\n,,0,2018-05-22T19:54:06Z,34.98204153981662,used_percent,disk,disk1s1,apfs,host.local,/\n,,0,2018-05-22T19:54:16Z,34.982252364543626,used_percent,disk,disk1s1,apfs,host.local,/\n,,1,2018-05-22T19:53:26Z,34.98234271799806,used_percent,disk,disk1s2,apfs,host.local,/\n,,1,2018-05-22T19:53:36Z,34.98234941084654,used_percent,disk,disk1s2,apfs,host.local,/\n,,1,2018-05-22T19:53:46Z,34.982447293755506,used_percent,disk,disk1s2,apfs,host.local,/\n,,1,2018-05-22T19:53:56Z,34.982447293755506,used_percent,disk,disk1s2,apfs,host.local,/\n,,1,2018-05-22T19:54:06Z,34.98204153981662,used_percent,disk,disk1s2,apfs,host.local,/\n,,1,2018-05-22T19:54:16Z,34.982252364543626,used_percent,disk,disk1s2,apfs,host.local,/\n\"", Start: ast.Position{ Column: 1, Line: 8, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 7, Line: 8, }, File: "duration_test.flux", Source: "inData", Start: ast.Position{ Column: 1, Line: 8, }, }, }, Name: "inData", }, Init: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 2, Line: 25, }, File: "duration_test.flux", Source: "\"\n#datatype,string,long,dateTime:RFC3339,double,string,string,string,string,string,string\n#group,false,false,false,false,true,true,true,true,true,true\n#default,_result,,,,,,,,,\n,result,table,_time,_value,_field,_measurement,device,fstype,host,path\n,,0,2018-05-22T19:53:26Z,34.98234271799806,used_percent,disk,disk1s1,apfs,host.local,/\n,,0,2018-05-22T19:53:36Z,34.98234941084654,used_percent,disk,disk1s1,apfs,host.local,/\n,,0,2018-05-22T19:53:46Z,34.982447293755506,used_percent,disk,disk1s1,apfs,host.local,/\n,,0,2018-05-22T19:53:56Z,34.982447293755506,used_percent,disk,disk1s1,apfs,host.local,/\n,,0,2018-05-22T19:54:06Z,34.98204153981662,used_percent,disk,disk1s1,apfs,host.local,/\n,,0,2018-05-22T19:54:16Z,34.982252364543626,used_percent,disk,disk1s1,apfs,host.local,/\n,,1,2018-05-22T19:53:26Z,34.98234271799806,used_percent,disk,disk1s2,apfs,host.local,/\n,,1,2018-05-22T19:53:36Z,34.98234941084654,used_percent,disk,disk1s2,apfs,host.local,/\n,,1,2018-05-22T19:53:46Z,34.982447293755506,used_percent,disk,disk1s2,apfs,host.local,/\n,,1,2018-05-22T19:53:56Z,34.982447293755506,used_percent,disk,disk1s2,apfs,host.local,/\n,,1,2018-05-22T19:54:06Z,34.98204153981662,used_percent,disk,disk1s2,apfs,host.local,/\n,,1,2018-05-22T19:54:16Z,34.982252364543626,used_percent,disk,disk1s2,apfs,host.local,/\n\"", Start: ast.Position{ Column: 10, Line: 8, }, }, }, Value: "\n#datatype,string,long,dateTime:RFC3339,double,string,string,string,string,string,string\n#group,false,false,false,false,true,true,true,true,true,true\n#default,_result,,,,,,,,,\n,result,table,_time,_value,_field,_measurement,device,fstype,host,path\n,,0,2018-05-22T19:53:26Z,34.98234271799806,used_percent,disk,disk1s1,apfs,host.local,/\n,,0,2018-05-22T19:53:36Z,34.98234941084654,used_percent,disk,disk1s1,apfs,host.local,/\n,,0,2018-05-22T19:53:46Z,34.982447293755506,used_percent,disk,disk1s1,apfs,host.local,/\n,,0,2018-05-22T19:53:56Z,34.982447293755506,used_percent,disk,disk1s1,apfs,host.local,/\n,,0,2018-05-22T19:54:06Z,34.98204153981662,used_percent,disk,disk1s1,apfs,host.local,/\n,,0,2018-05-22T19:54:16Z,34.982252364543626,used_percent,disk,disk1s1,apfs,host.local,/\n,,1,2018-05-22T19:53:26Z,34.98234271799806,used_percent,disk,disk1s2,apfs,host.local,/\n,,1,2018-05-22T19:53:36Z,34.98234941084654,used_percent,disk,disk1s2,apfs,host.local,/\n,,1,2018-05-22T19:53:46Z,34.982447293755506,used_percent,disk,disk1s2,apfs,host.local,/\n,,1,2018-05-22T19:53:56Z,34.982447293755506,used_percent,disk,disk1s2,apfs,host.local,/\n,,1,2018-05-22T19:54:06Z,34.98204153981662,used_percent,disk,disk1s2,apfs,host.local,/\n,,1,2018-05-22T19:54:16Z,34.982252364543626,used_percent,disk,disk1s2,apfs,host.local,/\n", }, }, &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 2, Line: 44, }, File: "duration_test.flux", Source: "outData = \"\n#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,dateTime:RFC3339,double,string,string,string,string,string,string,long\n#group,false,false,true,true,false,false,true,true,true,true,true,true,false\n#default,_result,,,,,,,,,,,,\n,result,table,_start,_stop,_time,_value,_field,_measurement,device,fstype,host,path,duration\n,,0,2018-05-22T19:53:26Z,2018-05-22T19:54:36Z,2018-05-22T19:53:26Z,34.98234271799806,used_percent,disk,disk1s1,apfs,host.local,/,10\n,,0,2018-05-22T19:53:26Z,2018-05-22T19:54:36Z,2018-05-22T19:53:36Z,34.98234941084654,used_percent,disk,disk1s1,apfs,host.local,/,10\n,,0,2018-05-22T19:53:26Z,2018-05-22T19:54:36Z,2018-05-22T19:53:46Z,34.982447293755506,used_percent,disk,disk1s1,apfs,host.local,/,10\n,,0,2018-05-22T19:53:26Z,2018-05-22T19:54:36Z,2018-05-22T19:53:56Z,34.982447293755506,used_percent,disk,disk1s1,apfs,host.local,/,10\n,,0,2018-05-22T19:53:26Z,2018-05-22T19:54:36Z,2018-05-22T19:54:06Z,34.98204153981662,used_percent,disk,disk1s1,apfs,host.local,/,10\n,,0,2018-05-22T19:53:26Z,2018-05-22T19:54:36Z,2018-05-22T19:54:16Z,34.982252364543626,used_percent,disk,disk1s1,apfs,host.local,/,20\n,,1,2018-05-22T19:53:26Z,2018-05-22T19:54:36Z,2018-05-22T19:53:26Z,34.98234271799806,used_percent,disk,disk1s2,apfs,host.local,/,10\n,,1,2018-05-22T19:53:26Z,2018-05-22T19:54:36Z,2018-05-22T19:53:36Z,34.98234941084654,used_percent,disk,disk1s2,apfs,host.local,/,10\n,,1,2018-05-22T19:53:26Z,2018-05-22T19:54:36Z,2018-05-22T19:53:46Z,34.982447293755506,used_percent,disk,disk1s2,apfs,host.local,/,10\n,,1,2018-05-22T19:53:26Z,2018-05-22T19:54:36Z,2018-05-22T19:53:56Z,34.982447293755506,used_percent,disk,disk1s2,apfs,host.local,/,10\n,,1,2018-05-22T19:53:26Z,2018-05-22T19:54:36Z,2018-05-22T19:54:06Z,34.98204153981662,used_percent,disk,disk1s2,apfs,host.local,/,10\n,,1,2018-05-22T19:53:26Z,2018-05-22T19:54:36Z,2018-05-22T19:54:16Z,34.982252364543626,used_percent,disk,disk1s2,apfs,host.local,/,20\n\"", Start: ast.Position{ Column: 1, Line: 27, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 8, Line: 27, }, File: "duration_test.flux", Source: "outData", Start: ast.Position{ Column: 1, Line: 27, }, }, }, Name: "outData", }, Init: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 2, Line: 44, }, File: "duration_test.flux", Source: "\"\n#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,dateTime:RFC3339,double,string,string,string,string,string,string,long\n#group,false,false,true,true,false,false,true,true,true,true,true,true,false\n#default,_result,,,,,,,,,,,,\n,result,table,_start,_stop,_time,_value,_field,_measurement,device,fstype,host,path,duration\n,,0,2018-05-22T19:53:26Z,2018-05-22T19:54:36Z,2018-05-22T19:53:26Z,34.98234271799806,used_percent,disk,disk1s1,apfs,host.local,/,10\n,,0,2018-05-22T19:53:26Z,2018-05-22T19:54:36Z,2018-05-22T19:53:36Z,34.98234941084654,used_percent,disk,disk1s1,apfs,host.local,/,10\n,,0,2018-05-22T19:53:26Z,2018-05-22T19:54:36Z,2018-05-22T19:53:46Z,34.982447293755506,used_percent,disk,disk1s1,apfs,host.local,/,10\n,,0,2018-05-22T19:53:26Z,2018-05-22T19:54:36Z,2018-05-22T19:53:56Z,34.982447293755506,used_percent,disk,disk1s1,apfs,host.local,/,10\n,,0,2018-05-22T19:53:26Z,2018-05-22T19:54:36Z,2018-05-22T19:54:06Z,34.98204153981662,used_percent,disk,disk1s1,apfs,host.local,/,10\n,,0,2018-05-22T19:53:26Z,2018-05-22T19:54:36Z,2018-05-22T19:54:16Z,34.982252364543626,used_percent,disk,disk1s1,apfs,host.local,/,20\n,,1,2018-05-22T19:53:26Z,2018-05-22T19:54:36Z,2018-05-22T19:53:26Z,34.98234271799806,used_percent,disk,disk1s2,apfs,host.local,/,10\n,,1,2018-05-22T19:53:26Z,2018-05-22T19:54:36Z,2018-05-22T19:53:36Z,34.98234941084654,used_percent,disk,disk1s2,apfs,host.local,/,10\n,,1,2018-05-22T19:53:26Z,2018-05-22T19:54:36Z,2018-05-22T19:53:46Z,34.982447293755506,used_percent,disk,disk1s2,apfs,host.local,/,10\n,,1,2018-05-22T19:53:26Z,2018-05-22T19:54:36Z,2018-05-22T19:53:56Z,34.982447293755506,used_percent,disk,disk1s2,apfs,host.local,/,10\n,,1,2018-05-22T19:53:26Z,2018-05-22T19:54:36Z,2018-05-22T19:54:06Z,34.98204153981662,used_percent,disk,disk1s2,apfs,host.local,/,10\n,,1,2018-05-22T19:53:26Z,2018-05-22T19:54:36Z,2018-05-22T19:54:16Z,34.982252364543626,used_percent,disk,disk1s2,apfs,host.local,/,20\n\"", Start: ast.Position{ Column: 11, Line: 27, }, }, }, Value: "\n#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,dateTime:RFC3339,double,string,string,string,string,string,string,long\n#group,false,false,true,true,false,false,true,true,true,true,true,true,false\n#default,_result,,,,,,,,,,,,\n,result,table,_start,_stop,_time,_value,_field,_measurement,device,fstype,host,path,duration\n,,0,2018-05-22T19:53:26Z,2018-05-22T19:54:36Z,2018-05-22T19:53:26Z,34.98234271799806,used_percent,disk,disk1s1,apfs,host.local,/,10\n,,0,2018-05-22T19:53:26Z,2018-05-22T19:54:36Z,2018-05-22T19:53:36Z,34.98234941084654,used_percent,disk,disk1s1,apfs,host.local,/,10\n,,0,2018-05-22T19:53:26Z,2018-05-22T19:54:36Z,2018-05-22T19:53:46Z,34.982447293755506,used_percent,disk,disk1s1,apfs,host.local,/,10\n,,0,2018-05-22T19:53:26Z,2018-05-22T19:54:36Z,2018-05-22T19:53:56Z,34.982447293755506,used_percent,disk,disk1s1,apfs,host.local,/,10\n,,0,2018-05-22T19:53:26Z,2018-05-22T19:54:36Z,2018-05-22T19:54:06Z,34.98204153981662,used_percent,disk,disk1s1,apfs,host.local,/,10\n,,0,2018-05-22T19:53:26Z,2018-05-22T19:54:36Z,2018-05-22T19:54:16Z,34.982252364543626,used_percent,disk,disk1s1,apfs,host.local,/,20\n,,1,2018-05-22T19:53:26Z,2018-05-22T19:54:36Z,2018-05-22T19:53:26Z,34.98234271799806,used_percent,disk,disk1s2,apfs,host.local,/,10\n,,1,2018-05-22T19:53:26Z,2018-05-22T19:54:36Z,2018-05-22T19:53:36Z,34.98234941084654,used_percent,disk,disk1s2,apfs,host.local,/,10\n,,1,2018-05-22T19:53:26Z,2018-05-22T19:54:36Z,2018-05-22T19:53:46Z,34.982447293755506,used_percent,disk,disk1s2,apfs,host.local,/,10\n,,1,2018-05-22T19:53:26Z,2018-05-22T19:54:36Z,2018-05-22T19:53:56Z,34.982447293755506,used_percent,disk,disk1s2,apfs,host.local,/,10\n,,1,2018-05-22T19:53:26Z,2018-05-22T19:54:36Z,2018-05-22T19:54:06Z,34.98204153981662,used_percent,disk,disk1s2,apfs,host.local,/,10\n,,1,2018-05-22T19:53:26Z,2018-05-22T19:54:36Z,2018-05-22T19:54:16Z,34.982252364543626,used_percent,disk,disk1s2,apfs,host.local,/,20\n", }, }, &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 24, Line: 49, }, File: "duration_test.flux", Source: "t_duration = (table=<-) =>\n\t(table\n |> range(start:2018-05-22T19:53:26Z, stop:2018-05-22T19:54:36Z)\n\t\t|> events.duration())", Start: ast.Position{ Column: 1, Line: 46, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 11, Line: 46, }, File: "duration_test.flux", Source: "t_duration", Start: ast.Position{ Column: 1, Line: 46, }, }, }, Name: "t_duration", }, Init: &ast.FunctionExpression{ Arrow: nil, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 24, Line: 49, }, File: "duration_test.flux", Source: "(table=<-) =>\n\t(table\n |> range(start:2018-05-22T19:53:26Z, stop:2018-05-22T19:54:36Z)\n\t\t|> events.duration())", Start: ast.Position{ Column: 14, Line: 46, }, }, }, Body: &ast.ParenExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 24, Line: 49, }, File: "duration_test.flux", Source: "(table\n |> range(start:2018-05-22T19:53:26Z, stop:2018-05-22T19:54:36Z)\n\t\t|> events.duration())", Start: ast.Position{ Column: 2, Line: 47, }, }, }, Expression: &ast.PipeExpression{ Argument: &ast.PipeExpression{ Argument: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 8, Line: 47, }, File: "duration_test.flux", Source: "table", Start: ast.Position{ Column: 3, Line: 47, }, }, }, Name: "table", }, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 72, Line: 48, }, File: "duration_test.flux", Source: "table\n |> range(start:2018-05-22T19:53:26Z, stop:2018-05-22T19:54:36Z)", Start: ast.Position{ Column: 3, Line: 47, }, }, }, Call: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 71, Line: 48, }, File: "duration_test.flux", Source: "start:2018-05-22T19:53:26Z, stop:2018-05-22T19:54:36Z", Start: ast.Position{ Column: 18, Line: 48, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 44, Line: 48, }, File: "duration_test.flux", Source: "start:2018-05-22T19:53:26Z", Start: ast.Position{ Column: 18, Line: 48, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 23, Line: 48, }, File: "duration_test.flux", Source: "start", Start: ast.Position{ Column: 18, Line: 48, }, }, }, Name: "start", }, Separator: nil, Value: &ast.DateTimeLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 44, Line: 48, }, File: "duration_test.flux", Source: "2018-05-22T19:53:26Z", Start: ast.Position{ Column: 24, Line: 48, }, }, }, Value: parser.MustParseTime("2018-05-22T19:53:26Z"), }, }, &ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 71, Line: 48, }, File: "duration_test.flux", Source: "stop:2018-05-22T19:54:36Z", Start: ast.Position{ Column: 46, Line: 48, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 50, Line: 48, }, File: "duration_test.flux", Source: "stop", Start: ast.Position{ Column: 46, Line: 48, }, }, }, Name: "stop", }, Separator: nil, Value: &ast.DateTimeLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 71, Line: 48, }, File: "duration_test.flux", Source: "2018-05-22T19:54:36Z", Start: ast.Position{ Column: 51, Line: 48, }, }, }, Value: parser.MustParseTime("2018-05-22T19:54:36Z"), }, }}, Rbrace: nil, With: nil, }}, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 72, Line: 48, }, File: "duration_test.flux", Source: "range(start:2018-05-22T19:53:26Z, stop:2018-05-22T19:54:36Z)", Start: ast.Position{ Column: 12, Line: 48, }, }, }, Callee: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 17, Line: 48, }, File: "duration_test.flux", Source: "range", Start: ast.Position{ Column: 12, Line: 48, }, }, }, Name: "range", }, Lparen: nil, Rparen: nil, }, }, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 23, Line: 49, }, File: "duration_test.flux", Source: "table\n |> range(start:2018-05-22T19:53:26Z, stop:2018-05-22T19:54:36Z)\n\t\t|> events.duration()", Start: ast.Position{ Column: 3, Line: 47, }, }, }, Call: &ast.CallExpression{ Arguments: nil, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 23, Line: 49, }, File: "duration_test.flux", Source: "events.duration()", Start: ast.Position{ Column: 6, Line: 49, }, }, }, Callee: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 21, Line: 49, }, File: "duration_test.flux", Source: "events.duration", Start: ast.Position{ Column: 6, Line: 49, }, }, }, Lbrack: nil, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 12, Line: 49, }, File: "duration_test.flux", Source: "events", Start: ast.Position{ Column: 6, Line: 49, }, }, }, Name: "events", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 21, Line: 49, }, File: "duration_test.flux", Source: "duration", Start: ast.Position{ Column: 13, Line: 49, }, }, }, Name: "duration", }, Rbrack: nil, }, Lparen: nil, Rparen: nil, }, }, Lparen: nil, Rparen: nil, }, Lparen: nil, Params: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 23, Line: 46, }, File: "duration_test.flux", Source: "table=<-", Start: ast.Position{ Column: 15, Line: 46, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 20, Line: 46, }, File: "duration_test.flux", Source: "table", Start: ast.Position{ Column: 15, Line: 46, }, }, }, Name: "table", }, Separator: nil, Value: &ast.PipeLiteral{BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 23, Line: 46, }, File: "duration_test.flux", Source: "<-", Start: ast.Position{ Column: 21, Line: 46, }, }, }}, }}, Rparan: nil, }, }, &ast.TestStatement{ Assignment: &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 98, Line: 52, }, File: "duration_test.flux", Source: "_duration = () =>\n\t({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_duration})", Start: ast.Position{ Column: 6, Line: 51, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 15, Line: 51, }, File: "duration_test.flux", Source: "_duration", Start: ast.Position{ Column: 6, Line: 51, }, }, }, Name: "_duration", }, Init: &ast.FunctionExpression{ Arrow: nil, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 98, Line: 52, }, File: "duration_test.flux", Source: "() =>\n\t({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_duration})", Start: ast.Position{ Column: 18, Line: 51, }, }, }, Body: &ast.ParenExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 98, Line: 52, }, File: "duration_test.flux", Source: "({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_duration})", Start: ast.Position{ Column: 2, Line: 52, }, }, }, Expression: &ast.ObjectExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 97, Line: 52, }, File: "duration_test.flux", Source: "{input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_duration}", Start: ast.Position{ Column: 3, Line: 52, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 43, Line: 52, }, File: "duration_test.flux", Source: "input: testing.loadStorage(csv: inData)", Start: ast.Position{ Column: 4, Line: 52, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 9, Line: 52, }, File: "duration_test.flux", Source: "input", Start: ast.Position{ Column: 4, Line: 52, }, }, }, Name: "input", }, Separator: nil, Value: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 52, }, File: "duration_test.flux", Source: "csv: inData", Start: ast.Position{ Column: 31, Line: 52, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 52, }, File: "duration_test.flux", Source: "csv: inData", Start: ast.Position{ Column: 31, Line: 52, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 34, Line: 52, }, File: "duration_test.flux", Source: "csv", Start: ast.Position{ Column: 31, Line: 52, }, }, }, Name: "csv", }, Separator: nil, Value: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 52, }, File: "duration_test.flux", Source: "inData", Start: ast.Position{ Column: 36, Line: 52, }, }, }, Name: "inData", }, }}, Rbrace: nil, With: nil, }}, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 43, Line: 52, }, File: "duration_test.flux", Source: "testing.loadStorage(csv: inData)", Start: ast.Position{ Column: 11, Line: 52, }, }, }, Callee: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 30, Line: 52, }, File: "duration_test.flux", Source: "testing.loadStorage", Start: ast.Position{ Column: 11, Line: 52, }, }, }, Lbrack: nil, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 18, Line: 52, }, File: "duration_test.flux", Source: "testing", Start: ast.Position{ Column: 11, Line: 52, }, }, }, Name: "testing", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 30, Line: 52, }, File: "duration_test.flux", Source: "loadStorage", Start: ast.Position{ Column: 19, Line: 52, }, }, }, Name: "loadStorage", }, Rbrack: nil, }, Lparen: nil, Rparen: nil, }, }, &ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 80, Line: 52, }, File: "duration_test.flux", Source: "want: testing.loadMem(csv: outData)", Start: ast.Position{ Column: 45, Line: 52, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 49, Line: 52, }, File: "duration_test.flux", Source: "want", Start: ast.Position{ Column: 45, Line: 52, }, }, }, Name: "want", }, Separator: nil, Value: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 79, Line: 52, }, File: "duration_test.flux", Source: "csv: outData", Start: ast.Position{ Column: 67, Line: 52, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 79, Line: 52, }, File: "duration_test.flux", Source: "csv: outData", Start: ast.Position{ Column: 67, Line: 52, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 70, Line: 52, }, File: "duration_test.flux", Source: "csv", Start: ast.Position{ Column: 67, Line: 52, }, }, }, Name: "csv", }, Separator: nil, Value: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 79, Line: 52, }, File: "duration_test.flux", Source: "outData", Start: ast.Position{ Column: 72, Line: 52, }, }, }, Name: "outData", }, }}, Rbrace: nil, With: nil, }}, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 80, Line: 52, }, File: "duration_test.flux", Source: "testing.loadMem(csv: outData)", Start: ast.Position{ Column: 51, Line: 52, }, }, }, Callee: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 66, Line: 52, }, File: "duration_test.flux", Source: "testing.loadMem", Start: ast.Position{ Column: 51, Line: 52, }, }, }, Lbrack: nil, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 58, Line: 52, }, File: "duration_test.flux", Source: "testing", Start: ast.Position{ Column: 51, Line: 52, }, }, }, Name: "testing", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 66, Line: 52, }, File: "duration_test.flux", Source: "loadMem", Start: ast.Position{ Column: 59, Line: 52, }, }, }, Name: "loadMem", }, Rbrack: nil, }, Lparen: nil, Rparen: nil, }, }, &ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 96, Line: 52, }, File: "duration_test.flux", Source: "fn: t_duration", Start: ast.Position{ Column: 82, Line: 52, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 84, Line: 52, }, File: "duration_test.flux", Source: "fn", Start: ast.Position{ Column: 82, Line: 52, }, }, }, Name: "fn", }, Separator: nil, Value: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 96, Line: 52, }, File: "duration_test.flux", Source: "t_duration", Start: ast.Position{ Column: 86, Line: 52, }, }, }, Name: "t_duration", }, }}, Rbrace: nil, With: nil, }, Lparen: nil, Rparen: nil, }, Lparen: nil, Params: []*ast.Property{}, Rparan: nil, }, }, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 98, Line: 52, }, File: "duration_test.flux", Source: "test _duration = () =>\n\t({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_duration})", Start: ast.Position{ Column: 1, Line: 51, }, }, }, }}, Eof: nil, Imports: []*ast.ImportDeclaration{&ast.ImportDeclaration{ As: nil, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 17, Line: 3, }, File: "duration_test.flux", Source: "import \"testing\"", Start: ast.Position{ Column: 1, Line: 3, }, }, }, Path: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 17, Line: 3, }, File: "duration_test.flux", Source: "\"testing\"", Start: ast.Position{ Column: 8, Line: 3, }, }, }, Value: "testing", }, }, &ast.ImportDeclaration{ As: nil, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 40, Line: 4, }, File: "duration_test.flux", Source: "import \"contrib/tomhollingworth/events\"", Start: ast.Position{ Column: 1, Line: 4, }, }, }, Path: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 40, Line: 4, }, File: "duration_test.flux", Source: "\"contrib/tomhollingworth/events\"", Start: ast.Position{ Column: 8, Line: 4, }, }, }, Value: "contrib/tomhollingworth/events", }, }}, Metadata: "parser-type=rust", Name: "duration_test.flux", Package: &ast.PackageClause{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 20, Line: 1, }, File: "duration_test.flux", Source: "package events_test", Start: ast.Position{ Column: 1, Line: 1, }, }, }, Name: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 20, Line: 1, }, File: "duration_test.flux", Source: "events_test", Start: ast.Position{ Column: 9, Line: 1, }, }, }, Name: "events_test", }, }, }, &ast.File{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 98, Line: 52, }, File: "duration_with_stop_test.flux", Source: "package events_test\n\nimport \"testing\"\nimport \"contrib/tomhollingworth/events\"\n\noption now = () => (2018-05-22T19:54:16Z)\n\ninData = \"\n#datatype,string,long,dateTime:RFC3339,double,string,string,string,string,string,string\n#group,false,false,false,false,true,true,true,true,true,true\n#default,_result,,,,,,,,,\n,result,table,_time,_value,_field,_measurement,device,fstype,host,path\n,,0,2018-05-22T19:53:26Z,34.98234271799806,used_percent,disk,disk1s1,apfs,host.local,/\n,,0,2018-05-22T19:53:36Z,34.98234941084654,used_percent,disk,disk1s1,apfs,host.local,/\n,,0,2018-05-22T19:53:46Z,34.982447293755506,used_percent,disk,disk1s1,apfs,host.local,/\n,,0,2018-05-22T19:53:56Z,34.982447293755506,used_percent,disk,disk1s1,apfs,host.local,/\n,,0,2018-05-22T19:54:06Z,34.98204153981662,used_percent,disk,disk1s1,apfs,host.local,/\n,,0,2018-05-22T19:54:16Z,34.982252364543626,used_percent,disk,disk1s1,apfs,host.local,/\n,,1,2018-05-22T19:53:26Z,34.98234271799806,used_percent,disk,disk1s2,apfs,host.local,/\n,,1,2018-05-22T19:53:36Z,34.98234941084654,used_percent,disk,disk1s2,apfs,host.local,/\n,,1,2018-05-22T19:53:46Z,34.982447293755506,used_percent,disk,disk1s2,apfs,host.local,/\n,,1,2018-05-22T19:53:56Z,34.982447293755506,used_percent,disk,disk1s2,apfs,host.local,/\n,,1,2018-05-22T19:54:06Z,34.98204153981662,used_percent,disk,disk1s2,apfs,host.local,/\n,,1,2018-05-22T19:54:16Z,34.982252364543626,used_percent,disk,disk1s2,apfs,host.local,/\n\"\n\noutData = \"\n#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,dateTime:RFC3339,double,string,string,string,string,string,string,long\n#group,false,false,true,true,false,false,true,true,true,true,true,true,false\n#default,_result,,,,,,,,,,,,\n,result,table,_start,_stop,_time,_value,_field,_measurement,device,fstype,host,path,duration\n,,0,2018-05-22T19:53:26Z,2018-05-22T19:54:36Z,2018-05-22T19:53:26Z,34.98234271799806,used_percent,disk,disk1s1,apfs,host.local,/,10\n,,0,2018-05-22T19:53:26Z,2018-05-22T19:54:36Z,2018-05-22T19:53:36Z,34.98234941084654,used_percent,disk,disk1s1,apfs,host.local,/,10\n,,0,2018-05-22T19:53:26Z,2018-05-22T19:54:36Z,2018-05-22T19:53:46Z,34.982447293755506,used_percent,disk,disk1s1,apfs,host.local,/,10\n,,0,2018-05-22T19:53:26Z,2018-05-22T19:54:36Z,2018-05-22T19:53:56Z,34.982447293755506,used_percent,disk,disk1s1,apfs,host.local,/,10\n,,0,2018-05-22T19:53:26Z,2018-05-22T19:54:36Z,2018-05-22T19:54:06Z,34.98204153981662,used_percent,disk,disk1s1,apfs,host.local,/,10\n,,0,2018-05-22T19:53:26Z,2018-05-22T19:54:36Z,2018-05-22T19:54:16Z,34.982252364543626,used_percent,disk,disk1s1,apfs,host.local,/,30\n,,1,2018-05-22T19:53:26Z,2018-05-22T19:54:36Z,2018-05-22T19:53:26Z,34.98234271799806,used_percent,disk,disk1s2,apfs,host.local,/,10\n,,1,2018-05-22T19:53:26Z,2018-05-22T19:54:36Z,2018-05-22T19:53:36Z,34.98234941084654,used_percent,disk,disk1s2,apfs,host.local,/,10\n,,1,2018-05-22T19:53:26Z,2018-05-22T19:54:36Z,2018-05-22T19:53:46Z,34.982447293755506,used_percent,disk,disk1s2,apfs,host.local,/,10\n,,1,2018-05-22T19:53:26Z,2018-05-22T19:54:36Z,2018-05-22T19:53:56Z,34.982447293755506,used_percent,disk,disk1s2,apfs,host.local,/,10\n,,1,2018-05-22T19:53:26Z,2018-05-22T19:54:36Z,2018-05-22T19:54:06Z,34.98204153981662,used_percent,disk,disk1s2,apfs,host.local,/,10\n,,1,2018-05-22T19:53:26Z,2018-05-22T19:54:36Z,2018-05-22T19:54:16Z,34.982252364543626,used_percent,disk,disk1s2,apfs,host.local,/,30\n\"\n\nt_duration = (table=<-) =>\n\t(table\n |> range(start:2018-05-22T19:53:26Z, stop:2018-05-22T19:54:36Z)\n\t\t|> events.duration(stop: 2018-05-22T19:54:46Z))\n\ntest _duration = () =>\n\t({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_duration})", Start: ast.Position{ Column: 1, Line: 1, }, }, }, Body: []ast.Statement{&ast.OptionStatement{ Assignment: &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 6, }, File: "duration_with_stop_test.flux", Source: "now = () => (2018-05-22T19:54:16Z)", Start: ast.Position{ Column: 8, Line: 6, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 11, Line: 6, }, File: "duration_with_stop_test.flux", Source: "now", Start: ast.Position{ Column: 8, Line: 6, }, }, }, Name: "now", }, Init: &ast.FunctionExpression{ Arrow: nil, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 6, }, File: "duration_with_stop_test.flux", Source: "() => (2018-05-22T19:54:16Z)", Start: ast.Position{ Column: 14, Line: 6, }, }, }, Body: &ast.ParenExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 6, }, File: "duration_with_stop_test.flux", Source: "(2018-05-22T19:54:16Z)", Start: ast.Position{ Column: 20, Line: 6, }, }, }, Expression: &ast.DateTimeLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 41, Line: 6, }, File: "duration_with_stop_test.flux", Source: "2018-05-22T19:54:16Z", Start: ast.Position{ Column: 21, Line: 6, }, }, }, Value: parser.MustParseTime("2018-05-22T19:54:16Z"), }, Lparen: nil, Rparen: nil, }, Lparen: nil, Params: []*ast.Property{}, Rparan: nil, }, }, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 6, }, File: "duration_with_stop_test.flux", Source: "option now = () => (2018-05-22T19:54:16Z)", Start: ast.Position{ Column: 1, Line: 6, }, }, }, }, &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 2, Line: 25, }, File: "duration_with_stop_test.flux", Source: "inData = \"\n#datatype,string,long,dateTime:RFC3339,double,string,string,string,string,string,string\n#group,false,false,false,false,true,true,true,true,true,true\n#default,_result,,,,,,,,,\n,result,table,_time,_value,_field,_measurement,device,fstype,host,path\n,,0,2018-05-22T19:53:26Z,34.98234271799806,used_percent,disk,disk1s1,apfs,host.local,/\n,,0,2018-05-22T19:53:36Z,34.98234941084654,used_percent,disk,disk1s1,apfs,host.local,/\n,,0,2018-05-22T19:53:46Z,34.982447293755506,used_percent,disk,disk1s1,apfs,host.local,/\n,,0,2018-05-22T19:53:56Z,34.982447293755506,used_percent,disk,disk1s1,apfs,host.local,/\n,,0,2018-05-22T19:54:06Z,34.98204153981662,used_percent,disk,disk1s1,apfs,host.local,/\n,,0,2018-05-22T19:54:16Z,34.982252364543626,used_percent,disk,disk1s1,apfs,host.local,/\n,,1,2018-05-22T19:53:26Z,34.98234271799806,used_percent,disk,disk1s2,apfs,host.local,/\n,,1,2018-05-22T19:53:36Z,34.98234941084654,used_percent,disk,disk1s2,apfs,host.local,/\n,,1,2018-05-22T19:53:46Z,34.982447293755506,used_percent,disk,disk1s2,apfs,host.local,/\n,,1,2018-05-22T19:53:56Z,34.982447293755506,used_percent,disk,disk1s2,apfs,host.local,/\n,,1,2018-05-22T19:54:06Z,34.98204153981662,used_percent,disk,disk1s2,apfs,host.local,/\n,,1,2018-05-22T19:54:16Z,34.982252364543626,used_percent,disk,disk1s2,apfs,host.local,/\n\"", Start: ast.Position{ Column: 1, Line: 8, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 7, Line: 8, }, File: "duration_with_stop_test.flux", Source: "inData", Start: ast.Position{ Column: 1, Line: 8, }, }, }, Name: "inData", }, Init: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 2, Line: 25, }, File: "duration_with_stop_test.flux", Source: "\"\n#datatype,string,long,dateTime:RFC3339,double,string,string,string,string,string,string\n#group,false,false,false,false,true,true,true,true,true,true\n#default,_result,,,,,,,,,\n,result,table,_time,_value,_field,_measurement,device,fstype,host,path\n,,0,2018-05-22T19:53:26Z,34.98234271799806,used_percent,disk,disk1s1,apfs,host.local,/\n,,0,2018-05-22T19:53:36Z,34.98234941084654,used_percent,disk,disk1s1,apfs,host.local,/\n,,0,2018-05-22T19:53:46Z,34.982447293755506,used_percent,disk,disk1s1,apfs,host.local,/\n,,0,2018-05-22T19:53:56Z,34.982447293755506,used_percent,disk,disk1s1,apfs,host.local,/\n,,0,2018-05-22T19:54:06Z,34.98204153981662,used_percent,disk,disk1s1,apfs,host.local,/\n,,0,2018-05-22T19:54:16Z,34.982252364543626,used_percent,disk,disk1s1,apfs,host.local,/\n,,1,2018-05-22T19:53:26Z,34.98234271799806,used_percent,disk,disk1s2,apfs,host.local,/\n,,1,2018-05-22T19:53:36Z,34.98234941084654,used_percent,disk,disk1s2,apfs,host.local,/\n,,1,2018-05-22T19:53:46Z,34.982447293755506,used_percent,disk,disk1s2,apfs,host.local,/\n,,1,2018-05-22T19:53:56Z,34.982447293755506,used_percent,disk,disk1s2,apfs,host.local,/\n,,1,2018-05-22T19:54:06Z,34.98204153981662,used_percent,disk,disk1s2,apfs,host.local,/\n,,1,2018-05-22T19:54:16Z,34.982252364543626,used_percent,disk,disk1s2,apfs,host.local,/\n\"", Start: ast.Position{ Column: 10, Line: 8, }, }, }, Value: "\n#datatype,string,long,dateTime:RFC3339,double,string,string,string,string,string,string\n#group,false,false,false,false,true,true,true,true,true,true\n#default,_result,,,,,,,,,\n,result,table,_time,_value,_field,_measurement,device,fstype,host,path\n,,0,2018-05-22T19:53:26Z,34.98234271799806,used_percent,disk,disk1s1,apfs,host.local,/\n,,0,2018-05-22T19:53:36Z,34.98234941084654,used_percent,disk,disk1s1,apfs,host.local,/\n,,0,2018-05-22T19:53:46Z,34.982447293755506,used_percent,disk,disk1s1,apfs,host.local,/\n,,0,2018-05-22T19:53:56Z,34.982447293755506,used_percent,disk,disk1s1,apfs,host.local,/\n,,0,2018-05-22T19:54:06Z,34.98204153981662,used_percent,disk,disk1s1,apfs,host.local,/\n,,0,2018-05-22T19:54:16Z,34.982252364543626,used_percent,disk,disk1s1,apfs,host.local,/\n,,1,2018-05-22T19:53:26Z,34.98234271799806,used_percent,disk,disk1s2,apfs,host.local,/\n,,1,2018-05-22T19:53:36Z,34.98234941084654,used_percent,disk,disk1s2,apfs,host.local,/\n,,1,2018-05-22T19:53:46Z,34.982447293755506,used_percent,disk,disk1s2,apfs,host.local,/\n,,1,2018-05-22T19:53:56Z,34.982447293755506,used_percent,disk,disk1s2,apfs,host.local,/\n,,1,2018-05-22T19:54:06Z,34.98204153981662,used_percent,disk,disk1s2,apfs,host.local,/\n,,1,2018-05-22T19:54:16Z,34.982252364543626,used_percent,disk,disk1s2,apfs,host.local,/\n", }, }, &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 2, Line: 44, }, File: "duration_with_stop_test.flux", Source: "outData = \"\n#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,dateTime:RFC3339,double,string,string,string,string,string,string,long\n#group,false,false,true,true,false,false,true,true,true,true,true,true,false\n#default,_result,,,,,,,,,,,,\n,result,table,_start,_stop,_time,_value,_field,_measurement,device,fstype,host,path,duration\n,,0,2018-05-22T19:53:26Z,2018-05-22T19:54:36Z,2018-05-22T19:53:26Z,34.98234271799806,used_percent,disk,disk1s1,apfs,host.local,/,10\n,,0,2018-05-22T19:53:26Z,2018-05-22T19:54:36Z,2018-05-22T19:53:36Z,34.98234941084654,used_percent,disk,disk1s1,apfs,host.local,/,10\n,,0,2018-05-22T19:53:26Z,2018-05-22T19:54:36Z,2018-05-22T19:53:46Z,34.982447293755506,used_percent,disk,disk1s1,apfs,host.local,/,10\n,,0,2018-05-22T19:53:26Z,2018-05-22T19:54:36Z,2018-05-22T19:53:56Z,34.982447293755506,used_percent,disk,disk1s1,apfs,host.local,/,10\n,,0,2018-05-22T19:53:26Z,2018-05-22T19:54:36Z,2018-05-22T19:54:06Z,34.98204153981662,used_percent,disk,disk1s1,apfs,host.local,/,10\n,,0,2018-05-22T19:53:26Z,2018-05-22T19:54:36Z,2018-05-22T19:54:16Z,34.982252364543626,used_percent,disk,disk1s1,apfs,host.local,/,30\n,,1,2018-05-22T19:53:26Z,2018-05-22T19:54:36Z,2018-05-22T19:53:26Z,34.98234271799806,used_percent,disk,disk1s2,apfs,host.local,/,10\n,,1,2018-05-22T19:53:26Z,2018-05-22T19:54:36Z,2018-05-22T19:53:36Z,34.98234941084654,used_percent,disk,disk1s2,apfs,host.local,/,10\n,,1,2018-05-22T19:53:26Z,2018-05-22T19:54:36Z,2018-05-22T19:53:46Z,34.982447293755506,used_percent,disk,disk1s2,apfs,host.local,/,10\n,,1,2018-05-22T19:53:26Z,2018-05-22T19:54:36Z,2018-05-22T19:53:56Z,34.982447293755506,used_percent,disk,disk1s2,apfs,host.local,/,10\n,,1,2018-05-22T19:53:26Z,2018-05-22T19:54:36Z,2018-05-22T19:54:06Z,34.98204153981662,used_percent,disk,disk1s2,apfs,host.local,/,10\n,,1,2018-05-22T19:53:26Z,2018-05-22T19:54:36Z,2018-05-22T19:54:16Z,34.982252364543626,used_percent,disk,disk1s2,apfs,host.local,/,30\n\"", Start: ast.Position{ Column: 1, Line: 27, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 8, Line: 27, }, File: "duration_with_stop_test.flux", Source: "outData", Start: ast.Position{ Column: 1, Line: 27, }, }, }, Name: "outData", }, Init: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 2, Line: 44, }, File: "duration_with_stop_test.flux", Source: "\"\n#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,dateTime:RFC3339,double,string,string,string,string,string,string,long\n#group,false,false,true,true,false,false,true,true,true,true,true,true,false\n#default,_result,,,,,,,,,,,,\n,result,table,_start,_stop,_time,_value,_field,_measurement,device,fstype,host,path,duration\n,,0,2018-05-22T19:53:26Z,2018-05-22T19:54:36Z,2018-05-22T19:53:26Z,34.98234271799806,used_percent,disk,disk1s1,apfs,host.local,/,10\n,,0,2018-05-22T19:53:26Z,2018-05-22T19:54:36Z,2018-05-22T19:53:36Z,34.98234941084654,used_percent,disk,disk1s1,apfs,host.local,/,10\n,,0,2018-05-22T19:53:26Z,2018-05-22T19:54:36Z,2018-05-22T19:53:46Z,34.982447293755506,used_percent,disk,disk1s1,apfs,host.local,/,10\n,,0,2018-05-22T19:53:26Z,2018-05-22T19:54:36Z,2018-05-22T19:53:56Z,34.982447293755506,used_percent,disk,disk1s1,apfs,host.local,/,10\n,,0,2018-05-22T19:53:26Z,2018-05-22T19:54:36Z,2018-05-22T19:54:06Z,34.98204153981662,used_percent,disk,disk1s1,apfs,host.local,/,10\n,,0,2018-05-22T19:53:26Z,2018-05-22T19:54:36Z,2018-05-22T19:54:16Z,34.982252364543626,used_percent,disk,disk1s1,apfs,host.local,/,30\n,,1,2018-05-22T19:53:26Z,2018-05-22T19:54:36Z,2018-05-22T19:53:26Z,34.98234271799806,used_percent,disk,disk1s2,apfs,host.local,/,10\n,,1,2018-05-22T19:53:26Z,2018-05-22T19:54:36Z,2018-05-22T19:53:36Z,34.98234941084654,used_percent,disk,disk1s2,apfs,host.local,/,10\n,,1,2018-05-22T19:53:26Z,2018-05-22T19:54:36Z,2018-05-22T19:53:46Z,34.982447293755506,used_percent,disk,disk1s2,apfs,host.local,/,10\n,,1,2018-05-22T19:53:26Z,2018-05-22T19:54:36Z,2018-05-22T19:53:56Z,34.982447293755506,used_percent,disk,disk1s2,apfs,host.local,/,10\n,,1,2018-05-22T19:53:26Z,2018-05-22T19:54:36Z,2018-05-22T19:54:06Z,34.98204153981662,used_percent,disk,disk1s2,apfs,host.local,/,10\n,,1,2018-05-22T19:53:26Z,2018-05-22T19:54:36Z,2018-05-22T19:54:16Z,34.982252364543626,used_percent,disk,disk1s2,apfs,host.local,/,30\n\"", Start: ast.Position{ Column: 11, Line: 27, }, }, }, Value: "\n#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,dateTime:RFC3339,double,string,string,string,string,string,string,long\n#group,false,false,true,true,false,false,true,true,true,true,true,true,false\n#default,_result,,,,,,,,,,,,\n,result,table,_start,_stop,_time,_value,_field,_measurement,device,fstype,host,path,duration\n,,0,2018-05-22T19:53:26Z,2018-05-22T19:54:36Z,2018-05-22T19:53:26Z,34.98234271799806,used_percent,disk,disk1s1,apfs,host.local,/,10\n,,0,2018-05-22T19:53:26Z,2018-05-22T19:54:36Z,2018-05-22T19:53:36Z,34.98234941084654,used_percent,disk,disk1s1,apfs,host.local,/,10\n,,0,2018-05-22T19:53:26Z,2018-05-22T19:54:36Z,2018-05-22T19:53:46Z,34.982447293755506,used_percent,disk,disk1s1,apfs,host.local,/,10\n,,0,2018-05-22T19:53:26Z,2018-05-22T19:54:36Z,2018-05-22T19:53:56Z,34.982447293755506,used_percent,disk,disk1s1,apfs,host.local,/,10\n,,0,2018-05-22T19:53:26Z,2018-05-22T19:54:36Z,2018-05-22T19:54:06Z,34.98204153981662,used_percent,disk,disk1s1,apfs,host.local,/,10\n,,0,2018-05-22T19:53:26Z,2018-05-22T19:54:36Z,2018-05-22T19:54:16Z,34.982252364543626,used_percent,disk,disk1s1,apfs,host.local,/,30\n,,1,2018-05-22T19:53:26Z,2018-05-22T19:54:36Z,2018-05-22T19:53:26Z,34.98234271799806,used_percent,disk,disk1s2,apfs,host.local,/,10\n,,1,2018-05-22T19:53:26Z,2018-05-22T19:54:36Z,2018-05-22T19:53:36Z,34.98234941084654,used_percent,disk,disk1s2,apfs,host.local,/,10\n,,1,2018-05-22T19:53:26Z,2018-05-22T19:54:36Z,2018-05-22T19:53:46Z,34.982447293755506,used_percent,disk,disk1s2,apfs,host.local,/,10\n,,1,2018-05-22T19:53:26Z,2018-05-22T19:54:36Z,2018-05-22T19:53:56Z,34.982447293755506,used_percent,disk,disk1s2,apfs,host.local,/,10\n,,1,2018-05-22T19:53:26Z,2018-05-22T19:54:36Z,2018-05-22T19:54:06Z,34.98204153981662,used_percent,disk,disk1s2,apfs,host.local,/,10\n,,1,2018-05-22T19:53:26Z,2018-05-22T19:54:36Z,2018-05-22T19:54:16Z,34.982252364543626,used_percent,disk,disk1s2,apfs,host.local,/,30\n", }, }, &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 50, Line: 49, }, File: "duration_with_stop_test.flux", Source: "t_duration = (table=<-) =>\n\t(table\n |> range(start:2018-05-22T19:53:26Z, stop:2018-05-22T19:54:36Z)\n\t\t|> events.duration(stop: 2018-05-22T19:54:46Z))", Start: ast.Position{ Column: 1, Line: 46, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 11, Line: 46, }, File: "duration_with_stop_test.flux", Source: "t_duration", Start: ast.Position{ Column: 1, Line: 46, }, }, }, Name: "t_duration", }, Init: &ast.FunctionExpression{ Arrow: nil, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 50, Line: 49, }, File: "duration_with_stop_test.flux", Source: "(table=<-) =>\n\t(table\n |> range(start:2018-05-22T19:53:26Z, stop:2018-05-22T19:54:36Z)\n\t\t|> events.duration(stop: 2018-05-22T19:54:46Z))", Start: ast.Position{ Column: 14, Line: 46, }, }, }, Body: &ast.ParenExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 50, Line: 49, }, File: "duration_with_stop_test.flux", Source: "(table\n |> range(start:2018-05-22T19:53:26Z, stop:2018-05-22T19:54:36Z)\n\t\t|> events.duration(stop: 2018-05-22T19:54:46Z))", Start: ast.Position{ Column: 2, Line: 47, }, }, }, Expression: &ast.PipeExpression{ Argument: &ast.PipeExpression{ Argument: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 8, Line: 47, }, File: "duration_with_stop_test.flux", Source: "table", Start: ast.Position{ Column: 3, Line: 47, }, }, }, Name: "table", }, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 72, Line: 48, }, File: "duration_with_stop_test.flux", Source: "table\n |> range(start:2018-05-22T19:53:26Z, stop:2018-05-22T19:54:36Z)", Start: ast.Position{ Column: 3, Line: 47, }, }, }, Call: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 71, Line: 48, }, File: "duration_with_stop_test.flux", Source: "start:2018-05-22T19:53:26Z, stop:2018-05-22T19:54:36Z", Start: ast.Position{ Column: 18, Line: 48, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 44, Line: 48, }, File: "duration_with_stop_test.flux", Source: "start:2018-05-22T19:53:26Z", Start: ast.Position{ Column: 18, Line: 48, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 23, Line: 48, }, File: "duration_with_stop_test.flux", Source: "start", Start: ast.Position{ Column: 18, Line: 48, }, }, }, Name: "start", }, Separator: nil, Value: &ast.DateTimeLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 44, Line: 48, }, File: "duration_with_stop_test.flux", Source: "2018-05-22T19:53:26Z", Start: ast.Position{ Column: 24, Line: 48, }, }, }, Value: parser.MustParseTime("2018-05-22T19:53:26Z"), }, }, &ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 71, Line: 48, }, File: "duration_with_stop_test.flux", Source: "stop:2018-05-22T19:54:36Z", Start: ast.Position{ Column: 46, Line: 48, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 50, Line: 48, }, File: "duration_with_stop_test.flux", Source: "stop", Start: ast.Position{ Column: 46, Line: 48, }, }, }, Name: "stop", }, Separator: nil, Value: &ast.DateTimeLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 71, Line: 48, }, File: "duration_with_stop_test.flux", Source: "2018-05-22T19:54:36Z", Start: ast.Position{ Column: 51, Line: 48, }, }, }, Value: parser.MustParseTime("2018-05-22T19:54:36Z"), }, }}, Rbrace: nil, With: nil, }}, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 72, Line: 48, }, File: "duration_with_stop_test.flux", Source: "range(start:2018-05-22T19:53:26Z, stop:2018-05-22T19:54:36Z)", Start: ast.Position{ Column: 12, Line: 48, }, }, }, Callee: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 17, Line: 48, }, File: "duration_with_stop_test.flux", Source: "range", Start: ast.Position{ Column: 12, Line: 48, }, }, }, Name: "range", }, Lparen: nil, Rparen: nil, }, }, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 49, Line: 49, }, File: "duration_with_stop_test.flux", Source: "table\n |> range(start:2018-05-22T19:53:26Z, stop:2018-05-22T19:54:36Z)\n\t\t|> events.duration(stop: 2018-05-22T19:54:46Z)", Start: ast.Position{ Column: 3, Line: 47, }, }, }, Call: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 48, Line: 49, }, File: "duration_with_stop_test.flux", Source: "stop: 2018-05-22T19:54:46Z", Start: ast.Position{ Column: 22, Line: 49, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 48, Line: 49, }, File: "duration_with_stop_test.flux", Source: "stop: 2018-05-22T19:54:46Z", Start: ast.Position{ Column: 22, Line: 49, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 26, Line: 49, }, File: "duration_with_stop_test.flux", Source: "stop", Start: ast.Position{ Column: 22, Line: 49, }, }, }, Name: "stop", }, Separator: nil, Value: &ast.DateTimeLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 48, Line: 49, }, File: "duration_with_stop_test.flux", Source: "2018-05-22T19:54:46Z", Start: ast.Position{ Column: 28, Line: 49, }, }, }, Value: parser.MustParseTime("2018-05-22T19:54:46Z"), }, }}, Rbrace: nil, With: nil, }}, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 49, Line: 49, }, File: "duration_with_stop_test.flux", Source: "events.duration(stop: 2018-05-22T19:54:46Z)", Start: ast.Position{ Column: 6, Line: 49, }, }, }, Callee: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 21, Line: 49, }, File: "duration_with_stop_test.flux", Source: "events.duration", Start: ast.Position{ Column: 6, Line: 49, }, }, }, Lbrack: nil, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 12, Line: 49, }, File: "duration_with_stop_test.flux", Source: "events", Start: ast.Position{ Column: 6, Line: 49, }, }, }, Name: "events", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 21, Line: 49, }, File: "duration_with_stop_test.flux", Source: "duration", Start: ast.Position{ Column: 13, Line: 49, }, }, }, Name: "duration", }, Rbrack: nil, }, Lparen: nil, Rparen: nil, }, }, Lparen: nil, Rparen: nil, }, Lparen: nil, Params: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 23, Line: 46, }, File: "duration_with_stop_test.flux", Source: "table=<-", Start: ast.Position{ Column: 15, Line: 46, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 20, Line: 46, }, File: "duration_with_stop_test.flux", Source: "table", Start: ast.Position{ Column: 15, Line: 46, }, }, }, Name: "table", }, Separator: nil, Value: &ast.PipeLiteral{BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 23, Line: 46, }, File: "duration_with_stop_test.flux", Source: "<-", Start: ast.Position{ Column: 21, Line: 46, }, }, }}, }}, Rparan: nil, }, }, &ast.TestStatement{ Assignment: &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 98, Line: 52, }, File: "duration_with_stop_test.flux", Source: "_duration = () =>\n\t({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_duration})", Start: ast.Position{ Column: 6, Line: 51, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 15, Line: 51, }, File: "duration_with_stop_test.flux", Source: "_duration", Start: ast.Position{ Column: 6, Line: 51, }, }, }, Name: "_duration", }, Init: &ast.FunctionExpression{ Arrow: nil, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 98, Line: 52, }, File: "duration_with_stop_test.flux", Source: "() =>\n\t({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_duration})", Start: ast.Position{ Column: 18, Line: 51, }, }, }, Body: &ast.ParenExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 98, Line: 52, }, File: "duration_with_stop_test.flux", Source: "({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_duration})", Start: ast.Position{ Column: 2, Line: 52, }, }, }, Expression: &ast.ObjectExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 97, Line: 52, }, File: "duration_with_stop_test.flux", Source: "{input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_duration}", Start: ast.Position{ Column: 3, Line: 52, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 43, Line: 52, }, File: "duration_with_stop_test.flux", Source: "input: testing.loadStorage(csv: inData)", Start: ast.Position{ Column: 4, Line: 52, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 9, Line: 52, }, File: "duration_with_stop_test.flux", Source: "input", Start: ast.Position{ Column: 4, Line: 52, }, }, }, Name: "input", }, Separator: nil, Value: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 52, }, File: "duration_with_stop_test.flux", Source: "csv: inData", Start: ast.Position{ Column: 31, Line: 52, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 52, }, File: "duration_with_stop_test.flux", Source: "csv: inData", Start: ast.Position{ Column: 31, Line: 52, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 34, Line: 52, }, File: "duration_with_stop_test.flux", Source: "csv", Start: ast.Position{ Column: 31, Line: 52, }, }, }, Name: "csv", }, Separator: nil, Value: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 52, }, File: "duration_with_stop_test.flux", Source: "inData", Start: ast.Position{ Column: 36, Line: 52, }, }, }, Name: "inData", }, }}, Rbrace: nil, With: nil, }}, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 43, Line: 52, }, File: "duration_with_stop_test.flux", Source: "testing.loadStorage(csv: inData)", Start: ast.Position{ Column: 11, Line: 52, }, }, }, Callee: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 30, Line: 52, }, File: "duration_with_stop_test.flux", Source: "testing.loadStorage", Start: ast.Position{ Column: 11, Line: 52, }, }, }, Lbrack: nil, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 18, Line: 52, }, File: "duration_with_stop_test.flux", Source: "testing", Start: ast.Position{ Column: 11, Line: 52, }, }, }, Name: "testing", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 30, Line: 52, }, File: "duration_with_stop_test.flux", Source: "loadStorage", Start: ast.Position{ Column: 19, Line: 52, }, }, }, Name: "loadStorage", }, Rbrack: nil, }, Lparen: nil, Rparen: nil, }, }, &ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 80, Line: 52, }, File: "duration_with_stop_test.flux", Source: "want: testing.loadMem(csv: outData)", Start: ast.Position{ Column: 45, Line: 52, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 49, Line: 52, }, File: "duration_with_stop_test.flux", Source: "want", Start: ast.Position{ Column: 45, Line: 52, }, }, }, Name: "want", }, Separator: nil, Value: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 79, Line: 52, }, File: "duration_with_stop_test.flux", Source: "csv: outData", Start: ast.Position{ Column: 67, Line: 52, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 79, Line: 52, }, File: "duration_with_stop_test.flux", Source: "csv: outData", Start: ast.Position{ Column: 67, Line: 52, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 70, Line: 52, }, File: "duration_with_stop_test.flux", Source: "csv", Start: ast.Position{ Column: 67, Line: 52, }, }, }, Name: "csv", }, Separator: nil, Value: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 79, Line: 52, }, File: "duration_with_stop_test.flux", Source: "outData", Start: ast.Position{ Column: 72, Line: 52, }, }, }, Name: "outData", }, }}, Rbrace: nil, With: nil, }}, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 80, Line: 52, }, File: "duration_with_stop_test.flux", Source: "testing.loadMem(csv: outData)", Start: ast.Position{ Column: 51, Line: 52, }, }, }, Callee: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 66, Line: 52, }, File: "duration_with_stop_test.flux", Source: "testing.loadMem", Start: ast.Position{ Column: 51, Line: 52, }, }, }, Lbrack: nil, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 58, Line: 52, }, File: "duration_with_stop_test.flux", Source: "testing", Start: ast.Position{ Column: 51, Line: 52, }, }, }, Name: "testing", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 66, Line: 52, }, File: "duration_with_stop_test.flux", Source: "loadMem", Start: ast.Position{ Column: 59, Line: 52, }, }, }, Name: "loadMem", }, Rbrack: nil, }, Lparen: nil, Rparen: nil, }, }, &ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 96, Line: 52, }, File: "duration_with_stop_test.flux", Source: "fn: t_duration", Start: ast.Position{ Column: 82, Line: 52, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 84, Line: 52, }, File: "duration_with_stop_test.flux", Source: "fn", Start: ast.Position{ Column: 82, Line: 52, }, }, }, Name: "fn", }, Separator: nil, Value: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 96, Line: 52, }, File: "duration_with_stop_test.flux", Source: "t_duration", Start: ast.Position{ Column: 86, Line: 52, }, }, }, Name: "t_duration", }, }}, Rbrace: nil, With: nil, }, Lparen: nil, Rparen: nil, }, Lparen: nil, Params: []*ast.Property{}, Rparan: nil, }, }, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 98, Line: 52, }, File: "duration_with_stop_test.flux", Source: "test _duration = () =>\n\t({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_duration})", Start: ast.Position{ Column: 1, Line: 51, }, }, }, }}, Eof: nil, Imports: []*ast.ImportDeclaration{&ast.ImportDeclaration{ As: nil, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 17, Line: 3, }, File: "duration_with_stop_test.flux", Source: "import \"testing\"", Start: ast.Position{ Column: 1, Line: 3, }, }, }, Path: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 17, Line: 3, }, File: "duration_with_stop_test.flux", Source: "\"testing\"", Start: ast.Position{ Column: 8, Line: 3, }, }, }, Value: "testing", }, }, &ast.ImportDeclaration{ As: nil, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 40, Line: 4, }, File: "duration_with_stop_test.flux", Source: "import \"contrib/tomhollingworth/events\"", Start: ast.Position{ Column: 1, Line: 4, }, }, }, Path: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 40, Line: 4, }, File: "duration_with_stop_test.flux", Source: "\"contrib/tomhollingworth/events\"", Start: ast.Position{ Column: 8, Line: 4, }, }, }, Value: "contrib/tomhollingworth/events", }, }}, Metadata: "parser-type=rust", Name: "duration_with_stop_test.flux", Package: &ast.PackageClause{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 20, Line: 1, }, File: "duration_with_stop_test.flux", Source: "package events_test", Start: ast.Position{ Column: 1, Line: 1, }, }, }, Name: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 20, Line: 1, }, File: "duration_with_stop_test.flux", Source: "events_test", Start: ast.Position{ Column: 9, Line: 1, }, }, }, Name: "events_test", }, }, }}, Package: "events_test", Path: "contrib/tomhollingworth/events", }}
Functions ¶
func NewDurationTransformation ¶
func NewDurationTransformation(d execute.Dataset, cache execute.TableBuilderCache, spec *DurationProcedureSpec) *durationTransformation
Types ¶
type DurationOpSpec ¶
type DurationOpSpec struct { Unit flux.Duration `json:"unit"` TimeColumn string `json:"timeColumn"` ColumnName string `json:"columnName"` StopColumn string `json:"stopColumn"` Stop flux.Time `json:"stop"` IsStop bool }
func (*DurationOpSpec) Kind ¶
func (s *DurationOpSpec) Kind() flux.OperationKind
type DurationProcedureSpec ¶
type DurationProcedureSpec struct { plan.DefaultCost Unit flux.Duration `json:"unit"` TimeColumn string `json:"timeColumn"` ColumnName string `json:"columnName"` StopColumn string `json:"stopColumn"` Stop flux.Time `json:"stop"` IsStop bool }
func (*DurationProcedureSpec) Copy ¶
func (s *DurationProcedureSpec) Copy() plan.ProcedureSpec
func (*DurationProcedureSpec) Kind ¶
func (s *DurationProcedureSpec) Kind() plan.ProcedureKind
Click to show internal directories.
Click to hide internal directories.