Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Next Hop graph is cut off #131

Closed
yu-re-ka opened this issue Sep 26, 2023 · 3 comments
Closed

Next Hop graph is cut off #131

yu-re-ka opened this issue Sep 26, 2023 · 3 comments

Comments

@yu-re-ka
Copy link
Collaborator

The query for the Next Hop panel in the overview dashboard has a LIMIT 100, but each output row is a data point and not a time series, so it cuts off the panel after the 100 earliest resulting data points.

@yu-re-ka
Copy link
Collaborator Author

yu-re-ka commented Sep 26, 2023

Patch by @n0emis

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":
 		#"""

@fionera
Copy link
Collaborator

fionera commented Sep 26, 2023

@n0emis is it fine for you if I make a commit with that patch with you as author?

@n0emis
Copy link
Contributor

n0emis commented Sep 28, 2023

Yes, sure. Go ahead

fionera pushed a commit that referenced this issue Nov 9, 2023
Closes #131

Change-Id: Iaa6c1e4b2667f40b1e1758a41c425437fcf55c87
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants