• Icon: Improvement Improvement
    • Resolution: Done
    • Icon: Minor Minor
    • influxdb-plugin
    • None
    • Jenkins 2.303.1 on Debian Buster. InfluxDB 1.8.9
    • 3.4

      Recently set up the InfluxDB plugin for our Jenkins controller with global listener on. Trying to monitor for excessive time waiting in queue because we are deploying VM agents and also to check for starvation.

      Noticed the time_in_queue values are all very small, < 10 s, even when VMs are being launched. If you look at the build page, it says "29 sec waiting." If you look at the "timings" page (attached), it says 8.9s waiting, 0s blocked, 20s buildable, for a total of 29s. time_in_queue value is 8954. Not sure if this is related to multibranch pipelines we are using, but the job waited 29 seconds before starting and I would expect the metric to reflect that.

          [JENKINS-66838] Add additional waiting time metrics

          Aleksi Simell added a comment -

          Hi,

          This is because the time_in_queue is got from getQueuingDurationMillis, which doesn't include "buildable" state in the calculation. The same library has API to get time in "buildable" state, so in theory it could be changed to add everything up before the build is "building". However, there's then the possibility of introducing unintuitive behaviour in other cases when people are not interested in "buildable" state, but only in the queue (as is the current behaviour).

          Aleksi Simell added a comment - Hi, This is because the time_in_queue is got from getQueuingDurationMillis , which doesn't include "buildable" state in the calculation. The same library has API to get time in "buildable" state, so in theory it could be changed to add everything up before the build is "building". However, there's then the possibility of introducing unintuitive behaviour in other cases when people are not interested in "buildable" state, but only in the queue (as is the current behaviour).

          Chris Chan added a comment -

          Thank you for the explanation. Is it possible for us to get them both then, please? The UI is showing the sum of the metrics, so I expected to find some metric that reflected that value.

          Chris Chan added a comment - Thank you for the explanation. Is it possible for us to get them both then, please? The UI is showing the sum of the metrics, so I expected to find some metric that reflected that value.

          Aleksi Simell added a comment -

          Yes, it's fairly easy to add metrics to the plugin. I believe it would be straight the `getWaitingDurationMillis`, but need to test if it's actually the value we want.

          Aleksi Simell added a comment - Yes, it's fairly easy to add metrics to the plugin. I believe it would be straight the `getWaitingDurationMillis`, but need to test if it's actually the value we want.

          Aleksi Simell added a comment -

          https://github.com/jenkinsci/influxdb-plugin/pull/149 Created to add new metrics to be sent by this plugin. The new metrics will be available in a new metric called metrics_data.

          Aleksi Simell added a comment - https://github.com/jenkinsci/influxdb-plugin/pull/149 Created to add new metrics to be sent by this plugin. The new metrics will be available in a new metric called metrics_data .

          Aleksi Simell added a comment -

          PR merged. This will be available in the next release.

          Aleksi Simell added a comment - PR merged. This will be available in the next release.

            aleksisimell Aleksi Simell
            tcchan Chris Chan
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: