where the Failed Tests column is the sum of all the failed tests across all builds in Test_Group1 project and Failed Test Percentage is the calculated as (sum of all failed tests from all builds in Test_group1 project / sum of total tests from all builds in Test_group1 project)
What I tried doing is creating a scripted field called Failed Test Percentage but this only calculates failure percentage per entry not as an aggregation as wanted in the table above.
Any way to do this?
I would also settle for simply adding a pie chart that shows the percentage of failed tests over total tests for a all builds in a project if this possible.
Hi @farooq.muhammad41
I think you can achieve this using TSVB. The only drawback of TSVB is that you need at least one date field (but looking at the data model seems that you can have one associated timestamp).
In TSVB you can create a bucket script aggregation where you can specify 2 aggregations like sum all the total tests and sum all the failed tests. And than you can add a script that compute that percentage.
Just remember two main trick: TSVB works on the last bucket computed depending on the time window and interval configured. This means that if you want to compute this data on a time window of 2 weeks, you also have to specify manually the interval to 2w and uncheck the drop last bucket option.
Here is the example I've done locally to achieve the result you wanted:
For this test I've added a date field with some random dates this year, configured the Time picker with a window that cover those dates and selected a large interval in the panel options:
For the Piechart I think it's not currently possible. The thing is that you want to achieve that using already aggregated data. If you have a set of single document one each test, failed or not, you will be able to build that piechart just specifying the aggregation by terms (test_status) and this will shows the total of failed and succeed tests.
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.