New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Disable DiskUsageCollector when its option is unchecked (JENKINS-66790) #364
Disable DiskUsageCollector when its option is unchecked (JENKINS-66790) #364
Conversation
I'll be able to test the changes right after I get information how to build the project without any issues (read more: #337 (comment)). |
7027c85
to
02788d8
Compare
The `DiskUsageCollector` class uses the `ConfigurationUtils#getCollectDiskUsage` method to determine whether the disk usage statistics should be collected or not. Unfortunately, the mentioned method ignores the checkbox configuration option available on the `Configure System` page. The `PrometheusConfiguration` class keeps the requested value in the `collectDiskUsage` field which is set with the default value if needed. The `ConfigurationUtils#getCollectDiskUsage` method is removed and the `PrometheusConfiguration#getCollectDiskUsage` method is used instead. The `PrometheusConfiguration#getDefaultCollectDiskUsage` method is no longer used, so it has been removed too.
02788d8
to
047ba8b
Compare
@markyjackson-taulia please, take a look. If you agree with changes, it would be great to release a new version of the plugin after the merge. |
I agree with the change and will do a release tomorrow night |
@markyjackson-taulia could you provide ETA when it should be available? |
My hope is tomorrow. I am currently on a business trip |
@agabrys Pr has been approved and merged. Release has started and it will take several hours for it to become available in the update center. Thank you for this work and your patients. |
Running into test errors: https://pastebin.com/vQi71zNS cc @agabrys |
The plugin should be built with Java 8, but Java 17 is used:
|
@agabrys thanks for catching that. I must have changed and forgot to put that back.
|
Fixes JENKINS-66790.
Changes proposed
The
DiskUsageCollector
class uses theConfigurationUtils#getCollectDiskUsage
method to determine whether the disk usage statistics should be collected or not. Unfortunately, the mentioned method ignores the checkbox configuration option available on theConfigure System
page. ThePrometheusConfiguration
class keeps the requested value in thecollectDiskUsage
field which is set with the default value if needed. TheConfigurationUtils#getCollectDiskUsage
method is removed and thePrometheusConfiguration#getCollectDiskUsage
method is used instead.The
PrometheusConfiguration#getDefaultCollectDiskUsage
method is no longer used, so it has been removed too.Checklist
Notify
@markyjackson-taulia