Step 1. Add the JitPack repository to your build file
Add it in your root settings.gradle at the end of repositories:
dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
repositories {
mavenCentral()
maven { url 'https://jitpack.io' }
}
}
Add it in your settings.gradle.kts at the end of repositories:
dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
repositories {
mavenCentral()
maven { url = uri("https://jitpack.io") }
}
}
Add to pom.xml
<repositories>
<repository>
<id>jitpack.io</id>
<url>https://jitpack.io</url>
</repository>
</repositories>
Add it in your build.sbt at the end of resolvers:
resolvers += "jitpack" at "https://jitpack.io"
Add it in your project.clj at the end of repositories:
:repositories [["jitpack" "https://jitpack.io"]]
Step 2. Add the dependency
dependencies {
implementation 'com.github.kayano:build-history-metrics:v0.1.0'
}
dependencies {
implementation("com.github.kayano:build-history-metrics:v0.1.0")
}
<dependency>
<groupId>com.github.kayano</groupId>
<artifactId>build-history-metrics</artifactId>
<version>v0.1.0</version>
</dependency>
libraryDependencies += "com.github.kayano" % "build-history-metrics" % "v0.1.0"
:dependencies [[com.github.kayano/build-history-metrics "v0.1.0"]]
Jenkins plugin to send simple build statistics to InfluxDB
Before sending data to InfluxDB connection to InfluxDB needs to be configured in global jenkins configuration
Plugin sends data to an InfluxDB measurement jenkins_build_data
Following fields are being send to InfluxDB database
| Field | Description | | --------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- | | job_name | jenkins job full display name | | build_number | | | build_result | SUCCESS, UNSTABLE, FAILURE, NOT_BUILT, ABORTED | | build_timestamp | when the build is scheduled for execution | | build_duration | miliseconds it took to build a job | | queuing_duration | miliseconds a job spent in a build queue | | total_duration | build_duration + queuing_duration | | build_status_message | stable, unstable, aborted, not built, back to normal, broken for a long time, broken since this build, broken since build {#build_number} | | job_owner | job's primary owner email | | job_score | the percentage health score (from 0 to 100 inclusive). |
Following tags are being send to InfluxDB database
| Tag | | -------------------------- | | job_name | | build_result | | job_owner | | job_score |