• Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Trivial Trivial
    • core, (1)
      metrics-plugin
    • None
    • Jenkins 2.138.3

      I see an incorrect display of task execution time.

      For example, 

      This run spent:

      • 11 min waiting;
      • 13 min build duration;
      • 13 min total from scheduled to completion.

      In fact, the build was executed in just 2 minutes, but i see 13 minutes (waiting + exec time).

      JSON contains correct timings:

      "buildableTimeMillis":702663,"buildingDurationMillis":832158,"executingTimeMillis":129299.

       

       

        1. build.png
          build.png
          28 kB
        2. jenkins_execution_time.png
          jenkins_execution_time.png
          14 kB
        3. Screenshot 2019-02-07 at 12.23.35.png
          Screenshot 2019-02-07 at 12.23.35.png
          45 kB
        4. spisok.png
          spisok.png
          77 kB

          [JENKINS-54689] Incorrect display build duration time

          I am working on reproducing this error. 

          Can you clarify which two reports of build time disagree?

          Which display of task execution time are you speaking of? (The pipeline dashboard? For example, I browse to my Jenkins server running on an aws instance at  http://54.198.76.254:8080/ , and then click on my project, to take me to the pipeline dashboard. I named my project 'foo'. So the final address in my browser is http://54.198.76.254:8080/job/foo/. This page gives me times for all the different stages of my Jenkins pipeline)

          And the second source for build time (the JSON source), are you finding this at $BUILD_URL/api/json? For example, when I go to http://54.198.76.254:8080/job/foo/1/api/json?pretty=true I can see a "duration" entry with a value of 17994.

          Stephen French added a comment - I am working on reproducing this error.  Can you clarify which two reports of build time disagree? Which display of task execution time are you speaking of? (The pipeline dashboard? For example, I browse to my Jenkins server running on an aws instance at  http://54.198.76.254:8080/  , and then click on my project, to take me to the pipeline dashboard. I named my project 'foo'. So the final address in my browser is http://54.198.76.254:8080/job/foo/ . This page gives me times for all the different stages of my Jenkins pipeline) And the second source for build time (the JSON source), are you finding this at $BUILD_URL/api/json? For example, when I go to http://54.198.76.254:8080/job/foo/1/api/json?pretty=true I can see a "duration" entry with a value of 17994.

          Maksim Kolesnikov added a comment - - edited

          I run several builds and some of them are queued. 

          On the screen build was in the queue for 90 second. 

          The build worked about 138 seconds. But on build page I see 3 min 49 sec build duration.

          Сause it shows all time given the queue time, not the net execution time.

          Also this wrong time is shown in the build list:

           

          I think on these places we must use "executingTimeMillis" value.

          Values from JSON for my example are:

          "executingTimeMillis":138877

          "buildableTimeMillis":90665

          "buildingDurationMillis":229616

          Maksim Kolesnikov added a comment - - edited I run several builds and some of them are queued.  On the screen build was in the queue for 90 second.  The build worked about 138 seconds. But on build page I see 3 min 49 sec build duration. Сause it shows all time given the queue time, not the net execution time. Also this wrong time is shown in the build list:   I think on these places we must use "executingTimeMillis" value. Values from JSON for my example are: "executingTimeMillis":138877 "buildableTimeMillis":90665 "buildingDurationMillis":229616

          Markus Winter added a comment -

          Technically the duration is the time the job started until it finished. We have pipeline jobs here, they start without the need of an executor, so they usually do not spent any time in the queue. So I assume the job was waiting in between to get a free slot on an agent. So what me might need is an additional column with Execution time.

           

          Markus Winter added a comment - Technically the duration is the time the job started until it finished. We have pipeline jobs here, they start without the need of an executor, so they usually do not spent any time in the queue. So I assume the job was waiting in between to get a free slot on an agent. So what me might need is an additional column with Execution time.  

          Thomas added a comment -

          We ran into the same issue since our builds can sit in the queue for some time. I fixed this by adding a execution time entry to the summary.jelly and summary.properties file in src/resources/jenkins/metrics/impl/TimeInQueueAction/

          In the jelly I added "<li>${%executing(it.executingTimeString)}</li>" below the building entry. And in the properties I added "executing={0} execution duration;" below the building entry as well. Then the resulting page in jenkins looks like the image below. I'm not sure how to submit a patch but if someone wants to point me to how to do that I can. Otherwise this may be a decent solution to resolve this issue. 

          Thomas added a comment - We ran into the same issue since our builds can sit in the queue for some time. I fixed this by adding a execution time entry to the summary.jelly and summary.properties file in src/resources/jenkins/metrics/impl/TimeInQueueAction/ In the jelly I added "<li>${%executing(it.executingTimeString)}</li>" below the building entry. And in the properties I added "executing={0} execution duration;" below the building entry as well. Then the resulting page in jenkins looks like the image below. I'm not sure how to submit a patch but if someone wants to point me to how to do that I can. Otherwise this may be a decent solution to resolve this issue. 

            stephenfrench9 Stephen French
            maxx_nomad Maksim Kolesnikov
            Votes:
            1 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated: