From fa584217422c982199276fcdcfb88479f63231cb Mon Sep 17 00:00:00 2001 From: horizonzy Date: Fri, 18 Aug 2023 02:35:31 +0800 Subject: [PATCH 1/6] extract metrics-api module. --- zookeeper-metrics-providers/pom.xml | 1 + .../zookeeper-metrics-api/pom.xml | 28 +++++++++++++++++++ .../org/apache/zookeeper/common/Time.java | 0 .../org/apache/zookeeper/metrics/Counter.java | 0 .../apache/zookeeper/metrics/CounterSet.java | 0 .../org/apache/zookeeper/metrics/Gauge.java | 0 .../apache/zookeeper/metrics/GaugeSet.java | 0 .../zookeeper/metrics/MetricsContext.java | 0 .../zookeeper/metrics/MetricsProvider.java | 2 +- .../MetricsProviderLifeCycleException.java | 0 .../org/apache/zookeeper/metrics/Summary.java | 0 .../apache/zookeeper/metrics/SummarySet.java | 0 .../apache/zookeeper/server/RateLogger.java | 0 .../zookeeper-prometheus-metrics/pom.xml | 8 ++---- .../PrometheusMetricsProviderTest.java | 21 +++++++------- zookeeper-server/pom.xml | 5 ++++ 16 files changed, 47 insertions(+), 18 deletions(-) create mode 100644 zookeeper-metrics-providers/zookeeper-metrics-api/pom.xml rename {zookeeper-server => zookeeper-metrics-providers/zookeeper-metrics-api}/src/main/java/org/apache/zookeeper/common/Time.java (100%) rename {zookeeper-server => zookeeper-metrics-providers/zookeeper-metrics-api}/src/main/java/org/apache/zookeeper/metrics/Counter.java (100%) rename {zookeeper-server => zookeeper-metrics-providers/zookeeper-metrics-api}/src/main/java/org/apache/zookeeper/metrics/CounterSet.java (100%) rename {zookeeper-server => zookeeper-metrics-providers/zookeeper-metrics-api}/src/main/java/org/apache/zookeeper/metrics/Gauge.java (100%) rename {zookeeper-server => zookeeper-metrics-providers/zookeeper-metrics-api}/src/main/java/org/apache/zookeeper/metrics/GaugeSet.java (100%) rename {zookeeper-server => zookeeper-metrics-providers/zookeeper-metrics-api}/src/main/java/org/apache/zookeeper/metrics/MetricsContext.java (100%) rename {zookeeper-server => zookeeper-metrics-providers/zookeeper-metrics-api}/src/main/java/org/apache/zookeeper/metrics/MetricsProvider.java (97%) rename {zookeeper-server => zookeeper-metrics-providers/zookeeper-metrics-api}/src/main/java/org/apache/zookeeper/metrics/MetricsProviderLifeCycleException.java (100%) rename {zookeeper-server => zookeeper-metrics-providers/zookeeper-metrics-api}/src/main/java/org/apache/zookeeper/metrics/Summary.java (100%) rename {zookeeper-server => zookeeper-metrics-providers/zookeeper-metrics-api}/src/main/java/org/apache/zookeeper/metrics/SummarySet.java (100%) rename {zookeeper-server => zookeeper-metrics-providers/zookeeper-metrics-api}/src/main/java/org/apache/zookeeper/server/RateLogger.java (100%) diff --git a/zookeeper-metrics-providers/pom.xml b/zookeeper-metrics-providers/pom.xml index 054763d003a..c5be394651f 100755 --- a/zookeeper-metrics-providers/pom.xml +++ b/zookeeper-metrics-providers/pom.xml @@ -33,6 +33,7 @@ zookeeper-prometheus-metrics + zookeeper-metrics-api diff --git a/zookeeper-metrics-providers/zookeeper-metrics-api/pom.xml b/zookeeper-metrics-providers/zookeeper-metrics-api/pom.xml new file mode 100644 index 00000000000..ceea2498bde --- /dev/null +++ b/zookeeper-metrics-providers/zookeeper-metrics-api/pom.xml @@ -0,0 +1,28 @@ + + + 4.0.0 + + org.apache.zookeeper + zookeeper-metrics-providers + 3.10.0-SNAPSHOT + + + zookeeper-metrics-api + jar + Apache ZooKeeper - Metrics API + ZooKeeper Metrics API + + + + ch.qos.logback + logback-core + + + ch.qos.logback + logback-classic + + + + \ No newline at end of file diff --git a/zookeeper-server/src/main/java/org/apache/zookeeper/common/Time.java b/zookeeper-metrics-providers/zookeeper-metrics-api/src/main/java/org/apache/zookeeper/common/Time.java similarity index 100% rename from zookeeper-server/src/main/java/org/apache/zookeeper/common/Time.java rename to zookeeper-metrics-providers/zookeeper-metrics-api/src/main/java/org/apache/zookeeper/common/Time.java diff --git a/zookeeper-server/src/main/java/org/apache/zookeeper/metrics/Counter.java b/zookeeper-metrics-providers/zookeeper-metrics-api/src/main/java/org/apache/zookeeper/metrics/Counter.java similarity index 100% rename from zookeeper-server/src/main/java/org/apache/zookeeper/metrics/Counter.java rename to zookeeper-metrics-providers/zookeeper-metrics-api/src/main/java/org/apache/zookeeper/metrics/Counter.java diff --git a/zookeeper-server/src/main/java/org/apache/zookeeper/metrics/CounterSet.java b/zookeeper-metrics-providers/zookeeper-metrics-api/src/main/java/org/apache/zookeeper/metrics/CounterSet.java similarity index 100% rename from zookeeper-server/src/main/java/org/apache/zookeeper/metrics/CounterSet.java rename to zookeeper-metrics-providers/zookeeper-metrics-api/src/main/java/org/apache/zookeeper/metrics/CounterSet.java diff --git a/zookeeper-server/src/main/java/org/apache/zookeeper/metrics/Gauge.java b/zookeeper-metrics-providers/zookeeper-metrics-api/src/main/java/org/apache/zookeeper/metrics/Gauge.java similarity index 100% rename from zookeeper-server/src/main/java/org/apache/zookeeper/metrics/Gauge.java rename to zookeeper-metrics-providers/zookeeper-metrics-api/src/main/java/org/apache/zookeeper/metrics/Gauge.java diff --git a/zookeeper-server/src/main/java/org/apache/zookeeper/metrics/GaugeSet.java b/zookeeper-metrics-providers/zookeeper-metrics-api/src/main/java/org/apache/zookeeper/metrics/GaugeSet.java similarity index 100% rename from zookeeper-server/src/main/java/org/apache/zookeeper/metrics/GaugeSet.java rename to zookeeper-metrics-providers/zookeeper-metrics-api/src/main/java/org/apache/zookeeper/metrics/GaugeSet.java diff --git a/zookeeper-server/src/main/java/org/apache/zookeeper/metrics/MetricsContext.java b/zookeeper-metrics-providers/zookeeper-metrics-api/src/main/java/org/apache/zookeeper/metrics/MetricsContext.java similarity index 100% rename from zookeeper-server/src/main/java/org/apache/zookeeper/metrics/MetricsContext.java rename to zookeeper-metrics-providers/zookeeper-metrics-api/src/main/java/org/apache/zookeeper/metrics/MetricsContext.java diff --git a/zookeeper-server/src/main/java/org/apache/zookeeper/metrics/MetricsProvider.java b/zookeeper-metrics-providers/zookeeper-metrics-api/src/main/java/org/apache/zookeeper/metrics/MetricsProvider.java similarity index 97% rename from zookeeper-server/src/main/java/org/apache/zookeeper/metrics/MetricsProvider.java rename to zookeeper-metrics-providers/zookeeper-metrics-api/src/main/java/org/apache/zookeeper/metrics/MetricsProvider.java index 1cc2833ada2..ef5c46747f8 100644 --- a/zookeeper-server/src/main/java/org/apache/zookeeper/metrics/MetricsProvider.java +++ b/zookeeper-metrics-providers/zookeeper-metrics-api/src/main/java/org/apache/zookeeper/metrics/MetricsProvider.java @@ -25,7 +25,7 @@ * A MetricsProvider is a system which collects Metrics and publishes current values to external facilities. * * The system will create an instance of the configured class using the default constructor, which must be public.
- * After the instantiation of the provider, the system will call {@link #configure(java.util.Properties) } in order to provide configuration, + * After the instantiation of the provider, the system will call {@link #configure(Properties) } in order to provide configuration, * and then when the system is ready to work it will call {@link #start() }. *
* Providers can be used both on ZooKeeper servers and on ZooKeeper clients. diff --git a/zookeeper-server/src/main/java/org/apache/zookeeper/metrics/MetricsProviderLifeCycleException.java b/zookeeper-metrics-providers/zookeeper-metrics-api/src/main/java/org/apache/zookeeper/metrics/MetricsProviderLifeCycleException.java similarity index 100% rename from zookeeper-server/src/main/java/org/apache/zookeeper/metrics/MetricsProviderLifeCycleException.java rename to zookeeper-metrics-providers/zookeeper-metrics-api/src/main/java/org/apache/zookeeper/metrics/MetricsProviderLifeCycleException.java diff --git a/zookeeper-server/src/main/java/org/apache/zookeeper/metrics/Summary.java b/zookeeper-metrics-providers/zookeeper-metrics-api/src/main/java/org/apache/zookeeper/metrics/Summary.java similarity index 100% rename from zookeeper-server/src/main/java/org/apache/zookeeper/metrics/Summary.java rename to zookeeper-metrics-providers/zookeeper-metrics-api/src/main/java/org/apache/zookeeper/metrics/Summary.java diff --git a/zookeeper-server/src/main/java/org/apache/zookeeper/metrics/SummarySet.java b/zookeeper-metrics-providers/zookeeper-metrics-api/src/main/java/org/apache/zookeeper/metrics/SummarySet.java similarity index 100% rename from zookeeper-server/src/main/java/org/apache/zookeeper/metrics/SummarySet.java rename to zookeeper-metrics-providers/zookeeper-metrics-api/src/main/java/org/apache/zookeeper/metrics/SummarySet.java diff --git a/zookeeper-server/src/main/java/org/apache/zookeeper/server/RateLogger.java b/zookeeper-metrics-providers/zookeeper-metrics-api/src/main/java/org/apache/zookeeper/server/RateLogger.java similarity index 100% rename from zookeeper-server/src/main/java/org/apache/zookeeper/server/RateLogger.java rename to zookeeper-metrics-providers/zookeeper-metrics-api/src/main/java/org/apache/zookeeper/server/RateLogger.java diff --git a/zookeeper-metrics-providers/zookeeper-prometheus-metrics/pom.xml b/zookeeper-metrics-providers/zookeeper-prometheus-metrics/pom.xml index 2d8e48656b6..9531cca66d3 100755 --- a/zookeeper-metrics-providers/zookeeper-prometheus-metrics/pom.xml +++ b/zookeeper-metrics-providers/zookeeper-prometheus-metrics/pom.xml @@ -37,13 +37,9 @@ org.apache.zookeeper - - zookeeper + zookeeper-metrics-api ${project.version} - + io.prometheus simpleclient diff --git a/zookeeper-metrics-providers/zookeeper-prometheus-metrics/src/test/java/org/apache/zookeeper/metrics/prometheus/PrometheusMetricsProviderTest.java b/zookeeper-metrics-providers/zookeeper-prometheus-metrics/src/test/java/org/apache/zookeeper/metrics/prometheus/PrometheusMetricsProviderTest.java index eb9cf8bd2aa..c66d246f654 100644 --- a/zookeeper-metrics-providers/zookeeper-prometheus-metrics/src/test/java/org/apache/zookeeper/metrics/prometheus/PrometheusMetricsProviderTest.java +++ b/zookeeper-metrics-providers/zookeeper-prometheus-metrics/src/test/java/org/apache/zookeeper/metrics/prometheus/PrometheusMetricsProviderTest.java @@ -52,7 +52,6 @@ import org.apache.zookeeper.metrics.MetricsContext; import org.apache.zookeeper.metrics.Summary; import org.apache.zookeeper.metrics.SummarySet; -import org.apache.zookeeper.server.util.QuotaMetricsUtils; import org.eclipse.jetty.server.Server; import org.eclipse.jetty.server.ServerConnector; import org.hamcrest.CoreMatchers; @@ -127,7 +126,7 @@ public void testCounters() throws Exception { @Test public void testCounterSet_single() throws Exception { // create and register a CounterSet - final String name = QuotaMetricsUtils.QUOTA_EXCEEDED_ERROR_PER_NAMESPACE; + final String name = "quota_exceeded_error_per_namespace"; final CounterSet counterSet = provider.getRootContext().getCounterSet(name); final String[] keys = {"ns1", "ns2"}; final int count = 3; @@ -159,7 +158,7 @@ public void testCounterSet_single() throws Exception { @Test public void testCounterSet_multiple() throws Exception { - final String name = QuotaMetricsUtils.QUOTA_EXCEEDED_ERROR_PER_NAMESPACE; + final String name = "quota_exceeded_error_per_namespace"; final String[] names = new String[]{name + "_1", name + "_2"}; final String[] keys = new String[]{"ns21", "ns22"}; @@ -206,7 +205,7 @@ public void testCounterSet_registerWithNullName() { @Test public void testCounterSet_negativeValue() { // create and register a CounterSet - final String name = QuotaMetricsUtils.QUOTA_EXCEEDED_ERROR_PER_NAMESPACE; + final String name = "quota_exceeded_error_per_namespace"; final CounterSet counterSet = provider.getRootContext().getCounterSet(name); // add negative value and make sure no exception is thrown @@ -216,7 +215,7 @@ public void testCounterSet_negativeValue() { @Test public void testCounterSet_nullKey() { // create and register a CounterSet - final String name = QuotaMetricsUtils.QUOTA_EXCEEDED_ERROR_PER_NAMESPACE; + final String name = "quota_exceeded_error_per_namespace"; final CounterSet counterSet = provider.getRootContext().getCounterSet(name); // increment the count with null key and make sure no exception is thrown @@ -508,7 +507,7 @@ private String callServlet() throws ServletException, IOException { @Test public void testGaugeSet_singleGaugeSet() throws Exception { - final String name = QuotaMetricsUtils.QUOTA_BYTES_LIMIT_PER_NAMESPACE; + final String name = "quota_bytes_limit_per_namespace"; final Number[] values = {10.0, 100.0}; final String[] keys = {"ns11", "ns12"}; final Map metricsMap = new HashMap<>(); @@ -553,8 +552,8 @@ public void testGaugeSet_singleGaugeSet() throws Exception { @Test public void testGaugeSet_multipleGaugeSets() throws Exception { final String[] names = new String[] { - QuotaMetricsUtils.QUOTA_COUNT_LIMIT_PER_NAMESPACE, - QuotaMetricsUtils.QUOTA_COUNT_USAGE_PER_NAMESPACE + "quota_count_limit_per_namespace", + "quota_count_usage_per_namespace" }; final Number[] values = new Number[] {20.0, 200.0}; @@ -614,8 +613,8 @@ public void testGaugeSet_multipleGaugeSets() throws Exception { @Test public void testGaugeSet_overwriteRegister() { final String[] names = new String[] { - QuotaMetricsUtils.QUOTA_COUNT_LIMIT_PER_NAMESPACE, - QuotaMetricsUtils.QUOTA_COUNT_USAGE_PER_NAMESPACE + "quota_count_limit_per_namespace", + "quota_count_usage_per_namespace" }; final int count = names.length; @@ -642,7 +641,7 @@ public void testGaugeSet_overwriteRegister() { @Test public void testGaugeSet_nullKey() { - final String name = QuotaMetricsUtils.QUOTA_COUNT_LIMIT_PER_NAMESPACE; + final String name = "quota_count_limit_per_namespace"; final Map metricsMap = new HashMap<>(); metricsMap.put(null, 10.0); diff --git a/zookeeper-server/pom.xml b/zookeeper-server/pom.xml index 00a3b533949..d719f17f2c9 100755 --- a/zookeeper-server/pom.xml +++ b/zookeeper-server/pom.xml @@ -32,6 +32,11 @@ ZooKeeper server + + org.apache.zookeeper + zookeeper-metrics-api + ${project.version} + com.github.spotbugs spotbugs-annotations From 3884ca25ec74d614d02de58ea6facd58a9fd9f60 Mon Sep 17 00:00:00 2001 From: horizonzy Date: Fri, 18 Aug 2023 02:39:59 +0800 Subject: [PATCH 2/6] code clean. --- .../main/java/org/apache/zookeeper/metrics/MetricsProvider.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/zookeeper-metrics-providers/zookeeper-metrics-api/src/main/java/org/apache/zookeeper/metrics/MetricsProvider.java b/zookeeper-metrics-providers/zookeeper-metrics-api/src/main/java/org/apache/zookeeper/metrics/MetricsProvider.java index ef5c46747f8..1cc2833ada2 100644 --- a/zookeeper-metrics-providers/zookeeper-metrics-api/src/main/java/org/apache/zookeeper/metrics/MetricsProvider.java +++ b/zookeeper-metrics-providers/zookeeper-metrics-api/src/main/java/org/apache/zookeeper/metrics/MetricsProvider.java @@ -25,7 +25,7 @@ * A MetricsProvider is a system which collects Metrics and publishes current values to external facilities. * * The system will create an instance of the configured class using the default constructor, which must be public.
- * After the instantiation of the provider, the system will call {@link #configure(Properties) } in order to provide configuration, + * After the instantiation of the provider, the system will call {@link #configure(java.util.Properties) } in order to provide configuration, * and then when the system is ready to work it will call {@link #start() }. *
* Providers can be used both on ZooKeeper servers and on ZooKeeper clients. From bd2f6ec97615a9f7c8d9bf5ac1625e8d21e5021b Mon Sep 17 00:00:00 2001 From: horizonzy Date: Fri, 18 Aug 2023 02:54:58 +0800 Subject: [PATCH 3/6] Fix ci. --- .../zookeeper-metrics-api/pom.xml | 63 ++++++++++++------- 1 file changed, 40 insertions(+), 23 deletions(-) diff --git a/zookeeper-metrics-providers/zookeeper-metrics-api/pom.xml b/zookeeper-metrics-providers/zookeeper-metrics-api/pom.xml index ceea2498bde..f5fe309a6a8 100644 --- a/zookeeper-metrics-providers/zookeeper-metrics-api/pom.xml +++ b/zookeeper-metrics-providers/zookeeper-metrics-api/pom.xml @@ -1,28 +1,45 @@ - - 4.0.0 - - org.apache.zookeeper - zookeeper-metrics-providers - 3.10.0-SNAPSHOT - + + + 4.0.0 + + org.apache.zookeeper + zookeeper-metrics-providers + 3.10.0-SNAPSHOT + - zookeeper-metrics-api - jar - Apache ZooKeeper - Metrics API - ZooKeeper Metrics API + zookeeper-metrics-api + jar + Apache ZooKeeper - Metrics API + ZooKeeper Metrics API - - - ch.qos.logback - logback-core - - - ch.qos.logback - logback-classic - - + + + ch.qos.logback + logback-core + + + ch.qos.logback + logback-classic + + \ No newline at end of file From 0f4d718fdcb64c68e683fdcbaadf0f72bb2be839 Mon Sep 17 00:00:00 2001 From: horizonzy Date: Fri, 18 Aug 2023 11:25:28 +0800 Subject: [PATCH 4/6] Fix checkstyle. --- .../org/apache/zookeeper/metrics/CounterSet.java | 3 +-- .../org/apache/zookeeper/metrics/GaugeSet.java | 1 - .../apache/zookeeper/metrics/MetricsProvider.java | 5 ++--- .../org/apache/zookeeper/server/RateLogger.java | 14 +++++++------- 4 files changed, 10 insertions(+), 13 deletions(-) diff --git a/zookeeper-metrics-providers/zookeeper-metrics-api/src/main/java/org/apache/zookeeper/metrics/CounterSet.java b/zookeeper-metrics-providers/zookeeper-metrics-api/src/main/java/org/apache/zookeeper/metrics/CounterSet.java index c9c7c13c489..be512652870 100644 --- a/zookeeper-metrics-providers/zookeeper-metrics-api/src/main/java/org/apache/zookeeper/metrics/CounterSet.java +++ b/zookeeper-metrics-providers/zookeeper-metrics-api/src/main/java/org/apache/zookeeper/metrics/CounterSet.java @@ -21,8 +21,7 @@ /** * A counter refers to a value which can only increase. * Usually the value is reset when the process starts. - * - * A CounterSet is a set of {@link Counter} grouped by keys. + * A CounterSet is a set of {@link Counter} grouped by keys. */ public interface CounterSet { diff --git a/zookeeper-metrics-providers/zookeeper-metrics-api/src/main/java/org/apache/zookeeper/metrics/GaugeSet.java b/zookeeper-metrics-providers/zookeeper-metrics-api/src/main/java/org/apache/zookeeper/metrics/GaugeSet.java index 15fd93f3c39..60daa0a8aa2 100644 --- a/zookeeper-metrics-providers/zookeeper-metrics-api/src/main/java/org/apache/zookeeper/metrics/GaugeSet.java +++ b/zookeeper-metrics-providers/zookeeper-metrics-api/src/main/java/org/apache/zookeeper/metrics/GaugeSet.java @@ -22,7 +22,6 @@ /** * A Gauge is an application provided object which will be called by the metrics framework to sample a numeric value. - * * A GaugeSet is a set of {@link Gauge} grouped by keys. */ public interface GaugeSet { diff --git a/zookeeper-metrics-providers/zookeeper-metrics-api/src/main/java/org/apache/zookeeper/metrics/MetricsProvider.java b/zookeeper-metrics-providers/zookeeper-metrics-api/src/main/java/org/apache/zookeeper/metrics/MetricsProvider.java index 1cc2833ada2..eb4b20d4fb4 100644 --- a/zookeeper-metrics-providers/zookeeper-metrics-api/src/main/java/org/apache/zookeeper/metrics/MetricsProvider.java +++ b/zookeeper-metrics-providers/zookeeper-metrics-api/src/main/java/org/apache/zookeeper/metrics/MetricsProvider.java @@ -23,10 +23,9 @@ /** * A MetricsProvider is a system which collects Metrics and publishes current values to external facilities. - * * The system will create an instance of the configured class using the default constructor, which must be public.
- * After the instantiation of the provider, the system will call {@link #configure(java.util.Properties) } in order to provide configuration, - * and then when the system is ready to work it will call {@link #start() }. + * After the instantiation of the provider, the system will call {@link #configure(java.util.Properties) } in order + * to provide configuration, and then when the system is ready to work it will call {@link #start() }. *
* Providers can be used both on ZooKeeper servers and on ZooKeeper clients. */ diff --git a/zookeeper-metrics-providers/zookeeper-metrics-api/src/main/java/org/apache/zookeeper/server/RateLogger.java b/zookeeper-metrics-providers/zookeeper-metrics-api/src/main/java/org/apache/zookeeper/server/RateLogger.java index 21e41b4fbba..32463ef70fa 100644 --- a/zookeeper-metrics-providers/zookeeper-metrics-api/src/main/java/org/apache/zookeeper/server/RateLogger.java +++ b/zookeeper-metrics-providers/zookeeper-metrics-api/src/main/java/org/apache/zookeeper/server/RateLogger.java @@ -27,18 +27,18 @@ */ public class RateLogger { - private final long LOG_INTERVAL; // Duration is in ms + private final long interval; // Duration is in ms public RateLogger(Logger log) { this(log, 100); } public RateLogger(Logger log, long interval) { - LOG = log; - LOG_INTERVAL = interval; + this.log = log; + this.interval = interval; } - private final Logger LOG; + private final Logger log; private String msg = null; private long timestamp; private int count = 0; @@ -54,7 +54,7 @@ public void flush() { if (value != null) { log += " Last value:" + value; } - LOG.warn(log); + this.log.warn(log); } msg = null; value = null; @@ -73,7 +73,7 @@ public void rateLimitLog(String newMsg, String newValue) { if (Objects.equals(newMsg, msg)) { ++count; value = newValue; - if (now - timestamp >= LOG_INTERVAL) { + if (now - timestamp >= interval) { flush(); msg = newMsg; timestamp = now; @@ -84,7 +84,7 @@ public void rateLimitLog(String newMsg, String newValue) { msg = newMsg; value = newValue; timestamp = now; - LOG.warn("Message:{} Value:{}", msg, value); + log.warn("Message:{} Value:{}", msg, value); } } From a819d31fd39634bd2b1db795fac55208660614f6 Mon Sep 17 00:00:00 2001 From: horizonzy Date: Fri, 18 Aug 2023 11:28:25 +0800 Subject: [PATCH 5/6] Fix checkstyle. --- .../java/org/apache/zookeeper/metrics/MetricsContext.java | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/zookeeper-metrics-providers/zookeeper-metrics-api/src/main/java/org/apache/zookeeper/metrics/MetricsContext.java b/zookeeper-metrics-providers/zookeeper-metrics-api/src/main/java/org/apache/zookeeper/metrics/MetricsContext.java index 18ff1180cf7..f70f0af9d69 100644 --- a/zookeeper-metrics-providers/zookeeper-metrics-api/src/main/java/org/apache/zookeeper/metrics/MetricsContext.java +++ b/zookeeper-metrics-providers/zookeeper-metrics-api/src/main/java/org/apache/zookeeper/metrics/MetricsContext.java @@ -52,7 +52,7 @@ public interface MetricsContext { /** * Returns the CounterSet identified by the given name - * Null name is not allowed + * Null name is not allowed. * * @param name * @return CounterSet identified by the name in this context. @@ -94,7 +94,6 @@ public interface MetricsContext { /** * Unregisters the user provided {@link GaugeSet} bound to the given name. - * * Unregistering with a null name is not allowed. * @param name unique name of the GaugeSet in this context * @@ -104,7 +103,7 @@ public interface MetricsContext { enum DetailLevel { /** * The returned Summary is expected to track only simple aggregated - * values, like min/max/avg + * values, like min/max/avg. */ BASIC, /** From 873a35f5a81045c0afa51be8e0a23cb9064493d2 Mon Sep 17 00:00:00 2001 From: horizonzy Date: Fri, 18 Aug 2023 22:50:35 +0800 Subject: [PATCH 6/6] Address the comments. --- zookeeper-metrics-providers/zookeeper-metrics-api/pom.xml | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/zookeeper-metrics-providers/zookeeper-metrics-api/pom.xml b/zookeeper-metrics-providers/zookeeper-metrics-api/pom.xml index f5fe309a6a8..b47fcede502 100644 --- a/zookeeper-metrics-providers/zookeeper-metrics-api/pom.xml +++ b/zookeeper-metrics-providers/zookeeper-metrics-api/pom.xml @@ -33,12 +33,8 @@ - ch.qos.logback - logback-core - - - ch.qos.logback - logback-classic + org.slf4j + slf4j-api