Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-20361

New Column Request: Average Build Duration

    Details

    • Similar Issues:

      Description

      We have a large number of jobs that run for several hours, but the amount of deviation between each job's duration can be as much as several hours depending on overall load. It would be far more interesting to get the average duration of the job, which surprisingly isn't available in Jenkins. Could such a column be added via this plugin instead?

        Attachments

          Activity

          Hide
          scm_issue_link SCM/JIRA link daemon added a comment -

          Code changed in jenkins
          User: Fred G
          Path:
          src/main/java/jenkins/plugins/extracolumns/BuildDurationColumn.java
          src/main/resources/jenkins/plugins/extracolumns/BuildDurationColumn/column.jelly
          src/main/resources/jenkins/plugins/extracolumns/BuildDurationColumn/column.properties
          src/main/resources/jenkins/plugins/extracolumns/BuildDurationColumn/columnHeader.jelly
          src/main/resources/jenkins/plugins/extracolumns/BuildDurationColumn/columnHeader_de.properties
          src/main/resources/jenkins/plugins/extracolumns/BuildDurationColumn/column_de.properties
          src/main/resources/jenkins/plugins/extracolumns/BuildDurationColumn/config.jelly
          src/main/resources/jenkins/plugins/extracolumns/BuildDurationColumn/config_de.properties
          src/main/resources/jenkins/plugins/extracolumns/Messages.properties
          src/main/resources/jenkins/plugins/extracolumns/Messages_de.properties
          http://jenkins-ci.org/commit/extra-columns-plugin/e4644c5ede5cca6b365aa48bb659c6170e4638e5
          Log:
          [FIXED JENKINS-19534] [FIXED JENKINS-20361] Added the new column
          "Build Duration", which can be configured to show "Build Start" or
          "Average Build Duration".

          Compare: https://github.com/jenkinsci/extra-columns-plugin/compare/cbaaef99711c...e4644c5ede5c

          Show
          scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Fred G Path: src/main/java/jenkins/plugins/extracolumns/BuildDurationColumn.java src/main/resources/jenkins/plugins/extracolumns/BuildDurationColumn/column.jelly src/main/resources/jenkins/plugins/extracolumns/BuildDurationColumn/column.properties src/main/resources/jenkins/plugins/extracolumns/BuildDurationColumn/columnHeader.jelly src/main/resources/jenkins/plugins/extracolumns/BuildDurationColumn/columnHeader_de.properties src/main/resources/jenkins/plugins/extracolumns/BuildDurationColumn/column_de.properties src/main/resources/jenkins/plugins/extracolumns/BuildDurationColumn/config.jelly src/main/resources/jenkins/plugins/extracolumns/BuildDurationColumn/config_de.properties src/main/resources/jenkins/plugins/extracolumns/Messages.properties src/main/resources/jenkins/plugins/extracolumns/Messages_de.properties http://jenkins-ci.org/commit/extra-columns-plugin/e4644c5ede5cca6b365aa48bb659c6170e4638e5 Log: [FIXED JENKINS-19534] [FIXED JENKINS-20361] Added the new column "Build Duration", which can be configured to show "Build Start" or "Average Build Duration". Compare: https://github.com/jenkinsci/extra-columns-plugin/compare/cbaaef99711c...e4644c5ede5c
          Hide
          fredg Fred G added a comment -

          This has been fixed in version 1.12.

          Show
          fredg Fred G added a comment - This has been fixed in version 1.12.
          Hide
          mngoldeneagle Jesse Docken added a comment -

          What is the logic it uses when calculating the average? Does it only look at the past x number of builds, or does it look at all past jobs until it finds one that failed?

          Show
          mngoldeneagle Jesse Docken added a comment - What is the logic it uses when calculating the average? Does it only look at the past x number of builds, or does it look at all past jobs until it finds one that failed?
          Hide
          fredg Fred G added a comment -

          I'm actually calling

          Util.getTimeSpanString(job.getLastBuild().getEstimatedDuration());

          which calls

           hudson.model.Job.getEstimatedDurationCandidates()

          down the line.

          The JavaDoc of getEstimatedDurationCandidates() says:

          /**
            * Returns candidate build for calculating the estimated duration of the current run.
            * 
            * Returns the 3 last successful (stable or unstable) builds, if there are any.
            * Failing to find 3 of those, it will return up to 3 last unsuccessful builds.
            * 
            * In any case it will not go more than 6 builds into the past to avoid costly build loading.
            */
          
          Show
          fredg Fred G added a comment - I'm actually calling Util.getTimeSpanString(job.getLastBuild().getEstimatedDuration()); which calls hudson.model.Job.getEstimatedDurationCandidates() down the line. The JavaDoc of getEstimatedDurationCandidates() says: /** * Returns candidate build for calculating the estimated duration of the current run. * * Returns the 3 last successful (stable or unstable) builds, if there are any. * Failing to find 3 of those, it will return up to 3 last unsuccessful builds. * * In any case it will not go more than 6 builds into the past to avoid costly build loading. */

            People

            • Assignee:
              mngoldeneagle Jesse Docken
              Reporter:
              mngoldeneagle Jesse Docken
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: