jenkinsci / datadog-plugin

A Jenkins plugin used to forward metrics, events, and service checks to an account at Datadog, automatically.
https://plugins.jenkins.io/datadog/
MIT License
30 stars 48 forks source link

added extra conditions for counting executors #435

Closed rahulkaukuntla closed 1 month ago

rahulkaukuntla commented 1 month ago

What does this PR do?

Addresses issue #434

Description of the Change

This issue arose from calling two different classes: Computer and ComputerSet. Datadog directly calls on the executor methods in Computer.java for each computer, while Jenkins calls the ComputerSet.java methods which itself calls Computer.java for each computer.

However, ComputerSet.java applies some restrictions on when to call the executor methods of Computer.java--the number of busy executors and the number of total executors only considers online computers, while the number of free executors only considers computers that are either online or connecting, and which is accepting tasks. As such, in order to mimic how Jenkins counts total, free, and busy executors, this PR adds the ComputerSet.java (and by extension, Jenkins) restrictions to the Datadog plugin's calls to Computer.java.

Alternate Designs

Possible Drawbacks

Verification Process

Additional Notes

Release Notes

Review checklist (to be filled by reviewers)