example sceenshot
I am using Grafana to visualize data from a PostgreSQL data source. I want to visualize when a condition exist for a minimum of 3 minutes or longer, using a times series based graph. I added a screenshot to visualize what I want. When condition x = 0 and y =1 and the condition exist longer than 3 minutes then I want it to show up the graph. In the example you can see that x=0 and y=1 in row 2 and 3, but the total time is 6 seconds. So I don’t want it to show up in the graph as a 1, because it’s no longer than 3 minutes. From row 9 to row 14 the x=0 and y=1 and the total time is 3 minutes and 17 seconds, so this I want to show up the graph as 1, because the total time is longer than 3 minutes.
The data is time series based, but the data has different time intervals. So the time between rows can be several seconds or it can be several minutes or more.
I am new to SQL so I don’t know all the possibilities, so I don’t know if what I want is even possible. Any help is much appreciated.
I have thought of using groups, but I don’t how to generate unique values so that the 0 and 1’s are grouped. Also with groups I think I don’t get a column with 0 and 1’s the indicate in the graph were the condition is met.
Edwin is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.