The number of successful builds.
This metric is calculated by counting the number of successful cicd_pipelines, such as Jenkins builds, GitLab pipelines and GitHub workflow runs in the given data range.
Data Sources Required
This metric relies on Jenkins builds, GitLab pipelines or GitHub workflow runs.
Data Transformation Required
N/A
SQL Queries
The following SQL shows how to find the total number of successful CI builds finished in the given time range.
SELECT count(*) FROM cicd_pipelines WHERE result = 'SUCCESS' and $__timeFilter(finished_date) ORDER BY 1
If you want to measure the monthly trend of the successful build count
in the screenshot below, please run the following SQL in Grafana.
WITH _builds as( SELECT DATE_ADD(date(finished_date), INTERVAL -DAYOFMONTH(date(finished_date))+1 DAY) as time, count(*) as build_count FROM cicd_pipelines WHERE result = "SUCCESS" and $__timeFilter(finished_date) -- the following condition will remove the month with incomplete data and finished_date >= DATE_ADD(DATE_ADD($__timeFrom(), INTERVAL -DAY($__timeFrom())+1 DAY), INTERVAL +1 MONTH) GROUP BY 1 ) SELECT date_format(time,'%M %Y') as month, build_count as "Build Count" FROM _builds ORDER BY time