mirror of
https://github.com/akvorado/akvorado.git
synced 2025-12-12 06:24:10 +01:00
build: use gofumpt
Undecided if we need to use it. I think it's nice.
This commit is contained in:
@@ -37,34 +37,34 @@ AND engine LIKE '%MergeTree'
|
||||
Return(nil).
|
||||
SetArg(1, []struct {
|
||||
T time.Time `ch:"t"`
|
||||
}{{time.Date(2022, 04, 10, 15, 45, 10, 0, time.UTC)}})
|
||||
}{{time.Date(2022, 4, 10, 15, 45, 10, 0, time.UTC)}})
|
||||
mockConn.EXPECT().
|
||||
Select(gomock.Any(), gomock.Any(), `SELECT MIN(TimeReceived) AS t FROM flows_1h0m0s`).
|
||||
Return(nil).
|
||||
SetArg(1, []struct {
|
||||
T time.Time `ch:"t"`
|
||||
}{{time.Date(2022, 01, 10, 15, 45, 10, 0, time.UTC)}})
|
||||
}{{time.Date(2022, 1, 10, 15, 45, 10, 0, time.UTC)}})
|
||||
mockConn.EXPECT().
|
||||
Select(gomock.Any(), gomock.Any(), `SELECT MIN(TimeReceived) AS t FROM flows_1m0s`).
|
||||
Return(nil).
|
||||
SetArg(1, []struct {
|
||||
T time.Time `ch:"t"`
|
||||
}{{time.Date(2022, 04, 20, 15, 45, 10, 0, time.UTC)}})
|
||||
}{{time.Date(2022, 4, 20, 15, 45, 10, 0, time.UTC)}})
|
||||
mockConn.EXPECT().
|
||||
Select(gomock.Any(), gomock.Any(), `SELECT MIN(TimeReceived) AS t FROM flows_5m0s`).
|
||||
Return(nil).
|
||||
SetArg(1, []struct {
|
||||
T time.Time `ch:"t"`
|
||||
}{{time.Date(2022, 02, 10, 15, 45, 10, 0, time.UTC)}})
|
||||
}{{time.Date(2022, 2, 10, 15, 45, 10, 0, time.UTC)}})
|
||||
if err := c.refreshFlowsTables(); err != nil {
|
||||
t.Fatalf("refreshFlowsTables() error:\n%+v", err)
|
||||
}
|
||||
|
||||
expected := []flowsTable{
|
||||
{"flows", time.Duration(0), time.Date(2022, 04, 10, 15, 45, 10, 0, time.UTC)},
|
||||
{"flows_1h0m0s", time.Hour, time.Date(2022, 01, 10, 15, 45, 10, 0, time.UTC)},
|
||||
{"flows_1m0s", time.Minute, time.Date(2022, 04, 20, 15, 45, 10, 0, time.UTC)},
|
||||
{"flows_5m0s", 5 * time.Minute, time.Date(2022, 02, 10, 15, 45, 10, 0, time.UTC)},
|
||||
{"flows", time.Duration(0), time.Date(2022, 4, 10, 15, 45, 10, 0, time.UTC)},
|
||||
{"flows_1h0m0s", time.Hour, time.Date(2022, 1, 10, 15, 45, 10, 0, time.UTC)},
|
||||
{"flows_1m0s", time.Minute, time.Date(2022, 4, 20, 15, 45, 10, 0, time.UTC)},
|
||||
{"flows_5m0s", 5 * time.Minute, time.Date(2022, 2, 10, 15, 45, 10, 0, time.UTC)},
|
||||
}
|
||||
if diff := helpers.Diff(c.flowsTables, expected); diff != "" {
|
||||
t.Fatalf("refreshFlowsTables() diff:\n%s", diff)
|
||||
@@ -83,8 +83,8 @@ func TestFinalizeQuery(t *testing.T) {
|
||||
Description: "simple query without additional tables",
|
||||
Query: "SELECT 1 FROM {{ .Table }} WHERE {{ .Timefilter }}",
|
||||
Context: inputContext{
|
||||
Start: time.Date(2022, 04, 10, 15, 45, 10, 0, time.UTC),
|
||||
End: time.Date(2022, 04, 11, 15, 45, 10, 0, time.UTC),
|
||||
Start: time.Date(2022, 4, 10, 15, 45, 10, 0, time.UTC),
|
||||
End: time.Date(2022, 4, 11, 15, 45, 10, 0, time.UTC),
|
||||
Points: 86400,
|
||||
},
|
||||
Expected: "SELECT 1 FROM flows WHERE TimeReceived BETWEEN toDateTime('2022-04-10 15:45:10', 'UTC') AND toDateTime('2022-04-11 15:45:10', 'UTC')",
|
||||
@@ -92,106 +92,106 @@ func TestFinalizeQuery(t *testing.T) {
|
||||
Description: "query with source port",
|
||||
Query: "SELECT TimeReceived, SrcPort FROM {{ .Table }} WHERE {{ .Timefilter }}",
|
||||
Context: inputContext{
|
||||
Start: time.Date(2022, 04, 10, 15, 45, 10, 0, time.UTC),
|
||||
End: time.Date(2022, 04, 11, 15, 45, 10, 0, time.UTC),
|
||||
Start: time.Date(2022, 4, 10, 15, 45, 10, 0, time.UTC),
|
||||
End: time.Date(2022, 4, 11, 15, 45, 10, 0, time.UTC),
|
||||
MainTableRequired: true,
|
||||
Points: 86400,
|
||||
},
|
||||
Expected: "SELECT TimeReceived, SrcPort FROM flows WHERE TimeReceived BETWEEN toDateTime('2022-04-10 15:45:10', 'UTC') AND toDateTime('2022-04-11 15:45:10', 'UTC')",
|
||||
}, {
|
||||
Description: "only flows table available",
|
||||
Tables: []flowsTable{{"flows", 0, time.Date(2022, 03, 10, 15, 45, 10, 0, time.UTC)}},
|
||||
Tables: []flowsTable{{"flows", 0, time.Date(2022, 3, 10, 15, 45, 10, 0, time.UTC)}},
|
||||
Query: "SELECT 1 FROM {{ .Table }} WHERE {{ .Timefilter }}",
|
||||
Context: inputContext{
|
||||
Start: time.Date(2022, 04, 10, 15, 45, 10, 0, time.UTC),
|
||||
End: time.Date(2022, 04, 11, 15, 45, 10, 0, time.UTC),
|
||||
Start: time.Date(2022, 4, 10, 15, 45, 10, 0, time.UTC),
|
||||
End: time.Date(2022, 4, 11, 15, 45, 10, 0, time.UTC),
|
||||
Points: 86400,
|
||||
},
|
||||
Expected: "SELECT 1 FROM flows WHERE TimeReceived BETWEEN toDateTime('2022-04-10 15:45:10', 'UTC') AND toDateTime('2022-04-11 15:45:10', 'UTC')",
|
||||
}, {
|
||||
Description: "timefilter.Start and timefilter.Stop",
|
||||
Tables: []flowsTable{{"flows", 0, time.Date(2022, 03, 10, 15, 45, 10, 0, time.UTC)}},
|
||||
Tables: []flowsTable{{"flows", 0, time.Date(2022, 3, 10, 15, 45, 10, 0, time.UTC)}},
|
||||
Query: "SELECT {{ .TimefilterStart }}, {{ .TimefilterEnd }}",
|
||||
Context: inputContext{
|
||||
Start: time.Date(2022, 04, 10, 15, 45, 10, 0, time.UTC),
|
||||
End: time.Date(2022, 04, 11, 15, 45, 10, 0, time.UTC),
|
||||
Start: time.Date(2022, 4, 10, 15, 45, 10, 0, time.UTC),
|
||||
End: time.Date(2022, 4, 11, 15, 45, 10, 0, time.UTC),
|
||||
Points: 86400,
|
||||
},
|
||||
Expected: "SELECT toDateTime('2022-04-10 15:45:10', 'UTC'), toDateTime('2022-04-11 15:45:10', 'UTC')",
|
||||
}, {
|
||||
Description: "only flows table and out of range request",
|
||||
Tables: []flowsTable{{"flows", 0, time.Date(2022, 04, 10, 22, 45, 10, 0, time.UTC)}},
|
||||
Tables: []flowsTable{{"flows", 0, time.Date(2022, 4, 10, 22, 45, 10, 0, time.UTC)}},
|
||||
Query: "SELECT 1 FROM {{ .Table }} WHERE {{ .Timefilter }}",
|
||||
Context: inputContext{
|
||||
Start: time.Date(2022, 04, 10, 15, 45, 10, 0, time.UTC),
|
||||
End: time.Date(2022, 04, 11, 15, 45, 10, 0, time.UTC),
|
||||
Start: time.Date(2022, 4, 10, 15, 45, 10, 0, time.UTC),
|
||||
End: time.Date(2022, 4, 11, 15, 45, 10, 0, time.UTC),
|
||||
Points: 86400,
|
||||
},
|
||||
Expected: "SELECT 1 FROM flows WHERE TimeReceived BETWEEN toDateTime('2022-04-10 15:45:10', 'UTC') AND toDateTime('2022-04-11 15:45:10', 'UTC')",
|
||||
}, {
|
||||
Description: "select consolidated table",
|
||||
Tables: []flowsTable{
|
||||
{"flows", 0, time.Date(2022, 03, 10, 22, 45, 10, 0, time.UTC)},
|
||||
{"flows_1m0s", time.Minute, time.Date(2022, 04, 2, 22, 45, 10, 0, time.UTC)},
|
||||
{"flows", 0, time.Date(2022, 3, 10, 22, 45, 10, 0, time.UTC)},
|
||||
{"flows_1m0s", time.Minute, time.Date(2022, 4, 2, 22, 45, 10, 0, time.UTC)},
|
||||
},
|
||||
Query: "SELECT 1 FROM {{ .Table }} WHERE {{ .Timefilter }} // {{ .Interval }}",
|
||||
Context: inputContext{
|
||||
Start: time.Date(2022, 04, 10, 15, 45, 10, 0, time.UTC),
|
||||
End: time.Date(2022, 04, 11, 15, 45, 10, 0, time.UTC),
|
||||
Start: time.Date(2022, 4, 10, 15, 45, 10, 0, time.UTC),
|
||||
End: time.Date(2022, 4, 11, 15, 45, 10, 0, time.UTC),
|
||||
Points: 720, // 2-minute resolution
|
||||
},
|
||||
Expected: "SELECT 1 FROM flows_1m0s WHERE TimeReceived BETWEEN toDateTime('2022-04-10 15:45:00', 'UTC') AND toDateTime('2022-04-11 15:45:00', 'UTC') // 120",
|
||||
}, {
|
||||
Description: "select consolidated table out of range",
|
||||
Tables: []flowsTable{
|
||||
{"flows", 0, time.Date(2022, 04, 10, 22, 45, 10, 0, time.UTC)},
|
||||
{"flows_1m0s", time.Minute, time.Date(2022, 04, 10, 17, 45, 10, 0, time.UTC)},
|
||||
{"flows", 0, time.Date(2022, 4, 10, 22, 45, 10, 0, time.UTC)},
|
||||
{"flows_1m0s", time.Minute, time.Date(2022, 4, 10, 17, 45, 10, 0, time.UTC)},
|
||||
},
|
||||
Query: "SELECT 1 FROM {{ .Table }} WHERE {{ .Timefilter }}",
|
||||
Context: inputContext{
|
||||
Start: time.Date(2022, 04, 10, 15, 45, 10, 0, time.UTC),
|
||||
End: time.Date(2022, 04, 11, 15, 45, 10, 0, time.UTC),
|
||||
Start: time.Date(2022, 4, 10, 15, 45, 10, 0, time.UTC),
|
||||
End: time.Date(2022, 4, 11, 15, 45, 10, 0, time.UTC),
|
||||
Points: 720, // 2-minute resolution,
|
||||
},
|
||||
Expected: "SELECT 1 FROM flows_1m0s WHERE TimeReceived BETWEEN toDateTime('2022-04-10 15:45:00', 'UTC') AND toDateTime('2022-04-11 15:45:00', 'UTC')",
|
||||
}, {
|
||||
Description: "select flows table out of range",
|
||||
Tables: []flowsTable{
|
||||
{"flows", 0, time.Date(2022, 04, 10, 16, 45, 10, 0, time.UTC)},
|
||||
{"flows_1m0s", time.Minute, time.Date(2022, 04, 10, 17, 45, 10, 0, time.UTC)},
|
||||
{"flows", 0, time.Date(2022, 4, 10, 16, 45, 10, 0, time.UTC)},
|
||||
{"flows_1m0s", time.Minute, time.Date(2022, 4, 10, 17, 45, 10, 0, time.UTC)},
|
||||
},
|
||||
Query: "SELECT 1 FROM {{ .Table }} WHERE {{ .Timefilter }}",
|
||||
Context: inputContext{
|
||||
Start: time.Date(2022, 04, 10, 15, 45, 10, 0, time.UTC),
|
||||
End: time.Date(2022, 04, 11, 15, 45, 10, 0, time.UTC),
|
||||
Start: time.Date(2022, 4, 10, 15, 45, 10, 0, time.UTC),
|
||||
End: time.Date(2022, 4, 11, 15, 45, 10, 0, time.UTC),
|
||||
Points: 720, // 2-minute resolution,
|
||||
},
|
||||
Expected: "SELECT 1 FROM flows WHERE TimeReceived BETWEEN toDateTime('2022-04-10 15:45:10', 'UTC') AND toDateTime('2022-04-11 15:45:10', 'UTC')",
|
||||
}, {
|
||||
Description: "use flows table for resolution (control for next case)",
|
||||
Tables: []flowsTable{
|
||||
{"flows", 0, time.Date(2022, 04, 10, 10, 45, 10, 0, time.UTC)},
|
||||
{"flows_1m0s", time.Minute, time.Date(2022, 03, 10, 10, 45, 10, 0, time.UTC)},
|
||||
{"flows", 0, time.Date(2022, 4, 10, 10, 45, 10, 0, time.UTC)},
|
||||
{"flows_1m0s", time.Minute, time.Date(2022, 3, 10, 10, 45, 10, 0, time.UTC)},
|
||||
},
|
||||
Query: "SELECT 1 FROM {{ .Table }} WHERE {{ .Timefilter }} // {{ .Interval }}",
|
||||
Context: inputContext{
|
||||
Start: time.Date(2022, 04, 10, 15, 45, 10, 0, time.UTC),
|
||||
End: time.Date(2022, 04, 11, 15, 45, 10, 0, time.UTC),
|
||||
Start: time.Date(2022, 4, 10, 15, 45, 10, 0, time.UTC),
|
||||
End: time.Date(2022, 4, 11, 15, 45, 10, 0, time.UTC),
|
||||
Points: 2880, // 30-second resolution
|
||||
},
|
||||
Expected: "SELECT 1 FROM flows WHERE TimeReceived BETWEEN toDateTime('2022-04-10 15:45:10', 'UTC') AND toDateTime('2022-04-11 15:45:10', 'UTC') // 30",
|
||||
}, {
|
||||
Description: "use flows table for resolution (but flows_1m0s for data)",
|
||||
Tables: []flowsTable{
|
||||
{"flows", 0, time.Date(2022, 04, 10, 10, 45, 10, 0, time.UTC)},
|
||||
{"flows_1m0s", time.Minute, time.Date(2022, 03, 10, 10, 45, 10, 0, time.UTC)},
|
||||
{"flows", 0, time.Date(2022, 4, 10, 10, 45, 10, 0, time.UTC)},
|
||||
{"flows_1m0s", time.Minute, time.Date(2022, 3, 10, 10, 45, 10, 0, time.UTC)},
|
||||
},
|
||||
Query: "SELECT 1 FROM {{ .Table }} WHERE {{ .Timefilter }} // {{ .Interval }}",
|
||||
Context: inputContext{
|
||||
Start: time.Date(2022, 03, 10, 15, 45, 10, 0, time.UTC),
|
||||
End: time.Date(2022, 03, 11, 15, 45, 10, 0, time.UTC),
|
||||
Start: time.Date(2022, 3, 10, 15, 45, 10, 0, time.UTC),
|
||||
End: time.Date(2022, 3, 11, 15, 45, 10, 0, time.UTC),
|
||||
StartForInterval: func() *time.Time {
|
||||
t := time.Date(2022, 04, 10, 15, 45, 10, 0, time.UTC)
|
||||
t := time.Date(2022, 4, 10, 15, 45, 10, 0, time.UTC)
|
||||
return &t
|
||||
}(),
|
||||
Points: 2880, // 30-second resolution
|
||||
@@ -200,55 +200,55 @@ func TestFinalizeQuery(t *testing.T) {
|
||||
}, {
|
||||
Description: "select flows table with better resolution",
|
||||
Tables: []flowsTable{
|
||||
{"flows", 0, time.Date(2022, 03, 10, 16, 45, 10, 0, time.UTC)},
|
||||
{"flows_1m0s", time.Minute, time.Date(2022, 03, 10, 17, 45, 10, 0, time.UTC)},
|
||||
{"flows", 0, time.Date(2022, 3, 10, 16, 45, 10, 0, time.UTC)},
|
||||
{"flows_1m0s", time.Minute, time.Date(2022, 3, 10, 17, 45, 10, 0, time.UTC)},
|
||||
},
|
||||
Query: "SELECT 1 FROM {{ .Table }} WHERE {{ .Timefilter }} // {{ .Interval }}",
|
||||
Context: inputContext{
|
||||
Start: time.Date(2022, 04, 10, 15, 45, 10, 0, time.UTC),
|
||||
End: time.Date(2022, 04, 11, 15, 45, 10, 0, time.UTC),
|
||||
Start: time.Date(2022, 4, 10, 15, 45, 10, 0, time.UTC),
|
||||
End: time.Date(2022, 4, 11, 15, 45, 10, 0, time.UTC),
|
||||
Points: 2880,
|
||||
},
|
||||
Expected: "SELECT 1 FROM flows WHERE TimeReceived BETWEEN toDateTime('2022-04-10 15:45:10', 'UTC') AND toDateTime('2022-04-11 15:45:10', 'UTC') // 30",
|
||||
}, {
|
||||
Description: "select consolidated table with better resolution",
|
||||
Tables: []flowsTable{
|
||||
{"flows", 0, time.Date(2022, 03, 10, 22, 45, 10, 0, time.UTC)},
|
||||
{"flows_5m0s", 5 * time.Minute, time.Date(2022, 04, 2, 22, 45, 10, 0, time.UTC)},
|
||||
{"flows_1m0s", time.Minute, time.Date(2022, 04, 2, 22, 45, 10, 0, time.UTC)},
|
||||
{"flows", 0, time.Date(2022, 3, 10, 22, 45, 10, 0, time.UTC)},
|
||||
{"flows_5m0s", 5 * time.Minute, time.Date(2022, 4, 2, 22, 45, 10, 0, time.UTC)},
|
||||
{"flows_1m0s", time.Minute, time.Date(2022, 4, 2, 22, 45, 10, 0, time.UTC)},
|
||||
},
|
||||
Query: "SELECT 1 FROM {{ .Table }} WHERE {{ .Timefilter }} // {{ .Interval }}",
|
||||
Context: inputContext{
|
||||
Start: time.Date(2022, 04, 10, 15, 45, 10, 0, time.UTC),
|
||||
End: time.Date(2022, 04, 11, 15, 45, 10, 0, time.UTC),
|
||||
Start: time.Date(2022, 4, 10, 15, 45, 10, 0, time.UTC),
|
||||
End: time.Date(2022, 4, 11, 15, 45, 10, 0, time.UTC),
|
||||
Points: 720, // 2-minute resolution,
|
||||
},
|
||||
Expected: "SELECT 1 FROM flows_1m0s WHERE TimeReceived BETWEEN toDateTime('2022-04-10 15:45:00', 'UTC') AND toDateTime('2022-04-11 15:45:00', 'UTC') // 120",
|
||||
}, {
|
||||
Description: "select consolidated table with better range",
|
||||
Tables: []flowsTable{
|
||||
{"flows", 0, time.Date(2022, 04, 10, 22, 45, 10, 0, time.UTC)},
|
||||
{"flows_5m0s", 5 * time.Minute, time.Date(2022, 04, 2, 22, 45, 10, 0, time.UTC)},
|
||||
{"flows_1m0s", time.Minute, time.Date(2022, 04, 10, 22, 45, 10, 0, time.UTC)},
|
||||
{"flows", 0, time.Date(2022, 4, 10, 22, 45, 10, 0, time.UTC)},
|
||||
{"flows_5m0s", 5 * time.Minute, time.Date(2022, 4, 2, 22, 45, 10, 0, time.UTC)},
|
||||
{"flows_1m0s", time.Minute, time.Date(2022, 4, 10, 22, 45, 10, 0, time.UTC)},
|
||||
},
|
||||
Query: "SELECT 1 FROM {{ .Table }} WHERE {{ .Timefilter }}",
|
||||
Context: inputContext{
|
||||
Start: time.Date(2022, 04, 10, 15, 46, 10, 0, time.UTC),
|
||||
End: time.Date(2022, 04, 11, 15, 46, 10, 0, time.UTC),
|
||||
Start: time.Date(2022, 4, 10, 15, 46, 10, 0, time.UTC),
|
||||
End: time.Date(2022, 4, 11, 15, 46, 10, 0, time.UTC),
|
||||
Points: 720, // 2-minute resolution,
|
||||
},
|
||||
Expected: "SELECT 1 FROM flows_5m0s WHERE TimeReceived BETWEEN toDateTime('2022-04-10 15:45:00', 'UTC') AND toDateTime('2022-04-11 15:45:00', 'UTC')",
|
||||
}, {
|
||||
Description: "select best resolution when equality for oldest data",
|
||||
Tables: []flowsTable{
|
||||
{"flows", 0, time.Date(2022, 04, 10, 22, 40, 55, 0, time.UTC)},
|
||||
{"flows_1m0s", time.Minute, time.Date(2022, 04, 10, 22, 40, 00, 0, time.UTC)},
|
||||
{"flows_1h0m0s", time.Hour, time.Date(2022, 04, 10, 22, 00, 10, 0, time.UTC)},
|
||||
{"flows", 0, time.Date(2022, 4, 10, 22, 40, 55, 0, time.UTC)},
|
||||
{"flows_1m0s", time.Minute, time.Date(2022, 4, 10, 22, 40, 0, 0, time.UTC)},
|
||||
{"flows_1h0m0s", time.Hour, time.Date(2022, 4, 10, 22, 0, 10, 0, time.UTC)},
|
||||
},
|
||||
Query: "SELECT 1 FROM {{ .Table }} WHERE {{ .Timefilter }}",
|
||||
Context: inputContext{
|
||||
Start: time.Date(2022, 04, 10, 15, 46, 10, 0, time.UTC),
|
||||
End: time.Date(2022, 04, 11, 15, 46, 10, 0, time.UTC),
|
||||
Start: time.Date(2022, 4, 10, 15, 46, 10, 0, time.UTC),
|
||||
End: time.Date(2022, 4, 11, 15, 46, 10, 0, time.UTC),
|
||||
Points: 720, // 2-minute resolution,
|
||||
},
|
||||
Expected: "SELECT 1 FROM flows_1m0s WHERE TimeReceived BETWEEN toDateTime('2022-04-10 15:46:00', 'UTC') AND toDateTime('2022-04-11 15:46:00', 'UTC')",
|
||||
@@ -256,8 +256,8 @@ func TestFinalizeQuery(t *testing.T) {
|
||||
Description: "query with escaped template",
|
||||
Query: `SELECT TimeReceived, SrcPort WHERE InIfDescription = '{{"{{"}} hello }}'`,
|
||||
Context: inputContext{
|
||||
Start: time.Date(2022, 04, 10, 15, 45, 10, 0, time.UTC),
|
||||
End: time.Date(2022, 04, 11, 15, 45, 10, 0, time.UTC),
|
||||
Start: time.Date(2022, 4, 10, 15, 45, 10, 0, time.UTC),
|
||||
End: time.Date(2022, 4, 11, 15, 45, 10, 0, time.UTC),
|
||||
Points: 86400,
|
||||
},
|
||||
Expected: `SELECT TimeReceived, SrcPort WHERE InIfDescription = '{{ hello }}'`,
|
||||
@@ -265,8 +265,8 @@ func TestFinalizeQuery(t *testing.T) {
|
||||
Description: "use of ToStartOfInterval",
|
||||
Query: `{{ call .ToStartOfInterval "TimeReceived" }}`,
|
||||
Context: inputContext{
|
||||
Start: time.Date(2022, 04, 10, 15, 45, 10, 0, time.UTC),
|
||||
End: time.Date(2022, 04, 11, 15, 45, 10, 0, time.UTC),
|
||||
Start: time.Date(2022, 4, 10, 15, 45, 10, 0, time.UTC),
|
||||
End: time.Date(2022, 4, 11, 15, 45, 10, 0, time.UTC),
|
||||
Points: 720,
|
||||
},
|
||||
Expected: `toStartOfInterval(TimeReceived + INTERVAL 50 second, INTERVAL 120 second) - INTERVAL 50 second`,
|
||||
@@ -274,8 +274,8 @@ func TestFinalizeQuery(t *testing.T) {
|
||||
Description: "Small interval outside main table expiration",
|
||||
Query: "SELECT InIfProvider FROM {{ .Table }}",
|
||||
Tables: []flowsTable{
|
||||
{"flows", time.Duration(0), time.Date(2022, 11, 06, 12, 0, 0, 0, time.UTC)},
|
||||
{"flows_1h0m0s", time.Hour, time.Date(2022, 04, 25, 18, 0, 0, 0, time.UTC)},
|
||||
{"flows", time.Duration(0), time.Date(2022, 11, 6, 12, 0, 0, 0, time.UTC)},
|
||||
{"flows_1h0m0s", time.Hour, time.Date(2022, 4, 25, 18, 0, 0, 0, time.UTC)},
|
||||
{"flows_1m0s", time.Minute, time.Date(2022, 11, 14, 12, 0, 0, 0, time.UTC)},
|
||||
{"flows_5m0s", 5 * time.Minute, time.Date(2022, 8, 23, 12, 0, 0, 0, time.UTC)},
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user