From 5a796369e23eff5b9176d9940d2b7ac4e92f55f1 Mon Sep 17 00:00:00 2001 From: Matilda Clerke Date: Thu, 17 Oct 2024 14:52:46 +1100 Subject: [PATCH] 7311: Add default implementation to LabelledGauge.isLabelsObserved Signed-off-by: Matilda Clerke --- CHANGELOG.md | 2 +- plugin-api/build.gradle | 2 +- .../besu/plugin/services/metrics/LabelledGauge.java | 4 +++- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index fd5c7ccb0e..d9c8290f26 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,9 +1,9 @@ # Changelog ## [Unreleased] +- Added isLabelsObserved to LabelledGauge in plugin-api. Default implementation returns false. ### Breaking Changes -- Added isLabelsObserved to LabelledGauge in plugin-api. Implementing classes will need to also implement this method ### Upcoming Breaking Changes diff --git a/plugin-api/build.gradle b/plugin-api/build.gradle index 5d2d28d196..91fb45239d 100644 --- a/plugin-api/build.gradle +++ b/plugin-api/build.gradle @@ -71,7 +71,7 @@ Calculated : ${currentHash} tasks.register('checkAPIChanges', FileStateChecker) { description = "Checks that the API for the Plugin-API project does not change without deliberate thought" files = sourceSets.main.allJava.files - knownHash = 'VN2JB2HPpEUDQaDvd7QcMkmmgedasVChfA8tnSf1GHU=' + knownHash = 'WRdnBaP05fItpWHYSFz/vBBlRWL3sLGqzR3tzd+pOkA=' } check.dependsOn('checkAPIChanges') diff --git a/plugin-api/src/main/java/org/hyperledger/besu/plugin/services/metrics/LabelledGauge.java b/plugin-api/src/main/java/org/hyperledger/besu/plugin/services/metrics/LabelledGauge.java index 16a2f1e59b..5357c6505a 100644 --- a/plugin-api/src/main/java/org/hyperledger/besu/plugin/services/metrics/LabelledGauge.java +++ b/plugin-api/src/main/java/org/hyperledger/besu/plugin/services/metrics/LabelledGauge.java @@ -33,5 +33,7 @@ public interface LabelledGauge { * @return true if the supplied labelValues are already observed by this LabelledGauge, false * otherwise */ - boolean isLabelsObserved(final String... labelValues); + default boolean isLabelsObserved(final String... labelValues) { + return false; + } }