How to install the trends-related plugin in Jenkins?

HOME

The previous tutorial explained Build History Metrics in Jenkins. This tutorial explains the trend-related plugin in Jenkins.

How to install the trends-related plugin in Jenkins?

To see overall trends in Jenkins, there are plugins available to gather information from within the builds and Jenkins and display them in a graphical format. One example of such a plugin is the ‘global-build-stats plugin’. So let’s go through the steps for this.

To know more about global build stats, please refer to this documentation.

Pre-Requisite:

Jenkins installed and started on the computer

Implementation Steps

Step 1: Start the Jenkins server and open the browser and navigate to the localhost and the port in which Jenkins is running

http://localhost:8080/

Step 2: Log in to Jenkins UI

Provide a username and password and click on the Sign-in Button.

Step 3: Go to Manage Plugins

Click on the Manage Jenkins. Choose Manage Plugins.

Step 4: Add the global-build-stats plugin

On the Plugins Page, go to the Available option.

  1. Select the “global-build-stats” Plugin
  2. Click on “Install without restart”. The plugin will take a few moments to finish downloading depending on your internet connection, and will be installed automatically.
  3. You can also select the option Download now and Install after the restart” button. In which plugin is installed after the restart
  4. You will be shown a “No updates available” message if you already have the TestNG Report plugin installed.

Click on the checkbox “Restart Jenkins when installation is complete when no jobs are running“.

Step 5: Verify the global-build-stats plugin

For verification of the successful installation of the plugin, we can go to the “installed”  tab, and we can see the presence of the build history metrics plugin.

Step 6 − Generate Global Build Stats metrics

Go to the Jenkins dashboard and click on Manage Jenkins. In the Manage Jenkins screen, scroll down, and now you will now see an option called “Global Build Stats“. Click on this link.

Click on the button “Initialize stats“. What this does is that it gathers all the existing records for builds that have already been carried out, and charts can be created based on these results.

Once the data has been initialized, it’s time to create a new chart. Click on the “Create new chart” link.

A pop-up will come to enter the relevant information for the new chart details. Enter the following mandatory information.

  • Title – Any title information, for this example is given as ‘Demo’
  • Chart Width – 800
  • Chart Height – 600
  • Chart time scale – Daily
  • Chart time length – 30 days

The rest of the information can remain as it is. Once the information is entered, click on Create New chart.

You will now see the chart which displays the trends of the builds over time.

If you click on any section within the chart, it will give you a drill-down of the details of the job and its builds.

Congratulations on making it through this tutorial and hope you found it useful! Happy Learning!! Cheers!!

Advertisement

Build History Metrics in Jenkins

HOME

Jenkins includes a number of 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.

What is Build History Plugin?

This plugin calculates the following metrics for all of your builds once installed:

  • Mean Time To Failure (MTTF)
  • Mean Time To Recovery (MTTR)
  • Standard Deviation of Build Times

The calculated metrics are displayed in a table on each jobs page showing the metric for the last 7 days, last 30 days, and all time.

How to install the metric-related plugin in Jenkins?

Implementation Steps

Step 1: Start the Jenkins server and open the browser and navigate to the localhost and the port in which Jenkins is running

http://localhost:8080/

Step 2: Log in to Jenkins UI

Provide a username and password and click on the Sign-in Button.

Step 3: Download and Install Build History Metrics Plugin

Click on the Manage Jenkins. Choose Manage Plugins.

Step 4: Add the Build History Metrics Plugin

On the Plugins Page, go to the Available option.

  1. Select the Build History Metrics Plugin
  2. Click on Install without restart. The plugin will take a few moments to finish downloading depending on your internet connection, and will be installed automatically.
  3. You can also select the option Download now and Install after the restart button. In which plugin is installed after the restart
  4. You will be shown a “No updates available” message if you already have the TestNG Report plugin installed.

Step 5: Restart Jenkins

Click on the checkbox “Restart Jenkins when installation is complete when no jobs are running“.

 For verification of the successful installation of the plugin, we can go to the “installed”  tab, and we can see the presence of the build history metrics plugin.

How to view metrics in Jenkins?

Step 1: Go to the Jenkins dashboard and click on any job. Here we can see the metrics like MTTR, MTTF, and Standard deviation in the tabular form highlighted below.

Note: If, after installing the plugin below, the tabular form does not display, then restart Jenkins.

Metrics are shown for the last 7 days, last 30 days, and all time.

Step 2: Run any job for which the build is showing as failed status, and then we can see the time for MTTR and MTTF as mentioned in the below image.

Congratulations on making it through this tutorial and hope you found it useful! Happy Learning!! Cheers!!

Jenkins Tutorial

HOME

Jenkins is a self-contained, open-source automation server that can be used to automate all sorts of tasks related to building, testing, and delivering or deploying software.

Jenkins can be installed through native system packages, Docker, or even run standalone by any machine with a Java Runtime Environment (JRE) installed.

Chapter 1 What is Jenkins?
Chapter 2 How to install Jenkins on Windows 10
Chapter 3 How to configure Java and Maven in Jenkins
Chapter 4 Integration Of Jenkins With Selenium WebDriver
Chapter 5 How to install Maven Plugin in Jenkins
Chapter 6 How to install Plugins from Jenkins CLI?
Chapter 7 Integrate Gradle project with Jenkins
Chapter 8 Jenkins GitLab Integration
Chapter 9 How to install Plugins in Jenkins
Chapter 10 How to Schedule a Jenkins Job
Chapter 11 Build History Metrics in Jenkins
Chapter 12 How to install the trends-related plugin in Jenkins?
Chapter 13 How to run parameterized Selenium tests in Jenkins

Reports in Jenkins

Chapter 1 How to generate TestNG Report in Jenkins
Chapter 2 How to create JUnit Report in Jenkins
Chapter 3 Integration of Allure Report with Jenkins
Chapter 4 How to generate HTML Reports in Jenkins
Chapter 5 Integration of Cucumber Report with TestNG in Jenkins
Chapter 6 Serenity with Jenkins

Jenkins Pipeline

Chapter 1 Jenkins Pipeline
Chapter 2 How to create Jenkins pipeline for Selenium tests
Chapter 3 How to create Jenkins pipeline for Serenity tests
Chapter 4 How to create Jenkins pipeline for Cucumber tests
Chapter 5 How to create Jenkins pipeline for Extent Report
Chapter 6 How to create Jenkins pipeline for Gradle project