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

Make currentBuild.duration more meaningful and add string equivalent

      currentBuild.duration always returns 0, since Run.duration is 0 until the run completes. So we should switch currentBuild.duration to return System.currentTimeMillis() - currentBuild.startTimeInMillis and add currentBuild.durationString, calling Run.getDurationString().

          [JENKINS-42952] Make currentBuild.duration more meaningful and add string equivalent

          Andrew Bayer added a comment -

          Andrew Bayer added a comment - PR up at  https://github.com/jenkinsci/workflow-support-plugin/pull/33

          Code changed in jenkins
          User: Jesse Glick
          Path:
          src/main/java/org/jenkinsci/plugins/workflow/job/WorkflowRun.java
          http://jenkins-ci.org/commit/workflow-job-plugin/0cfa03044c4a88c80df4ca18b322e4532f7d2b81
          Log:
          Deleting obsolete comment noticed in relation to JENKINS-42952.

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Jesse Glick Path: src/main/java/org/jenkinsci/plugins/workflow/job/WorkflowRun.java http://jenkins-ci.org/commit/workflow-job-plugin/0cfa03044c4a88c80df4ca18b322e4532f7d2b81 Log: Deleting obsolete comment noticed in relation to JENKINS-42952 .

          Code changed in jenkins
          User: Andrew Bayer
          Path:
          src/main/java/org/jenkinsci/plugins/workflow/support/steps/build/RunWrapper.java
          src/test/java/org/jenkinsci/plugins/workflow/support/steps/build/RunWrapperTest.java
          http://jenkins-ci.org/commit/workflow-support-plugin/fc61d8852021a4ddc471f7aa05c4e28c4f630f12
          Log:
          [FIXED JENKINS-42952] Make currentBuild.duration meaningful

          ...and add currentBuild.durationString.

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Andrew Bayer Path: src/main/java/org/jenkinsci/plugins/workflow/support/steps/build/RunWrapper.java src/test/java/org/jenkinsci/plugins/workflow/support/steps/build/RunWrapperTest.java http://jenkins-ci.org/commit/workflow-support-plugin/fc61d8852021a4ddc471f7aa05c4e28c4f630f12 Log: [FIXED JENKINS-42952] Make currentBuild.duration meaningful ...and add currentBuild.durationString.

            abayer Andrew Bayer
            abayer Andrew Bayer
            Votes:
            1 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: