mirror of
https://github.com/akvorado/akvorado.git
synced 2025-12-11 22:14:02 +01:00
console: only return complete intervals for the graph widget
This commit is contained in:
@@ -178,10 +178,11 @@ SELECT
|
||||
toStartOfInterval(TimeReceived, INTERVAL %d second) AS Time,
|
||||
SUM(Bytes*SamplingRate*8/%d)/1000/1000/1000 AS Gbps
|
||||
FROM flows
|
||||
WHERE TimeReceived > date_sub(hour, 24, now())
|
||||
WHERE TimeReceived > toStartOfInterval(date_sub(hour, 24, now()), INTERVAL %d second)
|
||||
AND TimeReceived < toStartOfInterval(now(), INTERVAL %d second)
|
||||
AND InIfBoundary = 'external'
|
||||
GROUP BY Time
|
||||
ORDER BY Time`, interval, interval)
|
||||
ORDER BY Time`, interval, interval, interval, interval)
|
||||
|
||||
results := []struct {
|
||||
Time time.Time `json:"t"`
|
||||
|
||||
@@ -293,7 +293,8 @@ SELECT
|
||||
toStartOfInterval(TimeReceived, INTERVAL 864 second) AS Time,
|
||||
SUM(Bytes*SamplingRate*8/864)/1000/1000/1000 AS Gbps
|
||||
FROM flows
|
||||
WHERE TimeReceived > date_sub(hour, 24, now())
|
||||
WHERE TimeReceived > toStartOfInterval(date_sub(hour, 24, now()), INTERVAL 864 second)
|
||||
AND TimeReceived < toStartOfInterval(now(), INTERVAL 864 second)
|
||||
AND InIfBoundary = 'external'
|
||||
GROUP BY Time
|
||||
ORDER BY Time`).
|
||||
|
||||
Reference in New Issue
Block a user