Jenkins includes many plugins for displaying metrics for builds that take place over time. These metrics can help you understand your builds and how often they fail/pass over time. Consider the 'Build History Metrics plugin' as an example.
This plugin, once installed, calculates the below metrics for all of the builds.
- Mean Time To Recovery (MTTR)
- Mean Time To Failure (MTTF)
- Standard Deviation of Build Times
Step 1 – Click on ‘Manage Jenkins’ on the Jenkins dashboard.
Step 2 − Go to the ‘Manage Plugins’ option.
Step 3 − Navigate to the Available tab, search for the 'Build History Metrics plugin,' and select 'install without restart'.
Step 4 – The below screen will appear for successful plugin installation. Restart the Jenkins.
When you go to your Job page, you'll find a table that contains the calculated metrics. Metrics for the previous 7 days, last 30 days, and all-time are displayed.
There are plugins available that capture information from within the builds and Jenkins and display it in a graphical way to see overall trends in Jenkins. The 'Hudson global-build-stats plugin' is one such example. So, let's walk through the process.
Step 1 – Click on ‘Manage Jenkins; on the Jenkins dashboard
Step 2 − Go to the ‘Manage Plugins’ option
Step 3 – On the ‘Available’ tab, search for the ‘Hudson global-build-stats plugin’ and choose ‘install without restart’.
Step 4 − The below screen will appear to confirm successful plugin installation. Restart the Jenkins.
Please proceed to Steps 5 through 8 to view the Global statistics.
Step 5 Navigate to the Jenkins dashboard and select Manage Jenkins. Scroll down in the Manage Jenkins screen until you see an option labeled 'Global Build Stats.' Please follow this link.
Step 6 − Click the 'Initialise stats' button. This gathers all existing records for previous builds and allows charts to be created based on the results.
Step 7 − It's time to make a new chart now that the data has been initialised. Select the 'Create new chart' option.
Step 8 − A pop-up window will appear, prompting you to provide the required information for the new chart data. Enter the mandatory information below.
- Title – Any title information, for this example it is given as ‘Demo’
- Chart Height – 600
- Chart Width – 800
- Chart time length – 30 days
- Chart time scale – Daily
The remainder of the information can be left alone. After you've entered all of your data, click Create New Chart.
The chart that shows the trends of the build over some time will appear.
If you click on any portion of the chart, it will take you to a detailed breakdown of the job and its builds.