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

"Duration" reported in API does not include time spent in queue.

    • Icon: Bug Bug
    • Resolution: Not A Defect
    • Icon: Major Major
    • core
    • None

      The value reported at /job/jobname/api/json?tree=builds[duration] does not include time spent waiting for an available worker. I can't find another attribute that has this information in it.

      This is important to me because I care about the total time someone is spent waiting for a build, not just the actual execution.

      Thanks,
      Xavier

      (P.S. http://javadoc.jenkins-ci.org/hudson/model/Run.html#getDuration() is not clear whether the return value includes queue time or not.)

      Jenkins ver. 1.532.2

          [JENKINS-23928] "Duration" reported in API does not include time spent in queue.

          Daniel Beck added a comment -

          This is by design. Unexpected downtime of a node would completely kill your duration statistics otherwise.

          To get load related statistics, try /load-statistics (also per node, per label).

          For the time spent in the queue per build, try using the Metrics plugin, it adds an action to builds that shows wait time, build time, and total time. May even expose this on the API.

          Daniel Beck added a comment - This is by design. Unexpected downtime of a node would completely kill your duration statistics otherwise. To get load related statistics, try /load-statistics (also per node, per label). For the time spent in the queue per build, try using the Metrics plugin, it adds an action to builds that shows wait time, build time, and total time. May even expose this on the API.

          Xavier Shay added a comment -

          > Unexpected downtime of a node would completely kill your duration statistics otherwise.

          That's desirable for end-user metrics - doesn't matter why someone is waiting.

          Thanks for your suggestions!

          Xavier Shay added a comment - > Unexpected downtime of a node would completely kill your duration statistics otherwise. That's desirable for end-user metrics - doesn't matter why someone is waiting. Thanks for your suggestions!

            Unassigned Unassigned
            xaviershay Xavier Shay
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: