I am trying to display test results from test runs. I have data that includes a test name, a test result, and a timestamp rounded down to the start of the day. Results are given once a day, so I only need to be as granular as once a day
Right now I am using influxdb to store data like this:
0:Object
name:“test_results”
columns:Array[3]
0:“time”
1:“result”
2:“test_name”
values:Array[20]
0:Array[1682035200000,0,test_name_c]
1:Array[1682035200000,1,test_name_b]
2:Array[1682035200000,2,test_name_c]
In this case results can be 0 - pass, 1 - rerun pass, 2 - rerun fail
I can’t seem to get any of the data to show up in the status history panel
What I would like to have happen is to have test names on the y axis on the left, and dates on the x axis at the bottom, and each cell where these values intersect will be a result, like this
test_name_a 0 1
test_name_b 1 1
test_name_c 2 0
April 21 April 22
But instead of the number it would be green for 0, yellow for 1, and red for 2
I have no idea if a status history panel is the right way to do this, or if I should be using a different panel, or maybe be organizing my data differently. Here is how I am setting up each data entry in python:
The data is getting to influxdb just fine, and my query is working. Query is: SELECT "time", "result", "test_name" FROM tests.."test_results" LIMIT 20
I have LIMIT 20 on there because otherwise it shows the error that there are too many data points, which I’m hoping to make this a very large, scrollable panel with a lot of test history in it.
Would appreciate any help, kind of lost on where to go from here.
Let’s go back to the query. It looks like one single data point (“0” at 2023-04-20 17:00:00.000). There is also a drop down selector at the bottom visible (test_results_result). What other options are in that selection box?
Are there any values (0, 1, 2) in the far right? Your screenshot is cropped.
In any event, the timestamp is always the same, so any sort of time series visualization in Grafana (such as Status History) will not display anything useful. Do you know why the timestamp is always the same? Do you have the time selector for something wide, e.g. 12 hours?
The time stamp is the same because this is just a single batch of information. I want the results to be daily results, with one result per day for each of the tests on the list.
The screenshot is cropped because I do not want to show the names of the tests, but that is all there is. A column of timestamps and a column of test names.
Do I need to structure my data differently? This is the main concern I have, I have no idea how to format my data in influx to make it status history friendly.
I have all the data for it. I just don’t know how to properly store that data in influx to make it show up in grafana. But I have a list of test names, the dates that they ran on, and the results they had.
Also, I have thousands of tests I could potentially list, and I would rather make this so it can dynamically create a different row for each test instead of having to create a new query for every single test.
Just coming back here to say thanks for your help @grant2 I wasn’t able to get multiple rows, but instead used your suggestion to have a variable to specify a single test. That will work for what I need. Your suggestions really helped, thanks again!