From 300481fd168e023f76ca37db219eeeaa92960883 Mon Sep 17 00:00:00 2001 From: Ember Keske Date: Thu, 26 Oct 2023 05:13:52 +0200 Subject: [PATCH] fix: dont cut off next hop graph Closes monogon-dev/NetMeta#131 Change-Id: Iaa6c1e4b2667f40b1e1758a41c425437fcf55c87 Reviewed-on: https://review.monogon.dev/c/NetMeta/+/2240 Reviewed-by: Tim Windelschmidt --- deploy/dashboards/NetMeta_Overview.cue | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/deploy/dashboards/NetMeta_Overview.cue b/deploy/dashboards/NetMeta_Overview.cue index 42cff43..bbd0662 100644 --- a/deploy/dashboards/NetMeta_Overview.cue +++ b/deploy/dashboards/NetMeta_Overview.cue @@ -65,17 +65,20 @@ _trafficStatisticQueries: { """# "Top 100 Next Hop": #""" - SELECT + SELECT time, NextHop, BitsPerSecond + FROM + (SELECT $__timeInterval(TimeReceived) as time, NextHop, - (sum(Bytes * SamplingRate) * 8 / $__interval_s) AS BitsPerSecond + (sum(Bytes * SamplingRate) * 8 / $__interval_s) AS BitsPerSecond, + row_number() over (partition by time order by BitsPerSecond DESC) as row_num FROM flows_raw WHERE $__timeFilter(TimeReceived) \#(_filtersWithHost) AND NextHop != toIPv6('::') GROUP BY time, NextHop - ORDER BY time - LIMIT 100 + ORDER BY time) as subquery + where row_num <= 100 """# "Traffic per Ingress Interface": #"""