mirror of
https://github.com/akvorado/akvorado.git
synced 2025-12-12 06:24:10 +01:00
console: fix a possible divide by 0 error
This is not the only problem we have.
This commit is contained in:
@@ -231,16 +231,16 @@ func TestWidgetGraph(t *testing.T) {
|
||||
mockConn.EXPECT().
|
||||
Select(gomock.Any(), gomock.Any(), `
|
||||
SELECT
|
||||
toStartOfInterval(TimeReceived, INTERVAL (intDiv(864, 1)*1) second) AS Time,
|
||||
SUM(Bytes*SamplingRate*8/(intDiv(864, 1)*1))/1000/1000/1000 AS Gbps
|
||||
toStartOfInterval(TimeReceived, INTERVAL max2(intDiv(864, 1)*1, 1) second) AS Time,
|
||||
SUM(Bytes*SamplingRate*8/max2(intDiv(864, 1)*1, 1))/1000/1000/1000 AS Gbps
|
||||
FROM flows
|
||||
WHERE TimeReceived BETWEEN toDateTime('2009-11-10 23:00:00', 'UTC') AND toDateTime('2009-11-11 23:00:00', 'UTC')
|
||||
AND InIfBoundary = 'external'
|
||||
GROUP BY Time
|
||||
ORDER BY Time WITH FILL
|
||||
FROM toStartOfInterval(toDateTime('2009-11-10 23:00:00', 'UTC'), INTERVAL (intDiv(864, 1)*1) second)
|
||||
FROM toStartOfInterval(toDateTime('2009-11-10 23:00:00', 'UTC'), INTERVAL max2(intDiv(864, 1)*1, 1) second)
|
||||
TO toDateTime('2009-11-11 23:00:00', 'UTC')
|
||||
STEP (intDiv(864, 1)*1)`).
|
||||
STEP toUInt32(max2(intDiv(864, 1)*1, 1))`).
|
||||
SetArg(1, expected).
|
||||
Return(nil)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user