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

Sub Task Time in Queue is not getting captured in metrics plugin


    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major Major
    • metrics-plugin
    • metrics plugin
      jenkins 2.332.4
    • metrics:4.2.13-420.vea_2f17932dd6

      In previous versions of metrics plugin we were adding RunResolver to provide a run which was further used to add  SubTaskTimeInQueueAction as and when an item left the queue.

      In this version we have observed that SubTaskTimeInQueueAction is only added in taskCompleted method under the condition if Work Unit is not main work https://github.com/jenkinsci/metrics-plugin/blob/metrics- 

      But due to above condition it is not adding any of the sub task time as if you consider the Jenkins core code in WorkUnitContext this task completed is called https://github.com/jenkinsci/jenkins/blob/jenkins-2.332.4/core/src/main/java/hudson/model/queue/WorkUnitContext.java#L177  under condition https://github.com/jenkinsci/jenkins/blob/jenkins-2.332.4/core/src/main/java/hudson/model/queue/WorkUnitContext.java#L171.


      Essentially it means WorkUnitContext will call taskCompleted in the condition if Work unit is main work and in the metrics plugin we are checking if the Work Unit is not the main work only then add sub task times.

      Due to above scenario we see a regression and we are not able to see the sub task times being present and on the UI we only see the main queue time.


            allan_burdajewicz Allan BURDAJEWICZ
            sundergopalsingh Sunder Gopal Singh
            1 Vote for this issue
            4 Start watching this issue