0

Good afternoon. So I am creating a grafana dashboard and I am having a problem with counting a unique number in a list until the number changes. I am counting the number of times a service is unavailable, when the ping rate is 100% loss. The check happens 48 times in one day. So I have a query that shows the timestamp and the ping loss number. What I want to do is to count the number of 100's until the result is any other number. I want the result to be from now back to the first non-100. I am using influx as the data source.

Example data

Date              result
1/1/2023 02:01     100
1/1/2023 01:31     100
1/1/2023 01:01     100
1/1/2023 12:31      88
1/1/2023 12:01      24

In the above data set the result would be 3. The counting would stop at the 88. Like I said I have the query setup already to pull the data into grafana now I just need a hand on the rest. Thank you for your help.

I have been at it for a while, I have tried a bunch of different things from this site and others. Really open to any suggestions.

markalex
  • 8,623
  • 2
  • 7
  • 32
Ivyand
  • 1
  • 1
  • Such a task is usually better solved on the dbms' side. I'm not familiar with influx to say anything more useful, but I suggest you digging into that direction. – markalex May 17 '23 at 18:35
  • Thank you for the quick post. Unfortunately, I can only manipulate the data results. No backend access for me. – Ivyand May 17 '23 at 18:52
  • What do you mean? If you can apply transformation to panel, than you also can change query to database. I suggested you to write a correct query, that will return data that you want. – markalex May 17 '23 at 19:01
  • Outstanding suggestion thank you. – Ivyand May 18 '23 at 13:24

0 Answers0