From 08489a14059c3018b719225522da5c42122759bd Mon Sep 17 00:00:00 2001 From: crazyhzm Date: Mon, 4 Dec 2023 14:32:19 +0800 Subject: [PATCH] Remove dubbo monitor module Signed-off-by: crazyhzm --- .artifacts | 4 - dubbo-config/dubbo-config-api/pom.xml | 5 - dubbo-config/dubbo-config-spring/pom.xml | 12 - dubbo-dependencies-bom/pom.xml | 23 - dubbo-distribution/dubbo-all-shaded/pom.xml | 18 - dubbo-distribution/dubbo-all/pom.xml | 26 -- dubbo-distribution/dubbo-bom/pom.xml | 23 - dubbo-distribution/dubbo-core-spi/pom.xml | 8 - .../dubbo-metadata-processor/pom.xml | 4 - .../org/apache/dubbo/monitor/Constants.java | 1 + .../org/apache/dubbo/monitor/Monitor.java | 1 + .../apache/dubbo/monitor/MonitorFactory.java | 3 +- .../apache/dubbo/monitor/MonitorService.java | 1 + .../monitor/support/MonitorClusterFilter.java | 1 + .../dubbo/monitor/support/MonitorFilter.java | 1 + .../internal/org.apache.dubbo.rpc.Filter | 1 + ...che.dubbo.rpc.cluster.filter.ClusterFilter | 1 + .../monitor/support/MonitorFilterTest.java | 0 dubbo-monitor/dubbo-monitor-api/pom.xml | 40 -- .../apache/dubbo/monitor/MetricsService.java | 26 -- dubbo-monitor/dubbo-monitor-common/pom.xml | 50 --- .../support/AbstractMonitorFactory.java | 120 ----- .../support/MetricsServiceDetector.java | 33 -- .../support/MonitorServiceDetector.java | 28 -- .../internal/org.apache.dubbo.rpc.Filter | 1 - ...che.dubbo.rpc.cluster.filter.ClusterFilter | 1 - ...che.dubbo.rpc.model.BuiltinServiceDetector | 2 - .../support/AbstractMonitorFactoryTest.java | 99 ---- .../src/test/resources/log4j2-test.xml | 29 -- dubbo-monitor/dubbo-monitor-default/pom.xml | 86 ---- .../dubbo/monitor/dubbo/DubboMonitor.java | 238 ---------- .../monitor/dubbo/DubboMonitorFactory.java | 69 --- .../dubbo/monitor/dubbo/MetricsFilter.java | 296 ------------ .../dubbo/monitor/dubbo/Statistics.java | 216 --------- .../dubbo/monitor/dubbo/StatisticsItem.java | 140 ------ .../org.apache.dubbo.monitor.MonitorFactory | 1 - .../internal/org.apache.dubbo.rpc.Filter | 1 - .../monitor/dubbo/AppResponseBuilder.java | 55 --- .../dubbo/DubboMonitorFactoryTest.java | 70 --- .../dubbo/monitor/dubbo/DubboMonitorTest.java | 275 ------------ .../monitor/dubbo/MetricsFilterTest.java | 421 ------------------ .../monitor/dubbo/MockMonitorService.java | 43 -- .../dubbo/monitor/dubbo/StatisticsTest.java | 109 ----- .../monitor/dubbo/service/DemoService.java | 28 -- .../src/test/resources/dubbo.properties | 2 - .../src/test/resources/log4j2-test.xml | 29 -- dubbo-monitor/pom.xml | 48 -- dubbo-test/dubbo-dependencies-all/pom.xml | 16 - pom.xml | 1 - 49 files changed, 8 insertions(+), 2698 deletions(-) rename {dubbo-monitor/dubbo-monitor-api => dubbo-metrics/dubbo-metrics-api}/src/main/java/org/apache/dubbo/monitor/Constants.java (99%) rename {dubbo-monitor/dubbo-monitor-api => dubbo-metrics/dubbo-metrics-api}/src/main/java/org/apache/dubbo/monitor/Monitor.java (98%) rename {dubbo-monitor/dubbo-monitor-api => dubbo-metrics/dubbo-metrics-api}/src/main/java/org/apache/dubbo/monitor/MonitorFactory.java (95%) rename {dubbo-monitor/dubbo-monitor-api => dubbo-metrics/dubbo-metrics-api}/src/main/java/org/apache/dubbo/monitor/MonitorService.java (99%) rename {dubbo-monitor/dubbo-monitor-common => dubbo-metrics/dubbo-metrics-default}/src/main/java/org/apache/dubbo/monitor/support/MonitorClusterFilter.java (98%) rename {dubbo-monitor/dubbo-monitor-common => dubbo-metrics/dubbo-metrics-default}/src/main/java/org/apache/dubbo/monitor/support/MonitorFilter.java (99%) rename {dubbo-monitor/dubbo-monitor-common => dubbo-metrics/dubbo-metrics-default}/src/test/java/org/apache/dubbo/monitor/support/MonitorFilterTest.java (100%) delete mode 100644 dubbo-monitor/dubbo-monitor-api/pom.xml delete mode 100644 dubbo-monitor/dubbo-monitor-api/src/main/java/org/apache/dubbo/monitor/MetricsService.java delete mode 100644 dubbo-monitor/dubbo-monitor-common/pom.xml delete mode 100644 dubbo-monitor/dubbo-monitor-common/src/main/java/org/apache/dubbo/monitor/support/AbstractMonitorFactory.java delete mode 100644 dubbo-monitor/dubbo-monitor-common/src/main/java/org/apache/dubbo/monitor/support/MetricsServiceDetector.java delete mode 100644 dubbo-monitor/dubbo-monitor-common/src/main/java/org/apache/dubbo/monitor/support/MonitorServiceDetector.java delete mode 100644 dubbo-monitor/dubbo-monitor-common/src/main/resources/META-INF/dubbo/internal/org.apache.dubbo.rpc.Filter delete mode 100644 dubbo-monitor/dubbo-monitor-common/src/main/resources/META-INF/dubbo/internal/org.apache.dubbo.rpc.cluster.filter.ClusterFilter delete mode 100644 dubbo-monitor/dubbo-monitor-common/src/main/resources/META-INF/dubbo/internal/org.apache.dubbo.rpc.model.BuiltinServiceDetector delete mode 100644 dubbo-monitor/dubbo-monitor-common/src/test/java/org/apache/dubbo/monitor/support/AbstractMonitorFactoryTest.java delete mode 100644 dubbo-monitor/dubbo-monitor-common/src/test/resources/log4j2-test.xml delete mode 100644 dubbo-monitor/dubbo-monitor-default/pom.xml delete mode 100644 dubbo-monitor/dubbo-monitor-default/src/main/java/org/apache/dubbo/monitor/dubbo/DubboMonitor.java delete mode 100644 dubbo-monitor/dubbo-monitor-default/src/main/java/org/apache/dubbo/monitor/dubbo/DubboMonitorFactory.java delete mode 100644 dubbo-monitor/dubbo-monitor-default/src/main/java/org/apache/dubbo/monitor/dubbo/MetricsFilter.java delete mode 100644 dubbo-monitor/dubbo-monitor-default/src/main/java/org/apache/dubbo/monitor/dubbo/Statistics.java delete mode 100644 dubbo-monitor/dubbo-monitor-default/src/main/java/org/apache/dubbo/monitor/dubbo/StatisticsItem.java delete mode 100644 dubbo-monitor/dubbo-monitor-default/src/main/resources/META-INF/dubbo/internal/org.apache.dubbo.monitor.MonitorFactory delete mode 100644 dubbo-monitor/dubbo-monitor-default/src/main/resources/META-INF/dubbo/internal/org.apache.dubbo.rpc.Filter delete mode 100644 dubbo-monitor/dubbo-monitor-default/src/test/java/org/apache/dubbo/monitor/dubbo/AppResponseBuilder.java delete mode 100644 dubbo-monitor/dubbo-monitor-default/src/test/java/org/apache/dubbo/monitor/dubbo/DubboMonitorFactoryTest.java delete mode 100644 dubbo-monitor/dubbo-monitor-default/src/test/java/org/apache/dubbo/monitor/dubbo/DubboMonitorTest.java delete mode 100644 dubbo-monitor/dubbo-monitor-default/src/test/java/org/apache/dubbo/monitor/dubbo/MetricsFilterTest.java delete mode 100644 dubbo-monitor/dubbo-monitor-default/src/test/java/org/apache/dubbo/monitor/dubbo/MockMonitorService.java delete mode 100644 dubbo-monitor/dubbo-monitor-default/src/test/java/org/apache/dubbo/monitor/dubbo/StatisticsTest.java delete mode 100644 dubbo-monitor/dubbo-monitor-default/src/test/java/org/apache/dubbo/monitor/dubbo/service/DemoService.java delete mode 100644 dubbo-monitor/dubbo-monitor-default/src/test/resources/dubbo.properties delete mode 100644 dubbo-monitor/dubbo-monitor-default/src/test/resources/log4j2-test.xml delete mode 100644 dubbo-monitor/pom.xml diff --git a/.artifacts b/.artifacts index d0e292d3a83c..ace6eec3e675 100644 --- a/.artifacts +++ b/.artifacts @@ -62,10 +62,6 @@ dubbo-metrics-registry dubbo-metrics-config-center dubbo-metrics-netty dubbo-metrics-event -dubbo-monitor -dubbo-monitor-api -dubbo-monitor-common -dubbo-monitor-default dubbo-native dubbo-parent dubbo-plugin diff --git a/dubbo-config/dubbo-config-api/pom.xml b/dubbo-config/dubbo-config-api/pom.xml index e57e02cbed45..5f8c343abd6e 100644 --- a/dubbo-config/dubbo-config-api/pom.xml +++ b/dubbo-config/dubbo-config-api/pom.xml @@ -78,11 +78,6 @@ ${project.parent.version} - - org.apache.dubbo - dubbo-monitor-api - ${project.parent.version} - org.apache.dubbo dubbo-remoting-api diff --git a/dubbo-config/dubbo-config-spring/pom.xml b/dubbo-config/dubbo-config-spring/pom.xml index 1f201c0b3781..983d0b054729 100644 --- a/dubbo-config/dubbo-config-spring/pom.xml +++ b/dubbo-config/dubbo-config-spring/pom.xml @@ -77,12 +77,6 @@ 1.9.20.1 test - - org.apache.dubbo - dubbo-monitor-default - ${project.parent.version} - test - org.apache.dubbo dubbo-rpc-dubbo @@ -149,12 +143,6 @@ ${project.parent.version} test - - org.apache.dubbo - dubbo-monitor-common - ${project.parent.version} - test - org.apache.dubbo dubbo-plugin-qos-trace diff --git a/dubbo-dependencies-bom/pom.xml b/dubbo-dependencies-bom/pom.xml index ab6073a88b5c..a579eaab4e00 100644 --- a/dubbo-dependencies-bom/pom.xml +++ b/dubbo-dependencies-bom/pom.xml @@ -193,7 +193,6 @@ 1.1.10.5 1.70 - 2.0.6 5.4.3 2.10.1 2.16.0 @@ -773,28 +772,6 @@ ${swagger_version} - - com.alibaba.middleware - metrics-core-api - ${metrics_version} - - - com.alibaba.middleware - metrics-core-impl - ${metrics_version} - - - com.alibaba.middleware - metrics-common - ${metrics_version} - - - - com.alibaba.middleware - metrics-rest - ${metrics_version} - - com.alipay.sofa diff --git a/dubbo-distribution/dubbo-all-shaded/pom.xml b/dubbo-distribution/dubbo-all-shaded/pom.xml index 54105d5e4f7a..9221a5c13809 100644 --- a/dubbo-distribution/dubbo-all-shaded/pom.xml +++ b/dubbo-distribution/dubbo-all-shaded/pom.xml @@ -203,22 +203,6 @@ true - - - org.apache.dubbo - dubbo-monitor-api - ${project.version} - compile - true - - - org.apache.dubbo - dubbo-monitor-default - ${project.version} - compile - true - - org.apache.dubbo @@ -493,8 +477,6 @@ org.apache.dubbo:dubbo-metrics-metadata org.apache.dubbo:dubbo-metrics-config-center org.apache.dubbo:dubbo-metrics-prometheus - org.apache.dubbo:dubbo-monitor-api - org.apache.dubbo:dubbo-monitor-default org.apache.dubbo:dubbo-qos org.apache.dubbo:dubbo-qos-api org.apache.dubbo:dubbo-security diff --git a/dubbo-distribution/dubbo-all/pom.xml b/dubbo-distribution/dubbo-all/pom.xml index eaf6db3737d0..6c387ae9d3b1 100644 --- a/dubbo-distribution/dubbo-all/pom.xml +++ b/dubbo-distribution/dubbo-all/pom.xml @@ -240,29 +240,6 @@ true - - - org.apache.dubbo - dubbo-monitor-api - ${project.version} - compile - true - - - org.apache.dubbo - dubbo-monitor-common - ${project.version} - compile - true - - - org.apache.dubbo - dubbo-monitor-default - ${project.version} - compile - true - - org.apache.dubbo @@ -673,9 +650,6 @@ org.apache.dubbo:dubbo-metrics-netty org.apache.dubbo:dubbo-metrics-prometheus org.apache.dubbo:dubbo-tracing - org.apache.dubbo:dubbo-monitor-api - org.apache.dubbo:dubbo-monitor-common - org.apache.dubbo:dubbo-monitor-default org.apache.dubbo:dubbo-qos org.apache.dubbo:dubbo-qos-api org.apache.dubbo:dubbo-security diff --git a/dubbo-distribution/dubbo-bom/pom.xml b/dubbo-distribution/dubbo-bom/pom.xml index 32e40b9a9ea3..d39ca6a1fafe 100644 --- a/dubbo-distribution/dubbo-bom/pom.xml +++ b/dubbo-distribution/dubbo-bom/pom.xml @@ -285,29 +285,6 @@ ${project.version} - - - org.apache.dubbo - dubbo-monitor - ${project.version} - pom - - - org.apache.dubbo - dubbo-monitor-api - ${project.version} - - - org.apache.dubbo - dubbo-monitor-common - ${project.version} - - - org.apache.dubbo - dubbo-monitor-default - ${project.version} - - org.apache.dubbo diff --git a/dubbo-distribution/dubbo-core-spi/pom.xml b/dubbo-distribution/dubbo-core-spi/pom.xml index f65aa0b2586d..70c124dfa1aa 100644 --- a/dubbo-distribution/dubbo-core-spi/pom.xml +++ b/dubbo-distribution/dubbo-core-spi/pom.xml @@ -67,13 +67,6 @@ compile true - - org.apache.dubbo - dubbo-monitor-api - ${project.version} - compile - true - org.apache.dubbo dubbo-registry-api @@ -135,7 +128,6 @@ org.apache.dubbo:dubbo-metrics-api org.apache.dubbo:dubbo-metrics-default org.apache.dubbo:dubbo-tracing - org.apache.dubbo:dubbo-monitor-api org.apache.dubbo:dubbo-registry-api org.apache.dubbo:dubbo-remoting-api org.apache.dubbo:dubbo-remoting diff --git a/dubbo-metadata/dubbo-metadata-processor/pom.xml b/dubbo-metadata/dubbo-metadata-processor/pom.xml index 7e1a50d684cb..33e6d6ea69e4 100644 --- a/dubbo-metadata/dubbo-metadata-processor/pom.xml +++ b/dubbo-metadata/dubbo-metadata-processor/pom.xml @@ -81,10 +81,6 @@ org.apache.dubbo dubbo-metadata-api - - org.apache.dubbo - dubbo-monitor-api - org.apache.dubbo dubbo-remoting-api diff --git a/dubbo-monitor/dubbo-monitor-api/src/main/java/org/apache/dubbo/monitor/Constants.java b/dubbo-metrics/dubbo-metrics-api/src/main/java/org/apache/dubbo/monitor/Constants.java similarity index 99% rename from dubbo-monitor/dubbo-monitor-api/src/main/java/org/apache/dubbo/monitor/Constants.java rename to dubbo-metrics/dubbo-metrics-api/src/main/java/org/apache/dubbo/monitor/Constants.java index 38b371bd6c7e..46d86bd67187 100644 --- a/dubbo-monitor/dubbo-monitor-api/src/main/java/org/apache/dubbo/monitor/Constants.java +++ b/dubbo-metrics/dubbo-metrics-api/src/main/java/org/apache/dubbo/monitor/Constants.java @@ -16,6 +16,7 @@ */ package org.apache.dubbo.monitor; +@Deprecated public interface Constants { String DUBBO_PROVIDER = "dubbo.provider"; diff --git a/dubbo-monitor/dubbo-monitor-api/src/main/java/org/apache/dubbo/monitor/Monitor.java b/dubbo-metrics/dubbo-metrics-api/src/main/java/org/apache/dubbo/monitor/Monitor.java similarity index 98% rename from dubbo-monitor/dubbo-monitor-api/src/main/java/org/apache/dubbo/monitor/Monitor.java rename to dubbo-metrics/dubbo-metrics-api/src/main/java/org/apache/dubbo/monitor/Monitor.java index 85abadd878f8..127d8b5b7cf3 100644 --- a/dubbo-monitor/dubbo-monitor-api/src/main/java/org/apache/dubbo/monitor/Monitor.java +++ b/dubbo-metrics/dubbo-metrics-api/src/main/java/org/apache/dubbo/monitor/Monitor.java @@ -23,4 +23,5 @@ * * @see org.apache.dubbo.monitor.MonitorFactory#getMonitor(org.apache.dubbo.common.URL) */ +@Deprecated public interface Monitor extends Node, MonitorService {} diff --git a/dubbo-monitor/dubbo-monitor-api/src/main/java/org/apache/dubbo/monitor/MonitorFactory.java b/dubbo-metrics/dubbo-metrics-api/src/main/java/org/apache/dubbo/monitor/MonitorFactory.java similarity index 95% rename from dubbo-monitor/dubbo-monitor-api/src/main/java/org/apache/dubbo/monitor/MonitorFactory.java rename to dubbo-metrics/dubbo-metrics-api/src/main/java/org/apache/dubbo/monitor/MonitorFactory.java index 45403bc3bc10..e8e33edc90c0 100644 --- a/dubbo-monitor/dubbo-monitor-api/src/main/java/org/apache/dubbo/monitor/MonitorFactory.java +++ b/dubbo-metrics/dubbo-metrics-api/src/main/java/org/apache/dubbo/monitor/MonitorFactory.java @@ -19,12 +19,11 @@ import org.apache.dubbo.common.URL; import org.apache.dubbo.common.constants.CommonConstants; import org.apache.dubbo.common.extension.Adaptive; -import org.apache.dubbo.common.extension.SPI; /** * MonitorFactory. (SPI, Singleton, ThreadSafe) */ -@SPI("dubbo") +@Deprecated public interface MonitorFactory { /** diff --git a/dubbo-monitor/dubbo-monitor-api/src/main/java/org/apache/dubbo/monitor/MonitorService.java b/dubbo-metrics/dubbo-metrics-api/src/main/java/org/apache/dubbo/monitor/MonitorService.java similarity index 99% rename from dubbo-monitor/dubbo-monitor-api/src/main/java/org/apache/dubbo/monitor/MonitorService.java rename to dubbo-metrics/dubbo-metrics-api/src/main/java/org/apache/dubbo/monitor/MonitorService.java index bc14cb9ebc3a..cd61bbd03145 100644 --- a/dubbo-monitor/dubbo-monitor-api/src/main/java/org/apache/dubbo/monitor/MonitorService.java +++ b/dubbo-metrics/dubbo-metrics-api/src/main/java/org/apache/dubbo/monitor/MonitorService.java @@ -23,6 +23,7 @@ /** * MonitorService. (SPI, Prototype, ThreadSafe) */ +@Deprecated public interface MonitorService { /** diff --git a/dubbo-monitor/dubbo-monitor-common/src/main/java/org/apache/dubbo/monitor/support/MonitorClusterFilter.java b/dubbo-metrics/dubbo-metrics-default/src/main/java/org/apache/dubbo/monitor/support/MonitorClusterFilter.java similarity index 98% rename from dubbo-monitor/dubbo-monitor-common/src/main/java/org/apache/dubbo/monitor/support/MonitorClusterFilter.java rename to dubbo-metrics/dubbo-metrics-default/src/main/java/org/apache/dubbo/monitor/support/MonitorClusterFilter.java index e6e9e3c061d5..682ae2334d22 100644 --- a/dubbo-monitor/dubbo-monitor-common/src/main/java/org/apache/dubbo/monitor/support/MonitorClusterFilter.java +++ b/dubbo-metrics/dubbo-metrics-default/src/main/java/org/apache/dubbo/monitor/support/MonitorClusterFilter.java @@ -21,5 +21,6 @@ import static org.apache.dubbo.common.constants.CommonConstants.CONSUMER; +@Deprecated @Activate(group = {CONSUMER}) public class MonitorClusterFilter extends MonitorFilter implements ClusterFilter {} diff --git a/dubbo-monitor/dubbo-monitor-common/src/main/java/org/apache/dubbo/monitor/support/MonitorFilter.java b/dubbo-metrics/dubbo-metrics-default/src/main/java/org/apache/dubbo/monitor/support/MonitorFilter.java similarity index 99% rename from dubbo-monitor/dubbo-monitor-common/src/main/java/org/apache/dubbo/monitor/support/MonitorFilter.java rename to dubbo-metrics/dubbo-metrics-default/src/main/java/org/apache/dubbo/monitor/support/MonitorFilter.java index 08d4d2738cea..d3476b48c212 100644 --- a/dubbo-monitor/dubbo-monitor-common/src/main/java/org/apache/dubbo/monitor/support/MonitorFilter.java +++ b/dubbo-metrics/dubbo-metrics-default/src/main/java/org/apache/dubbo/monitor/support/MonitorFilter.java @@ -61,6 +61,7 @@ /** * MonitorFilter. (SPI, Singleton, ThreadSafe) */ +@Deprecated @Activate(group = {PROVIDER}) public class MonitorFilter implements Filter, Filter.Listener { diff --git a/dubbo-metrics/dubbo-metrics-default/src/main/resources/META-INF/dubbo/internal/org.apache.dubbo.rpc.Filter b/dubbo-metrics/dubbo-metrics-default/src/main/resources/META-INF/dubbo/internal/org.apache.dubbo.rpc.Filter index 08e822be301b..ecb9e24f2780 100644 --- a/dubbo-metrics/dubbo-metrics-default/src/main/resources/META-INF/dubbo/internal/org.apache.dubbo.rpc.Filter +++ b/dubbo-metrics/dubbo-metrics-default/src/main/resources/META-INF/dubbo/internal/org.apache.dubbo.rpc.Filter @@ -1 +1,2 @@ metrics-provider=org.apache.dubbo.metrics.filter.MetricsProviderFilter +monitor=org.apache.dubbo.monitor.support.MonitorFilter diff --git a/dubbo-metrics/dubbo-metrics-default/src/main/resources/META-INF/dubbo/internal/org.apache.dubbo.rpc.cluster.filter.ClusterFilter b/dubbo-metrics/dubbo-metrics-default/src/main/resources/META-INF/dubbo/internal/org.apache.dubbo.rpc.cluster.filter.ClusterFilter index dec6c0a5f81b..b9b03c571e98 100644 --- a/dubbo-metrics/dubbo-metrics-default/src/main/resources/META-INF/dubbo/internal/org.apache.dubbo.rpc.cluster.filter.ClusterFilter +++ b/dubbo-metrics/dubbo-metrics-default/src/main/resources/META-INF/dubbo/internal/org.apache.dubbo.rpc.cluster.filter.ClusterFilter @@ -1,2 +1,3 @@ observationsender=org.apache.dubbo.rpc.cluster.filter.support.ObservationSenderFilter metricsClusterFilter=org.apache.dubbo.rpc.cluster.filter.support.MetricsClusterFilter +monitor=org.apache.dubbo.monitor.support.MonitorClusterFilter diff --git a/dubbo-monitor/dubbo-monitor-common/src/test/java/org/apache/dubbo/monitor/support/MonitorFilterTest.java b/dubbo-metrics/dubbo-metrics-default/src/test/java/org/apache/dubbo/monitor/support/MonitorFilterTest.java similarity index 100% rename from dubbo-monitor/dubbo-monitor-common/src/test/java/org/apache/dubbo/monitor/support/MonitorFilterTest.java rename to dubbo-metrics/dubbo-metrics-default/src/test/java/org/apache/dubbo/monitor/support/MonitorFilterTest.java diff --git a/dubbo-monitor/dubbo-monitor-api/pom.xml b/dubbo-monitor/dubbo-monitor-api/pom.xml deleted file mode 100644 index 60a8ac3c3f87..000000000000 --- a/dubbo-monitor/dubbo-monitor-api/pom.xml +++ /dev/null @@ -1,40 +0,0 @@ - - - - 4.0.0 - - org.apache.dubbo - dubbo-monitor - ${revision} - ../pom.xml - - dubbo-monitor-api - jar - ${project.artifactId} - The monitor module of dubbo project - - false - - - - org.apache.dubbo - dubbo-common - ${project.parent.version} - - - diff --git a/dubbo-monitor/dubbo-monitor-api/src/main/java/org/apache/dubbo/monitor/MetricsService.java b/dubbo-monitor/dubbo-monitor-api/src/main/java/org/apache/dubbo/monitor/MetricsService.java deleted file mode 100644 index 94c7f9dc3fbe..000000000000 --- a/dubbo-monitor/dubbo-monitor-api/src/main/java/org/apache/dubbo/monitor/MetricsService.java +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.apache.dubbo.monitor; - -/** - * @deprecated After metrics config is refactored. - * This class should no longer use and will be deleted in the future. - */ -@Deprecated -public interface MetricsService { - String getMetricsByGroup(String group); -} diff --git a/dubbo-monitor/dubbo-monitor-common/pom.xml b/dubbo-monitor/dubbo-monitor-common/pom.xml deleted file mode 100644 index 9d04a09065d3..000000000000 --- a/dubbo-monitor/dubbo-monitor-common/pom.xml +++ /dev/null @@ -1,50 +0,0 @@ - - - - 4.0.0 - - org.apache.dubbo - dubbo-monitor - ${revision} - ../pom.xml - - dubbo-monitor-common - jar - ${project.artifactId} - The monitor common module of dubbo project - - false - - - - org.apache.dubbo - dubbo-monitor-api - ${project.parent.version} - - - org.apache.dubbo - dubbo-cluster - ${project.parent.version} - - - org.apache.logging.log4j - log4j-slf4j-impl - test - - - diff --git a/dubbo-monitor/dubbo-monitor-common/src/main/java/org/apache/dubbo/monitor/support/AbstractMonitorFactory.java b/dubbo-monitor/dubbo-monitor-common/src/main/java/org/apache/dubbo/monitor/support/AbstractMonitorFactory.java deleted file mode 100644 index 0e774cc01824..000000000000 --- a/dubbo-monitor/dubbo-monitor-common/src/main/java/org/apache/dubbo/monitor/support/AbstractMonitorFactory.java +++ /dev/null @@ -1,120 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.apache.dubbo.monitor.support; - -import org.apache.dubbo.common.URL; -import org.apache.dubbo.common.logger.ErrorTypeAwareLogger; -import org.apache.dubbo.common.logger.LoggerFactory; -import org.apache.dubbo.common.utils.NamedThreadFactory; -import org.apache.dubbo.monitor.Monitor; -import org.apache.dubbo.monitor.MonitorFactory; -import org.apache.dubbo.monitor.MonitorService; - -import java.util.Collection; -import java.util.Collections; -import java.util.Map; -import java.util.concurrent.ConcurrentHashMap; -import java.util.concurrent.ExecutorService; -import java.util.concurrent.Future; -import java.util.concurrent.SynchronousQueue; -import java.util.concurrent.ThreadPoolExecutor; -import java.util.concurrent.TimeUnit; -import java.util.concurrent.locks.ReentrantLock; - -import static org.apache.dubbo.common.constants.CommonConstants.INTERFACE_KEY; -import static org.apache.dubbo.common.constants.LoggerCodeConstants.COMMON_MONITOR_EXCEPTION; - -/** - * AbstractMonitorFactory. (SPI, Singleton, ThreadSafe) - */ -public abstract class AbstractMonitorFactory implements MonitorFactory { - private static final ErrorTypeAwareLogger logger = - LoggerFactory.getErrorTypeAwareLogger(AbstractMonitorFactory.class); - - /** - * The lock for getting monitor center - */ - private static final ReentrantLock LOCK = new ReentrantLock(); - - /** - * The monitor centers Map - */ - private static final Map MONITORS = new ConcurrentHashMap(); - - private static final Map> FUTURES = new ConcurrentHashMap>(); - - /** - * The monitor create executor - */ - private static final ExecutorService EXECUTOR = new ThreadPoolExecutor( - 0, - 10, - 60L, - TimeUnit.SECONDS, - new SynchronousQueue(), - new NamedThreadFactory("DubboMonitorCreator", true)); - - public static Collection getMonitors() { - return Collections.unmodifiableCollection(MONITORS.values()); - } - - @Override - public Monitor getMonitor(URL url) { - url = url.setPath(MonitorService.class.getName()).addParameter(INTERFACE_KEY, MonitorService.class.getName()); - String key = url.toServiceStringWithoutResolving(); - Monitor monitor = MONITORS.get(key); - Future future = FUTURES.get(key); - if (monitor != null || future != null) { - return monitor; - } - - LOCK.lock(); - try { - monitor = MONITORS.get(key); - future = FUTURES.get(key); - if (monitor != null || future != null) { - return monitor; - } - - final URL monitorUrl = url; - future = EXECUTOR.submit(() -> { - try { - Monitor m = createMonitor(monitorUrl); - MONITORS.put(key, m); - FUTURES.remove(key); - return m; - } catch (Throwable e) { - logger.warn( - COMMON_MONITOR_EXCEPTION, - "", - "", - "Create monitor failed, monitor data will not be collected until you fix this problem. monitorUrl: " - + monitorUrl, - e); - return null; - } - }); - FUTURES.put(key, future); - return null; - } finally { - // unlock - LOCK.unlock(); - } - } - - protected abstract Monitor createMonitor(URL url); -} diff --git a/dubbo-monitor/dubbo-monitor-common/src/main/java/org/apache/dubbo/monitor/support/MetricsServiceDetector.java b/dubbo-monitor/dubbo-monitor-common/src/main/java/org/apache/dubbo/monitor/support/MetricsServiceDetector.java deleted file mode 100644 index a357b8b344a1..000000000000 --- a/dubbo-monitor/dubbo-monitor-common/src/main/java/org/apache/dubbo/monitor/support/MetricsServiceDetector.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.apache.dubbo.monitor.support; - -import org.apache.dubbo.monitor.MetricsService; -import org.apache.dubbo.rpc.model.BuiltinServiceDetector; - -/** - * @deprecated After metrics config is refactored. - * This class should no longer use and will be deleted in the future. - */ -@Deprecated -public class MetricsServiceDetector implements BuiltinServiceDetector { - - @Override - public Class getService() { - return MetricsService.class; - } -} diff --git a/dubbo-monitor/dubbo-monitor-common/src/main/java/org/apache/dubbo/monitor/support/MonitorServiceDetector.java b/dubbo-monitor/dubbo-monitor-common/src/main/java/org/apache/dubbo/monitor/support/MonitorServiceDetector.java deleted file mode 100644 index 0b8cd37f6324..000000000000 --- a/dubbo-monitor/dubbo-monitor-common/src/main/java/org/apache/dubbo/monitor/support/MonitorServiceDetector.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.apache.dubbo.monitor.support; - -import org.apache.dubbo.monitor.MonitorService; -import org.apache.dubbo.rpc.model.BuiltinServiceDetector; - -public class MonitorServiceDetector implements BuiltinServiceDetector { - - @Override - public Class getService() { - return MonitorService.class; - } -} diff --git a/dubbo-monitor/dubbo-monitor-common/src/main/resources/META-INF/dubbo/internal/org.apache.dubbo.rpc.Filter b/dubbo-monitor/dubbo-monitor-common/src/main/resources/META-INF/dubbo/internal/org.apache.dubbo.rpc.Filter deleted file mode 100644 index fbeff59d1df5..000000000000 --- a/dubbo-monitor/dubbo-monitor-common/src/main/resources/META-INF/dubbo/internal/org.apache.dubbo.rpc.Filter +++ /dev/null @@ -1 +0,0 @@ -monitor=org.apache.dubbo.monitor.support.MonitorFilter diff --git a/dubbo-monitor/dubbo-monitor-common/src/main/resources/META-INF/dubbo/internal/org.apache.dubbo.rpc.cluster.filter.ClusterFilter b/dubbo-monitor/dubbo-monitor-common/src/main/resources/META-INF/dubbo/internal/org.apache.dubbo.rpc.cluster.filter.ClusterFilter deleted file mode 100644 index c5bf757353ec..000000000000 --- a/dubbo-monitor/dubbo-monitor-common/src/main/resources/META-INF/dubbo/internal/org.apache.dubbo.rpc.cluster.filter.ClusterFilter +++ /dev/null @@ -1 +0,0 @@ -monitor=org.apache.dubbo.monitor.support.MonitorClusterFilter \ No newline at end of file diff --git a/dubbo-monitor/dubbo-monitor-common/src/main/resources/META-INF/dubbo/internal/org.apache.dubbo.rpc.model.BuiltinServiceDetector b/dubbo-monitor/dubbo-monitor-common/src/main/resources/META-INF/dubbo/internal/org.apache.dubbo.rpc.model.BuiltinServiceDetector deleted file mode 100644 index ed8a80c9b6a6..000000000000 --- a/dubbo-monitor/dubbo-monitor-common/src/main/resources/META-INF/dubbo/internal/org.apache.dubbo.rpc.model.BuiltinServiceDetector +++ /dev/null @@ -1,2 +0,0 @@ -monitor=org.apache.dubbo.monitor.support.MonitorServiceDetector -metrics=org.apache.dubbo.monitor.support.MetricsServiceDetector \ No newline at end of file diff --git a/dubbo-monitor/dubbo-monitor-common/src/test/java/org/apache/dubbo/monitor/support/AbstractMonitorFactoryTest.java b/dubbo-monitor/dubbo-monitor-common/src/test/java/org/apache/dubbo/monitor/support/AbstractMonitorFactoryTest.java deleted file mode 100644 index 7b32aef72552..000000000000 --- a/dubbo-monitor/dubbo-monitor-common/src/test/java/org/apache/dubbo/monitor/support/AbstractMonitorFactoryTest.java +++ /dev/null @@ -1,99 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.apache.dubbo.monitor.support; - -import org.apache.dubbo.common.URL; -import org.apache.dubbo.common.utils.NetUtils; -import org.apache.dubbo.monitor.Monitor; -import org.apache.dubbo.monitor.MonitorFactory; - -import java.util.List; - -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -/** - * AbstractMonitorFactoryTest - */ -class AbstractMonitorFactoryTest { - - private MonitorFactory monitorFactory = new AbstractMonitorFactory() { - - protected Monitor createMonitor(final URL url) { - return new Monitor() { - - public URL getUrl() { - return url; - } - - @Override - public boolean isAvailable() { - return true; - } - - @Override - public void destroy() {} - - public void collect(URL statistics) {} - - public List lookup(URL query) { - return null; - } - }; - } - }; - - @Test - void testMonitorFactoryCache() throws Exception { - URL url = URL.valueOf("dubbo://" + NetUtils.getLocalAddress().getHostAddress() + ":2233"); - Monitor monitor1 = monitorFactory.getMonitor(url); - Monitor monitor2 = monitorFactory.getMonitor(url); - if (monitor1 == null || monitor2 == null) { - Thread.sleep(2000); - monitor1 = monitorFactory.getMonitor(url); - monitor2 = monitorFactory.getMonitor(url); - } - Assertions.assertEquals(monitor1, monitor2); - } - - @Test - void testMonitorFactoryIpCache() throws Exception { - URL url = URL.valueOf("dubbo://" + NetUtils.getLocalAddress().getHostName() + ":2233"); - Monitor monitor1 = monitorFactory.getMonitor(url); - Monitor monitor2 = monitorFactory.getMonitor(url); - if (monitor1 == null || monitor2 == null) { - Thread.sleep(2000); - monitor1 = monitorFactory.getMonitor(url); - monitor2 = monitorFactory.getMonitor(url); - } - Assertions.assertEquals(monitor1, monitor2); - } - - @Test - void testMonitorFactoryGroupCache() throws Exception { - URL url1 = URL.valueOf("dubbo://" + NetUtils.getLocalHost() + ":2233?group=aaa"); - URL url2 = URL.valueOf("dubbo://" + NetUtils.getLocalHost() + ":2233?group=bbb"); - Monitor monitor1 = monitorFactory.getMonitor(url1); - Monitor monitor2 = monitorFactory.getMonitor(url2); - if (monitor1 == null || monitor2 == null) { - Thread.sleep(2000); - monitor1 = monitorFactory.getMonitor(url1); - monitor2 = monitorFactory.getMonitor(url2); - } - Assertions.assertNotSame(monitor1, monitor2); - } -} diff --git a/dubbo-monitor/dubbo-monitor-common/src/test/resources/log4j2-test.xml b/dubbo-monitor/dubbo-monitor-common/src/test/resources/log4j2-test.xml deleted file mode 100644 index ba99f52cc2d2..000000000000 --- a/dubbo-monitor/dubbo-monitor-common/src/test/resources/log4j2-test.xml +++ /dev/null @@ -1,29 +0,0 @@ - - - - - - - - - - - - - - diff --git a/dubbo-monitor/dubbo-monitor-default/pom.xml b/dubbo-monitor/dubbo-monitor-default/pom.xml deleted file mode 100644 index 76b9a381913a..000000000000 --- a/dubbo-monitor/dubbo-monitor-default/pom.xml +++ /dev/null @@ -1,86 +0,0 @@ - - - - 4.0.0 - - org.apache.dubbo - dubbo-monitor - ${revision} - ../pom.xml - - dubbo-monitor-default - jar - ${project.artifactId} - The default monitor module of dubbo project - - false - - - - org.apache.dubbo - dubbo-monitor-common - ${project.parent.version} - - - com.alibaba.middleware - metrics-core-api - - - com.alibaba.middleware - metrics-core-impl - - - com.alibaba.middleware - metrics-common - - - org.apache.dubbo - dubbo-rpc-dubbo - ${project.parent.version} - test - - - org.apache.dubbo - dubbo-remoting-netty4 - ${project.parent.version} - test - - - org.apache.dubbo - dubbo-serialization-hessian2 - ${project.parent.version} - test - - - org.apache.dubbo - dubbo-serialization-fastjson2 - ${project.parent.version} - test - - - com.google.code.gson - gson - test - - - org.apache.logging.log4j - log4j-slf4j-impl - test - - - diff --git a/dubbo-monitor/dubbo-monitor-default/src/main/java/org/apache/dubbo/monitor/dubbo/DubboMonitor.java b/dubbo-monitor/dubbo-monitor-default/src/main/java/org/apache/dubbo/monitor/dubbo/DubboMonitor.java deleted file mode 100644 index 215ba5daa5d9..000000000000 --- a/dubbo-monitor/dubbo-monitor-default/src/main/java/org/apache/dubbo/monitor/dubbo/DubboMonitor.java +++ /dev/null @@ -1,238 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.apache.dubbo.monitor.dubbo; - -import org.apache.dubbo.common.URL; -import org.apache.dubbo.common.logger.ErrorTypeAwareLogger; -import org.apache.dubbo.common.logger.LoggerFactory; -import org.apache.dubbo.common.threadpool.manager.FrameworkExecutorRepository; -import org.apache.dubbo.common.utils.ConcurrentHashMapUtils; -import org.apache.dubbo.common.utils.ExecutorUtil; -import org.apache.dubbo.monitor.Monitor; -import org.apache.dubbo.monitor.MonitorService; -import org.apache.dubbo.rpc.Invoker; - -import java.util.List; -import java.util.Map; -import java.util.concurrent.ConcurrentHashMap; -import java.util.concurrent.ConcurrentMap; -import java.util.concurrent.ScheduledExecutorService; -import java.util.concurrent.ScheduledFuture; -import java.util.concurrent.TimeUnit; -import java.util.concurrent.atomic.AtomicReference; - -import static org.apache.dubbo.common.constants.CommonConstants.DEFAULT_PROTOCOL; -import static org.apache.dubbo.common.constants.CommonConstants.TIMESTAMP_KEY; -import static org.apache.dubbo.common.constants.LoggerCodeConstants.COMMON_MONITOR_EXCEPTION; -import static org.apache.dubbo.monitor.Constants.CONCURRENT_KEY; -import static org.apache.dubbo.monitor.Constants.DEFAULT_MONITOR_SEND_DATA_INTERVAL; -import static org.apache.dubbo.monitor.Constants.ELAPSED_KEY; -import static org.apache.dubbo.monitor.Constants.FAILURE_KEY; -import static org.apache.dubbo.monitor.Constants.INPUT_KEY; -import static org.apache.dubbo.monitor.Constants.MAX_CONCURRENT_KEY; -import static org.apache.dubbo.monitor.Constants.MAX_ELAPSED_KEY; -import static org.apache.dubbo.monitor.Constants.MAX_INPUT_KEY; -import static org.apache.dubbo.monitor.Constants.MAX_OUTPUT_KEY; -import static org.apache.dubbo.monitor.Constants.MONITOR_SEND_DATA_INTERVAL_KEY; -import static org.apache.dubbo.monitor.Constants.OUTPUT_KEY; -import static org.apache.dubbo.monitor.Constants.SUCCESS_KEY; - -/** - * DubboMonitor - */ -public class DubboMonitor implements Monitor { - - private static final ErrorTypeAwareLogger logger = LoggerFactory.getErrorTypeAwareLogger(DubboMonitor.class); - - /** - * The timer for sending statistics - */ - private final ScheduledExecutorService scheduledExecutorService; - - /** - * The future that can cancel the scheduledExecutorService - */ - private final ScheduledFuture sendFuture; - - private final Invoker monitorInvoker; - - private final MonitorService monitorService; - - private final ConcurrentMap> statisticsMap = new ConcurrentHashMap<>(); - - public DubboMonitor(Invoker monitorInvoker, MonitorService monitorService) { - this.monitorInvoker = monitorInvoker; - this.monitorService = monitorService; - scheduledExecutorService = monitorInvoker - .getUrl() - .getOrDefaultFrameworkModel() - .getBeanFactory() - .getBean(FrameworkExecutorRepository.class) - .getSharedScheduledExecutor(); - // The time interval for timer scheduledExecutorService to send data - final long monitorInterval = monitorInvoker - .getUrl() - .getPositiveParameter(MONITOR_SEND_DATA_INTERVAL_KEY, DEFAULT_MONITOR_SEND_DATA_INTERVAL); - // collect timer for collecting statistics data - sendFuture = scheduledExecutorService.scheduleWithFixedDelay( - () -> { - try { - // collect data - send(); - } catch (Throwable t) { - logger.error( - COMMON_MONITOR_EXCEPTION, - "", - "", - "Unexpected error occur at send statistic, cause: " + t.getMessage(), - t); - } - }, - monitorInterval, - monitorInterval, - TimeUnit.MILLISECONDS); - } - - public void send() { - if (logger.isDebugEnabled()) { - logger.debug("Send statistics to monitor " + getUrl()); - } - - String timestamp = String.valueOf(System.currentTimeMillis()); - for (Map.Entry> entry : statisticsMap.entrySet()) { - // get statistics data - Statistics statistics = entry.getKey(); - AtomicReference reference = entry.getValue(); - StatisticsItem statisticsItem = reference.get(); - - // send statistics data - URL url = statistics - .getUrl() - .addParameters( - TIMESTAMP_KEY, - timestamp, - SUCCESS_KEY, - String.valueOf(statisticsItem.getSuccess()), - FAILURE_KEY, - String.valueOf(statisticsItem.getFailure()), - INPUT_KEY, - String.valueOf(statisticsItem.getInput()), - OUTPUT_KEY, - String.valueOf(statisticsItem.getOutput()), - ELAPSED_KEY, - String.valueOf(statisticsItem.getElapsed()), - CONCURRENT_KEY, - String.valueOf(statisticsItem.getConcurrent()), - MAX_INPUT_KEY, - String.valueOf(statisticsItem.getMaxInput()), - MAX_OUTPUT_KEY, - String.valueOf(statisticsItem.getMaxOutput()), - MAX_ELAPSED_KEY, - String.valueOf(statisticsItem.getMaxElapsed()), - MAX_CONCURRENT_KEY, - String.valueOf(statisticsItem.getMaxConcurrent()), - DEFAULT_PROTOCOL, - getUrl().getParameter(DEFAULT_PROTOCOL)); - monitorService.collect(url.toSerializableURL()); - - // reset - StatisticsItem current; - StatisticsItem update = new StatisticsItem(); - do { - current = reference.get(); - if (current == null) { - update.setItems(0, 0, 0, 0, 0, 0); - } else { - update.setItems( - current.getSuccess() - statisticsItem.getSuccess(), - current.getFailure() - statisticsItem.getFailure(), - current.getInput() - statisticsItem.getInput(), - current.getOutput() - statisticsItem.getOutput(), - current.getElapsed() - statisticsItem.getElapsed(), - current.getConcurrent() - statisticsItem.getConcurrent()); - } - } while (!reference.compareAndSet(current, update)); - } - } - - @Override - public void collect(URL url) { - // data to collect from url - int success = url.getParameter(SUCCESS_KEY, 0); - int failure = url.getParameter(FAILURE_KEY, 0); - int input = url.getParameter(INPUT_KEY, 0); - int output = url.getParameter(OUTPUT_KEY, 0); - int elapsed = url.getParameter(ELAPSED_KEY, 0); - int concurrent = url.getParameter(CONCURRENT_KEY, 0); - // init atomic reference - Statistics statistics = new Statistics(url); - AtomicReference reference = - ConcurrentHashMapUtils.computeIfAbsent(statisticsMap, statistics, k -> new AtomicReference<>()); - // use CompareAndSet to sum - StatisticsItem current; - StatisticsItem update = new StatisticsItem(); - do { - current = reference.get(); - if (current == null) { - update.setItems( - success, failure, input, output, elapsed, concurrent, input, output, elapsed, concurrent); - } else { - update.setItems( - current.getSuccess() + success, - current.getFailure() + failure, - current.getInput() + input, - current.getOutput() + output, - current.getElapsed() + elapsed, - (current.getConcurrent() + concurrent) / 2, - current.getMaxInput() > input ? current.getMaxInput() : input, - current.getMaxOutput() > output ? current.getMaxOutput() : output, - current.getMaxElapsed() > elapsed ? current.getMaxElapsed() : elapsed, - current.getMaxConcurrent() > concurrent ? current.getMaxConcurrent() : concurrent); - } - } while (!reference.compareAndSet(current, update)); - } - - @Override - public List lookup(URL query) { - return monitorService.lookup(query); - } - - @Override - public URL getUrl() { - return monitorInvoker.getUrl(); - } - - @Override - public boolean isAvailable() { - return monitorInvoker.isAvailable(); - } - - @Override - public void destroy() { - try { - ExecutorUtil.cancelScheduledFuture(sendFuture); - } catch (Throwable t) { - logger.error( - COMMON_MONITOR_EXCEPTION, - "", - "", - "Unexpected error occur at cancel sender timer, cause: " + t.getMessage(), - t); - } - monitorInvoker.destroy(); - } -} diff --git a/dubbo-monitor/dubbo-monitor-default/src/main/java/org/apache/dubbo/monitor/dubbo/DubboMonitorFactory.java b/dubbo-monitor/dubbo-monitor-default/src/main/java/org/apache/dubbo/monitor/dubbo/DubboMonitorFactory.java deleted file mode 100644 index 1bffa1a2007c..000000000000 --- a/dubbo-monitor/dubbo-monitor-default/src/main/java/org/apache/dubbo/monitor/dubbo/DubboMonitorFactory.java +++ /dev/null @@ -1,69 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.apache.dubbo.monitor.dubbo; - -import org.apache.dubbo.common.URL; -import org.apache.dubbo.common.URLBuilder; -import org.apache.dubbo.common.utils.StringUtils; -import org.apache.dubbo.monitor.Monitor; -import org.apache.dubbo.monitor.MonitorService; -import org.apache.dubbo.monitor.support.AbstractMonitorFactory; -import org.apache.dubbo.rpc.Invoker; -import org.apache.dubbo.rpc.Protocol; -import org.apache.dubbo.rpc.ProxyFactory; - -import static org.apache.dubbo.common.constants.CommonConstants.DUBBO_PROTOCOL; -import static org.apache.dubbo.common.constants.CommonConstants.PROTOCOL_KEY; -import static org.apache.dubbo.common.constants.CommonConstants.REFERENCE_FILTER_KEY; -import static org.apache.dubbo.remoting.Constants.CHECK_KEY; - -/** - * DefaultMonitorFactory - */ -public class DubboMonitorFactory extends AbstractMonitorFactory { - - private Protocol protocol; - - private ProxyFactory proxyFactory; - - public void setProtocol(Protocol protocol) { - this.protocol = protocol; - } - - public void setProxyFactory(ProxyFactory proxyFactory) { - this.proxyFactory = proxyFactory; - } - - @Override - protected Monitor createMonitor(URL url) { - URLBuilder urlBuilder = URLBuilder.from(url); - urlBuilder.setProtocol(url.getParameter(PROTOCOL_KEY, DUBBO_PROTOCOL)); - if (StringUtils.isEmpty(url.getPath())) { - urlBuilder.setPath(MonitorService.class.getName()); - } - String filter = url.getParameter(REFERENCE_FILTER_KEY); - if (StringUtils.isEmpty(filter)) { - filter = ""; - } else { - filter = filter + ","; - } - urlBuilder.addParameters(CHECK_KEY, String.valueOf(false), REFERENCE_FILTER_KEY, filter + "-monitor"); - Invoker monitorInvoker = protocol.refer(MonitorService.class, urlBuilder.build()); - MonitorService monitorService = proxyFactory.getProxy(monitorInvoker); - return new DubboMonitor(monitorInvoker, monitorService); - } -} diff --git a/dubbo-monitor/dubbo-monitor-default/src/main/java/org/apache/dubbo/monitor/dubbo/MetricsFilter.java b/dubbo-monitor/dubbo-monitor-default/src/main/java/org/apache/dubbo/monitor/dubbo/MetricsFilter.java deleted file mode 100644 index 1b45878253b1..000000000000 --- a/dubbo-monitor/dubbo-monitor-default/src/main/java/org/apache/dubbo/monitor/dubbo/MetricsFilter.java +++ /dev/null @@ -1,296 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.apache.dubbo.monitor.dubbo; - -import org.apache.dubbo.common.URL; -import org.apache.dubbo.common.extension.ExtensionAccessor; -import org.apache.dubbo.common.extension.ExtensionAccessorAware; -import org.apache.dubbo.common.logger.ErrorTypeAwareLogger; -import org.apache.dubbo.common.logger.LoggerFactory; -import org.apache.dubbo.common.store.DataStore; -import org.apache.dubbo.common.utils.JsonUtils; -import org.apache.dubbo.common.utils.NetUtils; -import org.apache.dubbo.monitor.MetricsService; -import org.apache.dubbo.rpc.AsyncRpcResult; -import org.apache.dubbo.rpc.Filter; -import org.apache.dubbo.rpc.Invocation; -import org.apache.dubbo.rpc.Invoker; -import org.apache.dubbo.rpc.Protocol; -import org.apache.dubbo.rpc.Result; -import org.apache.dubbo.rpc.RpcException; -import org.apache.dubbo.rpc.model.ApplicationModel; -import org.apache.dubbo.rpc.model.ScopeModelAware; -import org.apache.dubbo.rpc.support.RpcUtils; - -import java.util.ArrayList; -import java.util.Collections; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.SortedMap; -import java.util.concurrent.ExecutorService; -import java.util.concurrent.ThreadPoolExecutor; -import java.util.concurrent.TimeUnit; -import java.util.concurrent.atomic.AtomicBoolean; - -import com.alibaba.metrics.FastCompass; -import com.alibaba.metrics.MetricLevel; -import com.alibaba.metrics.MetricManager; -import com.alibaba.metrics.MetricName; -import com.alibaba.metrics.MetricRegistry; -import com.alibaba.metrics.common.CollectLevel; -import com.alibaba.metrics.common.MetricObject; -import com.alibaba.metrics.common.MetricsCollector; -import com.alibaba.metrics.common.MetricsCollectorFactory; - -import static org.apache.dubbo.common.constants.CommonConstants.DEFAULT_PROTOCOL; -import static org.apache.dubbo.common.constants.CommonConstants.EXECUTOR_SERVICE_COMPONENT_KEY; -import static org.apache.dubbo.common.constants.CommonConstants.METHOD_KEY; -import static org.apache.dubbo.common.constants.CommonConstants.PROVIDER; -import static org.apache.dubbo.common.constants.LoggerCodeConstants.COMMON_METRICS_COLLECTOR_EXCEPTION; -import static org.apache.dubbo.monitor.Constants.DUBBO_CONSUMER; -import static org.apache.dubbo.monitor.Constants.DUBBO_CONSUMER_METHOD; -import static org.apache.dubbo.monitor.Constants.DUBBO_GROUP; -import static org.apache.dubbo.monitor.Constants.DUBBO_PROVIDER; -import static org.apache.dubbo.monitor.Constants.DUBBO_PROVIDER_METHOD; -import static org.apache.dubbo.monitor.Constants.SERVICE; - -/** - * @deprecated After metrics config is refactored. - * This filter should no longer use and will be deleted in the future. - */ -@Deprecated -public class MetricsFilter implements Filter, ExtensionAccessorAware, ScopeModelAware { - - private static final ErrorTypeAwareLogger logger = LoggerFactory.getErrorTypeAwareLogger(MetricsFilter.class); - protected static volatile AtomicBoolean exported = new AtomicBoolean(false); - private Integer port; - private String protocolName; - private ExtensionAccessor extensionAccessor; - private ApplicationModel applicationModel; - - private static final String METRICS_PORT = "metrics.port"; - private static final String METRICS_PROTOCOL = "metrics.protocol"; - - @Override - public void setApplicationModel(ApplicationModel applicationModel) { - this.applicationModel = applicationModel; - } - - @Override - public Result invoke(Invoker invoker, Invocation invocation) throws RpcException { - if (exported.compareAndSet(false, true)) { - this.protocolName = invoker.getUrl().getParameter(METRICS_PROTOCOL) == null - ? DEFAULT_PROTOCOL - : invoker.getUrl().getParameter(METRICS_PROTOCOL); - - Protocol protocol = - extensionAccessor.getExtensionLoader(Protocol.class).getExtension(protocolName); - - this.port = invoker.getUrl().getParameter(METRICS_PORT) == null - ? protocol.getDefaultPort() - : Integer.valueOf(invoker.getUrl().getParameter(METRICS_PORT)); - - Invoker metricsInvoker = initMetricsInvoker(); - - try { - protocol.export(metricsInvoker); - } catch (RuntimeException e) { - logger.error( - COMMON_METRICS_COLLECTOR_EXCEPTION, - "", - "", - "Metrics Service need to be configured" + " when multiple processes are running on a host" - + e.getMessage()); - } - } - - boolean isProvider = invoker.getUrl().getSide(PROVIDER).equalsIgnoreCase(PROVIDER); - long start = System.currentTimeMillis(); - try { - Result result = invoker.invoke(invocation); // proceed invocation chain - long duration = System.currentTimeMillis() - start; - reportMetrics(invoker, invocation, duration, "success", isProvider); - return result; - } catch (RpcException e) { - long duration = System.currentTimeMillis() - start; - String result = "error"; - if (e.isTimeout()) { - result = "timeoutError"; - } - if (e.isBiz()) { - result = "bisError"; - } - if (e.isNetwork()) { - result = "networkError"; - } - if (e.isSerialization()) { - result = "serializationError"; - } - reportMetrics(invoker, invocation, duration, result, isProvider); - throw e; - } - } - - private String buildMethodName(Invocation invocation) { - String methodName = RpcUtils.getMethodName(invocation); - StringBuilder method = new StringBuilder(methodName); - Class[] argTypes = RpcUtils.getParameterTypes(invocation); - - method.append('('); - - for (int i = 0; i < argTypes.length; i++) { - method.append((i == 0 ? "" : ", ") + argTypes[i].getSimpleName()); - } - method.append(')'); - Class returnType = RpcUtils.getReturnType(invocation); - String typeName = null; - if (returnType != null) { - typeName = returnType.getTypeName(); - typeName = typeName.substring(typeName.lastIndexOf(".") + 1); - } - - return (typeName == null ? "void" : typeName) + " " + method; - } - - private void reportMetrics( - Invoker invoker, Invocation invocation, long duration, String result, boolean isProvider) { - String serviceName = invoker.getInterface().getName(); - String methodName = buildMethodName(invocation); - MetricName global; - MetricName method; - if (isProvider) { - global = new MetricName(DUBBO_PROVIDER, MetricLevel.MAJOR); - method = new MetricName( - DUBBO_PROVIDER_METHOD, - new HashMap(4) { - { - put(SERVICE, serviceName); - put(METHOD_KEY, methodName); - } - }, - MetricLevel.NORMAL); - } else { - global = new MetricName(DUBBO_CONSUMER, MetricLevel.MAJOR); - method = new MetricName( - DUBBO_CONSUMER_METHOD, - new HashMap(4) { - { - put(SERVICE, serviceName); - put(METHOD_KEY, methodName); - } - }, - MetricLevel.NORMAL); - } - setCompassQuantity(DUBBO_GROUP, result, duration, global, method); - } - - private void setCompassQuantity(String groupName, String result, long duration, MetricName... metricNames) { - for (MetricName metricName : metricNames) { - FastCompass compass = MetricManager.getFastCompass(groupName, metricName); - compass.record(duration, result); - } - } - - private List getThreadPoolMessage() { - DataStore dataStore = - extensionAccessor.getExtensionLoader(DataStore.class).getDefaultExtension(); - Map executors = dataStore.get(EXECUTOR_SERVICE_COMPONENT_KEY); - - List threadPoolMtricList = new ArrayList<>(); - for (Map.Entry entry : executors.entrySet()) { - String port = entry.getKey(); - ExecutorService executor = (ExecutorService) entry.getValue(); - if (executor instanceof ThreadPoolExecutor) { - ThreadPoolExecutor tp = (ThreadPoolExecutor) executor; - - threadPoolMtricList.add( - value2MetricObject("threadPool.active", tp.getActiveCount(), MetricLevel.MAJOR)); - threadPoolMtricList.add(value2MetricObject("threadPool.core", tp.getCorePoolSize(), MetricLevel.MAJOR)); - threadPoolMtricList.add( - value2MetricObject("threadPool.max", tp.getMaximumPoolSize(), MetricLevel.MAJOR)); - threadPoolMtricList.add(value2MetricObject("threadPool.current", tp.getPoolSize(), MetricLevel.MAJOR)); - } - } - - return threadPoolMtricList; - } - - private MetricObject value2MetricObject(String metric, Integer value, MetricLevel level) { - if (metric == null || value == null || level == null) { - return null; - } - - return new MetricObject.Builder(metric) - .withValue(value) - .withLevel(level) - .build(); - } - - private Invoker initMetricsInvoker() { - Invoker metricsInvoker = new Invoker() { - @Override - public Class getInterface() { - return MetricsService.class; - } - - @Override - public Result invoke(Invocation invocation) throws RpcException { - String group = invocation.getArguments()[0].toString(); - MetricRegistry registry = MetricManager.getIMetricManager().getMetricRegistryByGroup(group); - - SortedMap fastCompasses = registry.getFastCompasses(); - - long timestamp = System.currentTimeMillis(); - double rateFactor = TimeUnit.SECONDS.toSeconds(1); - double durationFactor = 1.0 / TimeUnit.MILLISECONDS.toNanos(1); - - MetricsCollector collector = MetricsCollectorFactory.createNew( - CollectLevel.NORMAL, Collections.EMPTY_MAP, rateFactor, durationFactor, null); - - for (Map.Entry entry : fastCompasses.entrySet()) { - collector.collect(entry.getKey(), entry.getValue(), timestamp); - } - - List res = collector.build(); - res.addAll(getThreadPoolMessage()); - return AsyncRpcResult.newDefaultAsyncResult(JsonUtils.toJson(res), invocation); - } - - @Override - public URL getUrl() { - return URL.valueOf(protocolName + "://" + NetUtils.getIpByConfig(applicationModel) + ":" + port + "/" - + MetricsService.class.getName()); - } - - @Override - public boolean isAvailable() { - return false; - } - - @Override - public void destroy() {} - }; - - return metricsInvoker; - } - - @Override - public void setExtensionAccessor(ExtensionAccessor extensionAccessor) { - this.extensionAccessor = extensionAccessor; - } -} diff --git a/dubbo-monitor/dubbo-monitor-default/src/main/java/org/apache/dubbo/monitor/dubbo/Statistics.java b/dubbo-monitor/dubbo-monitor-default/src/main/java/org/apache/dubbo/monitor/dubbo/Statistics.java deleted file mode 100644 index 7c859aeb8de9..000000000000 --- a/dubbo-monitor/dubbo-monitor-default/src/main/java/org/apache/dubbo/monitor/dubbo/Statistics.java +++ /dev/null @@ -1,216 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.apache.dubbo.monitor.dubbo; - -import org.apache.dubbo.common.URL; - -import java.io.Serializable; - -import static org.apache.dubbo.common.constants.CommonConstants.APPLICATION_KEY; -import static org.apache.dubbo.common.constants.CommonConstants.CONSUMER; -import static org.apache.dubbo.common.constants.CommonConstants.GROUP_KEY; -import static org.apache.dubbo.common.constants.CommonConstants.INTERFACE_KEY; -import static org.apache.dubbo.common.constants.CommonConstants.METHOD_KEY; -import static org.apache.dubbo.common.constants.CommonConstants.PROVIDER; -import static org.apache.dubbo.common.constants.CommonConstants.VERSION_KEY; - -/** - * Statistics. (SPI, Prototype, ThreadSafe) - */ -public class Statistics implements Serializable { - - private static final long serialVersionUID = -6921183057683641441L; - - private URL url; - - private String application; - - private String service; - - private String method; - - private String group; - - private String version; - - private String client; - - private String server; - - public Statistics(URL url) { - this.url = url; - this.application = url.getParameter(APPLICATION_KEY); - this.service = url.getParameter(INTERFACE_KEY); - this.method = url.getParameter(METHOD_KEY); - this.group = url.getParameter(GROUP_KEY); - this.version = url.getParameter(VERSION_KEY); - this.client = url.getParameter(CONSUMER, url.getAddress()); - this.server = url.getParameter(PROVIDER, url.getAddress()); - } - - public URL getUrl() { - return url; - } - - public void setUrl(URL url) { - this.url = url; - } - - public String getApplication() { - return application; - } - - public Statistics setApplication(String application) { - this.application = application; - return this; - } - - public String getService() { - return service; - } - - public Statistics setService(String service) { - this.service = service; - return this; - } - - public String getGroup() { - return group; - } - - public void setGroup(String group) { - this.group = group; - } - - public String getVersion() { - return version; - } - - public void setVersion(String version) { - this.version = version; - } - - public String getMethod() { - return method; - } - - public Statistics setMethod(String method) { - this.method = method; - return this; - } - - public String getClient() { - return client; - } - - public Statistics setClient(String client) { - this.client = client; - return this; - } - - public String getServer() { - return server; - } - - public Statistics setServer(String server) { - this.server = server; - return this; - } - - @Override - public int hashCode() { - final int prime = 31; - int result = 1; - result = prime * result + ((application == null) ? 0 : application.hashCode()); - result = prime * result + ((client == null) ? 0 : client.hashCode()); - result = prime * result + ((group == null) ? 0 : group.hashCode()); - result = prime * result + ((method == null) ? 0 : method.hashCode()); - result = prime * result + ((server == null) ? 0 : server.hashCode()); - result = prime * result + ((service == null) ? 0 : service.hashCode()); - result = prime * result + ((version == null) ? 0 : version.hashCode()); - return result; - } - - @Override - public boolean equals(Object obj) { - if (this == obj) { - return true; - } - if (obj == null) { - return false; - } - if (getClass() != obj.getClass()) { - return false; - } - Statistics other = (Statistics) obj; - if (application == null) { - if (other.application != null) { - return false; - } - } else if (!application.equals(other.application)) { - return false; - } - if (client == null) { - if (other.client != null) { - return false; - } - } else if (!client.equals(other.client)) { - return false; - } - if (group == null) { - if (other.group != null) { - return false; - } - } else if (!group.equals(other.group)) { - return false; - } - if (method == null) { - if (other.method != null) { - return false; - } - } else if (!method.equals(other.method)) { - return false; - } - if (server == null) { - if (other.server != null) { - return false; - } - } else if (!server.equals(other.server)) { - return false; - } - if (service == null) { - if (other.service != null) { - return false; - } - } else if (!service.equals(other.service)) { - return false; - } - if (version == null) { - if (other.version != null) { - return false; - } - } else if (!version.equals(other.version)) { - return false; - } - return true; - } - - @Override - public String toString() { - return url.toString(); - } -} diff --git a/dubbo-monitor/dubbo-monitor-default/src/main/java/org/apache/dubbo/monitor/dubbo/StatisticsItem.java b/dubbo-monitor/dubbo-monitor-default/src/main/java/org/apache/dubbo/monitor/dubbo/StatisticsItem.java deleted file mode 100644 index c33d0035805d..000000000000 --- a/dubbo-monitor/dubbo-monitor-default/src/main/java/org/apache/dubbo/monitor/dubbo/StatisticsItem.java +++ /dev/null @@ -1,140 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.apache.dubbo.monitor.dubbo; - -public class StatisticsItem { - - private long success; - private long failure; - private long input; - private long output; - private long elapsed; - private long concurrent; - private long maxInput; - private long maxOutput; - private long maxElapsed; - private long maxConcurrent; - - public StatisticsItem() {} - - public void setItems(long success, long failure, long input, long output, long elapsed, long concurrent) { - this.setItems(success, failure, input, output, elapsed, concurrent, 0, 0, 0, 0); - } - - public void setItems( - long success, - long failure, - long input, - long output, - long elapsed, - long concurrent, - long maxInput, - long maxOutput, - long maxElapsed, - long maxConcurrent) { - this.success = success; - this.failure = failure; - this.input = input; - this.output = output; - this.elapsed = elapsed; - this.concurrent = concurrent; - this.maxInput = maxInput; - this.maxOutput = maxOutput; - this.maxElapsed = maxElapsed; - this.maxConcurrent = maxConcurrent; - } - - public long getSuccess() { - return success; - } - - public void setSuccess(long success) { - this.success = success; - } - - public long getFailure() { - return failure; - } - - public void setFailure(long failure) { - this.failure = failure; - } - - public long getInput() { - return input; - } - - public void setInput(long input) { - this.input = input; - } - - public long getOutput() { - return output; - } - - public void setOutput(long output) { - this.output = output; - } - - public long getElapsed() { - return elapsed; - } - - public void setElapsed(long elapsed) { - this.elapsed = elapsed; - } - - public long getConcurrent() { - return concurrent; - } - - public void setConcurrent(long concurrent) { - this.concurrent = concurrent; - } - - public long getMaxInput() { - return maxInput; - } - - public void setMaxInput(long maxInput) { - this.maxInput = maxInput; - } - - public long getMaxOutput() { - return maxOutput; - } - - public void setMaxOutput(long maxOutput) { - this.maxOutput = maxOutput; - } - - public long getMaxElapsed() { - return maxElapsed; - } - - public void setMaxElapsed(long maxElapsed) { - this.maxElapsed = maxElapsed; - } - - public long getMaxConcurrent() { - return maxConcurrent; - } - - public void setMaxConcurrent(long maxConcurrent) { - this.maxConcurrent = maxConcurrent; - } -} diff --git a/dubbo-monitor/dubbo-monitor-default/src/main/resources/META-INF/dubbo/internal/org.apache.dubbo.monitor.MonitorFactory b/dubbo-monitor/dubbo-monitor-default/src/main/resources/META-INF/dubbo/internal/org.apache.dubbo.monitor.MonitorFactory deleted file mode 100644 index 62701cc4c50d..000000000000 --- a/dubbo-monitor/dubbo-monitor-default/src/main/resources/META-INF/dubbo/internal/org.apache.dubbo.monitor.MonitorFactory +++ /dev/null @@ -1 +0,0 @@ -dubbo=org.apache.dubbo.monitor.dubbo.DubboMonitorFactory \ No newline at end of file diff --git a/dubbo-monitor/dubbo-monitor-default/src/main/resources/META-INF/dubbo/internal/org.apache.dubbo.rpc.Filter b/dubbo-monitor/dubbo-monitor-default/src/main/resources/META-INF/dubbo/internal/org.apache.dubbo.rpc.Filter deleted file mode 100644 index 8441a9c63eb9..000000000000 --- a/dubbo-monitor/dubbo-monitor-default/src/main/resources/META-INF/dubbo/internal/org.apache.dubbo.rpc.Filter +++ /dev/null @@ -1 +0,0 @@ -metrics=org.apache.dubbo.monitor.dubbo.MetricsFilter diff --git a/dubbo-monitor/dubbo-monitor-default/src/test/java/org/apache/dubbo/monitor/dubbo/AppResponseBuilder.java b/dubbo-monitor/dubbo-monitor-default/src/test/java/org/apache/dubbo/monitor/dubbo/AppResponseBuilder.java deleted file mode 100644 index 737572ae3226..000000000000 --- a/dubbo-monitor/dubbo-monitor-default/src/test/java/org/apache/dubbo/monitor/dubbo/AppResponseBuilder.java +++ /dev/null @@ -1,55 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.apache.dubbo.monitor.dubbo; - -import org.apache.dubbo.rpc.AppResponse; - -import java.util.Map; - -public class AppResponseBuilder { - private Object result; - private Throwable exception; - private Map attachments; - private AppResponse appResponse; - - private AppResponseBuilder() { - this.appResponse = new AppResponse(); - } - - public static AppResponseBuilder create() { - return new AppResponseBuilder(); - } - - public AppResponse build() { - return new AppResponse(this); - } - - public AppResponseBuilder withResult(Object result) { - this.result = result; - return this; - } - - public AppResponseBuilder withException(Throwable exception) { - this.exception = exception; - return this; - } - - public AppResponseBuilder withAttachments(Map attachments) { - this.attachments = attachments; - return this; - } -} diff --git a/dubbo-monitor/dubbo-monitor-default/src/test/java/org/apache/dubbo/monitor/dubbo/DubboMonitorFactoryTest.java b/dubbo-monitor/dubbo-monitor-default/src/test/java/org/apache/dubbo/monitor/dubbo/DubboMonitorFactoryTest.java deleted file mode 100644 index c676528cc3c2..000000000000 --- a/dubbo-monitor/dubbo-monitor-default/src/test/java/org/apache/dubbo/monitor/dubbo/DubboMonitorFactoryTest.java +++ /dev/null @@ -1,70 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.apache.dubbo.monitor.dubbo; - -import org.apache.dubbo.common.URL; -import org.apache.dubbo.monitor.Monitor; -import org.apache.dubbo.rpc.Invoker; -import org.apache.dubbo.rpc.ProxyFactory; -import org.apache.dubbo.rpc.model.FrameworkModel; -import org.apache.dubbo.rpc.protocol.dubbo.DubboProtocol; - -import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mock; - -import static org.apache.dubbo.common.constants.CommonConstants.REFERENCE_FILTER_KEY; -import static org.hamcrest.CoreMatchers.containsString; -import static org.hamcrest.CoreMatchers.nullValue; -import static org.hamcrest.MatcherAssert.assertThat; -import static org.hamcrest.Matchers.not; -import static org.mockito.Mockito.atLeastOnce; -import static org.mockito.Mockito.verify; -import static org.mockito.MockitoAnnotations.initMocks; - -class DubboMonitorFactoryTest { - private DubboMonitorFactory dubboMonitorFactory; - - @Mock - private ProxyFactory proxyFactory; - - @BeforeEach - public void setUp() throws Exception { - initMocks(this); - this.dubboMonitorFactory = new DubboMonitorFactory(); - this.dubboMonitorFactory.setProtocol(new DubboProtocol(FrameworkModel.defaultModel())); - this.dubboMonitorFactory.setProxyFactory(proxyFactory); - } - - @Test - void testCreateMonitor() { - URL urlWithoutPath = URL.valueOf("http://10.10.10.11"); - Monitor monitor = dubboMonitorFactory.createMonitor(urlWithoutPath); - assertThat(monitor, not(nullValue())); - - URL urlWithFilterKey = URL.valueOf("http://10.10.10.11/").addParameter(REFERENCE_FILTER_KEY, "testFilter"); - monitor = dubboMonitorFactory.createMonitor(urlWithFilterKey); - - assertThat(monitor, not(nullValue())); - ArgumentCaptor invokerArgumentCaptor = ArgumentCaptor.forClass(Invoker.class); - verify(proxyFactory, atLeastOnce()).getProxy(invokerArgumentCaptor.capture()); - - Invoker invoker = invokerArgumentCaptor.getValue(); - assertThat(invoker.getUrl().getParameter(REFERENCE_FILTER_KEY), containsString("testFilter")); - } -} diff --git a/dubbo-monitor/dubbo-monitor-default/src/test/java/org/apache/dubbo/monitor/dubbo/DubboMonitorTest.java b/dubbo-monitor/dubbo-monitor-default/src/test/java/org/apache/dubbo/monitor/dubbo/DubboMonitorTest.java deleted file mode 100644 index 891a45e10724..000000000000 --- a/dubbo-monitor/dubbo-monitor-default/src/test/java/org/apache/dubbo/monitor/dubbo/DubboMonitorTest.java +++ /dev/null @@ -1,275 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.apache.dubbo.monitor.dubbo; - -import org.apache.dubbo.common.URL; -import org.apache.dubbo.common.URLBuilder; -import org.apache.dubbo.common.extension.ExtensionLoader; -import org.apache.dubbo.monitor.Monitor; -import org.apache.dubbo.monitor.MonitorFactory; -import org.apache.dubbo.monitor.MonitorService; -import org.apache.dubbo.rpc.Exporter; -import org.apache.dubbo.rpc.Invocation; -import org.apache.dubbo.rpc.Invoker; -import org.apache.dubbo.rpc.Protocol; -import org.apache.dubbo.rpc.ProxyFactory; -import org.apache.dubbo.rpc.Result; -import org.apache.dubbo.rpc.RpcException; - -import java.util.Arrays; -import java.util.List; -import java.util.Optional; -import java.util.concurrent.TimeUnit; - -import org.hamcrest.CustomMatcher; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; - -import static org.apache.dubbo.common.constants.CommonConstants.APPLICATION_KEY; -import static org.apache.dubbo.common.constants.CommonConstants.CONSUMER; -import static org.apache.dubbo.common.constants.CommonConstants.DUBBO_PROTOCOL; -import static org.apache.dubbo.common.constants.CommonConstants.INTERFACE_KEY; -import static org.apache.dubbo.common.constants.CommonConstants.METHOD_KEY; -import static org.apache.dubbo.monitor.Constants.CONCURRENT_KEY; -import static org.apache.dubbo.monitor.Constants.ELAPSED_KEY; -import static org.apache.dubbo.monitor.Constants.FAILURE_KEY; -import static org.apache.dubbo.monitor.Constants.INPUT_KEY; -import static org.apache.dubbo.monitor.Constants.MAX_CONCURRENT_KEY; -import static org.apache.dubbo.monitor.Constants.MAX_ELAPSED_KEY; -import static org.apache.dubbo.monitor.Constants.OUTPUT_KEY; -import static org.apache.dubbo.monitor.Constants.SUCCESS_KEY; -import static org.awaitility.Awaitility.await; -import static org.hamcrest.CoreMatchers.hasItem; -import static org.hamcrest.CoreMatchers.is; -import static org.hamcrest.CoreMatchers.nullValue; -import static org.hamcrest.MatcherAssert.assertThat; -import static org.hamcrest.Matchers.not; -import static org.mockito.BDDMockito.given; -import static org.mockito.Mockito.atLeastOnce; -import static org.mockito.Mockito.mock; -import static org.mockito.Mockito.verify; - -/** - * DubboMonitorTest - */ -class DubboMonitorTest { - - private final Invoker monitorInvoker = new Invoker() { - @Override - public Class getInterface() { - return MonitorService.class; - } - - public URL getUrl() { - return URL.valueOf("dubbo://127.0.0.1:7070?interval=1000"); - } - - @Override - public boolean isAvailable() { - return false; - } - - @Override - public Result invoke(Invocation invocation) throws RpcException { - return null; - } - - @Override - public void destroy() {} - }; - private volatile URL lastStatistics; - private final MonitorService monitorService = new MonitorService() { - - public void collect(URL statistics) { - DubboMonitorTest.this.lastStatistics = statistics; - } - - public List lookup(URL query) { - return Arrays.asList(DubboMonitorTest.this.lastStatistics); - } - }; - - @Test - void testCount() { - DubboMonitor monitor = new DubboMonitor(monitorInvoker, monitorService); - URL statistics = new URLBuilder(DUBBO_PROTOCOL, "10.20.153.10", 0) - .addParameter(APPLICATION_KEY, "morgan") - .addParameter(INTERFACE_KEY, "MemberService") - .addParameter(METHOD_KEY, "findPerson") - .addParameter(CONSUMER, "10.20.153.11") - .addParameter(SUCCESS_KEY, 1) - .addParameter(FAILURE_KEY, 0) - .addParameter(ELAPSED_KEY, 3) - .addParameter(MAX_ELAPSED_KEY, 3) - .addParameter(CONCURRENT_KEY, 1) - .addParameter(MAX_CONCURRENT_KEY, 1) - .build(); - monitor.collect(statistics.toSerializableURL()); - monitor.send(); - await().atMost(60, TimeUnit.SECONDS).until(() -> lastStatistics != null); - Assertions.assertEquals("morgan", lastStatistics.getParameter(APPLICATION_KEY)); - Assertions.assertEquals("dubbo", lastStatistics.getProtocol()); - Assertions.assertEquals("10.20.153.10", lastStatistics.getHost()); - Assertions.assertEquals("morgan", lastStatistics.getParameter(APPLICATION_KEY)); - Assertions.assertEquals("MemberService", lastStatistics.getParameter(INTERFACE_KEY)); - Assertions.assertEquals("findPerson", lastStatistics.getParameter(METHOD_KEY)); - Assertions.assertEquals("10.20.153.11", lastStatistics.getParameter(CONSUMER)); - Assertions.assertEquals("1", lastStatistics.getParameter(SUCCESS_KEY)); - Assertions.assertEquals("0", lastStatistics.getParameter(FAILURE_KEY)); - Assertions.assertEquals("3", lastStatistics.getParameter(ELAPSED_KEY)); - Assertions.assertEquals("3", lastStatistics.getParameter(MAX_ELAPSED_KEY)); - Assertions.assertEquals("1", lastStatistics.getParameter(CONCURRENT_KEY)); - Assertions.assertEquals("1", lastStatistics.getParameter(MAX_CONCURRENT_KEY)); - monitor.destroy(); - } - - @Test - void testMonitorFactory() { - MockMonitorService monitorService = new MockMonitorService(); - URL statistics = new URLBuilder(DUBBO_PROTOCOL, "10.20.153.10", 0) - .addParameter(APPLICATION_KEY, "morgan") - .addParameter(INTERFACE_KEY, "MemberService") - .addParameter(METHOD_KEY, "findPerson") - .addParameter(CONSUMER, "10.20.153.11") - .addParameter(SUCCESS_KEY, 1) - .addParameter(FAILURE_KEY, 0) - .addParameter(ELAPSED_KEY, 3) - .addParameter(MAX_ELAPSED_KEY, 3) - .addParameter(CONCURRENT_KEY, 1) - .addParameter(MAX_CONCURRENT_KEY, 1) - .build(); - - Protocol protocol = ExtensionLoader.getExtensionLoader(Protocol.class).getAdaptiveExtension(); - ProxyFactory proxyFactory = - ExtensionLoader.getExtensionLoader(ProxyFactory.class).getAdaptiveExtension(); - MonitorFactory monitorFactory = - ExtensionLoader.getExtensionLoader(MonitorFactory.class).getAdaptiveExtension(); - - Exporter exporter = protocol.export(proxyFactory.getInvoker( - monitorService, - MonitorService.class, - URL.valueOf("dubbo://127.0.0.1:17979/" + MonitorService.class.getName()))); - try { - Monitor monitor = null; - long start = System.currentTimeMillis(); - while (System.currentTimeMillis() - start < 60000) { - monitor = monitorFactory.getMonitor(URL.valueOf("dubbo://127.0.0.1:17979?interval=10")); - if (monitor == null) { - continue; - } - try { - monitor.collect(statistics.toSerializableURL()); - await().atLeast(10, TimeUnit.MILLISECONDS) - .atMost(60, TimeUnit.SECONDS) - .until(() -> monitorService.getStatistics().stream() - .anyMatch(s -> s.getParameter(SUCCESS_KEY, 0) == 1)); - - List statisticsUrls = monitorService.getStatistics(); - Optional url = statisticsUrls.stream() - .filter(s -> s.getParameter(SUCCESS_KEY, 0) == 1) - .findFirst(); - Assertions.assertTrue(url.isPresent()); - Assertions.assertEquals(1, url.get().getParameter(SUCCESS_KEY, 0)); - Assertions.assertEquals(3, url.get().getParameter(ELAPSED_KEY, 0)); - } finally { - monitor.destroy(); - } - break; - } - Assertions.assertNotNull(monitor); - } finally { - exporter.unexport(); - } - } - - @Test - void testAvailable() { - Invoker invoker = mock(Invoker.class); - MonitorService monitorService = mock(MonitorService.class); - - given(invoker.isAvailable()).willReturn(true); - given(invoker.getUrl()).willReturn(URL.valueOf("dubbo://127.0.0.1:7070?interval=20")); - DubboMonitor dubboMonitor = new DubboMonitor(invoker, monitorService); - - assertThat(dubboMonitor.isAvailable(), is(true)); - verify(invoker).isAvailable(); - } - - @Test - void testSum() { - URL statistics = new URLBuilder(DUBBO_PROTOCOL, "10.20.153.11", 0) - .addParameter(APPLICATION_KEY, "morgan") - .addParameter(INTERFACE_KEY, "MemberService") - .addParameter(METHOD_KEY, "findPerson") - .addParameter(CONSUMER, "10.20.153.11") - .addParameter(SUCCESS_KEY, 1) - .addParameter(FAILURE_KEY, 0) - .addParameter(ELAPSED_KEY, 3) - .addParameter(MAX_ELAPSED_KEY, 3) - .addParameter(CONCURRENT_KEY, 1) - .addParameter(MAX_CONCURRENT_KEY, 1) - .build(); - Invoker invoker = mock(Invoker.class); - MonitorService monitorService = mock(MonitorService.class); - - given(invoker.getUrl()).willReturn(URL.valueOf("dubbo://127.0.0.1:7070?interval=20")); - DubboMonitor dubboMonitor = new DubboMonitor(invoker, monitorService); - - dubboMonitor.collect(statistics.toSerializableURL()); - dubboMonitor.collect(statistics - .addParameter(SUCCESS_KEY, 3) - .addParameter(CONCURRENT_KEY, 2) - .addParameter(INPUT_KEY, 1) - .addParameter(OUTPUT_KEY, 2) - .toSerializableURL()); - dubboMonitor.collect(statistics - .addParameter(SUCCESS_KEY, 6) - .addParameter(ELAPSED_KEY, 2) - .toSerializableURL()); - - dubboMonitor.send(); - - ArgumentCaptor summaryCaptor = ArgumentCaptor.forClass(URL.class); - verify(monitorService, atLeastOnce()).collect(summaryCaptor.capture()); - - List allValues = summaryCaptor.getAllValues(); - - assertThat(allValues, not(nullValue())); - assertThat(allValues, hasItem(new CustomMatcher("Monitor count should greater than 1") { - @Override - public boolean matches(Object item) { - URL url = (URL) item; - return Integer.valueOf(url.getParameter(SUCCESS_KEY)) > 1; - } - })); - } - - @Test - void testLookUp() { - Invoker invoker = mock(Invoker.class); - MonitorService monitorService = mock(MonitorService.class); - - URL queryUrl = URL.valueOf("dubbo://127.0.0.1:7070?interval=20"); - given(invoker.getUrl()).willReturn(queryUrl); - DubboMonitor dubboMonitor = new DubboMonitor(invoker, monitorService); - - dubboMonitor.lookup(queryUrl); - - verify(monitorService).lookup(queryUrl); - } -} diff --git a/dubbo-monitor/dubbo-monitor-default/src/test/java/org/apache/dubbo/monitor/dubbo/MetricsFilterTest.java b/dubbo-monitor/dubbo-monitor-default/src/test/java/org/apache/dubbo/monitor/dubbo/MetricsFilterTest.java deleted file mode 100644 index 864d52fe238a..000000000000 --- a/dubbo-monitor/dubbo-monitor-default/src/test/java/org/apache/dubbo/monitor/dubbo/MetricsFilterTest.java +++ /dev/null @@ -1,421 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.apache.dubbo.monitor.dubbo; - -import org.apache.dubbo.common.URL; -import org.apache.dubbo.common.utils.NetUtils; -import org.apache.dubbo.monitor.MetricsService; -import org.apache.dubbo.monitor.dubbo.service.DemoService; -import org.apache.dubbo.rpc.AppResponse; -import org.apache.dubbo.rpc.Invocation; -import org.apache.dubbo.rpc.Invoker; -import org.apache.dubbo.rpc.Protocol; -import org.apache.dubbo.rpc.RpcContext; -import org.apache.dubbo.rpc.RpcException; -import org.apache.dubbo.rpc.RpcInvocation; -import org.apache.dubbo.rpc.model.ApplicationModel; -import org.apache.dubbo.rpc.model.FrameworkModel; -import org.apache.dubbo.rpc.protocol.dubbo.DubboProtocol; - -import java.util.HashMap; -import java.util.LinkedList; -import java.util.List; -import java.util.Map; -import java.util.Random; -import java.util.concurrent.Callable; -import java.util.function.Function; - -import com.alibaba.metrics.FastCompass; -import com.alibaba.metrics.IMetricManager; -import com.alibaba.metrics.MetricLevel; -import com.alibaba.metrics.MetricManager; -import com.alibaba.metrics.MetricName; -import com.alibaba.metrics.common.MetricObject; -import com.google.gson.Gson; -import com.google.gson.reflect.TypeToken; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.Mockito; - -import static org.apache.dubbo.common.constants.CommonConstants.CONSUMER_SIDE; -import static org.apache.dubbo.common.constants.CommonConstants.METHOD_KEY; -import static org.apache.dubbo.common.constants.CommonConstants.PROVIDER; -import static org.apache.dubbo.common.constants.CommonConstants.SIDE_KEY; -import static org.apache.dubbo.common.constants.CommonConstants.TIMEOUT_KEY; -import static org.apache.dubbo.monitor.Constants.DUBBO_CONSUMER; -import static org.apache.dubbo.monitor.Constants.DUBBO_CONSUMER_METHOD; -import static org.apache.dubbo.monitor.Constants.DUBBO_GROUP; -import static org.apache.dubbo.monitor.Constants.DUBBO_PROVIDER; -import static org.apache.dubbo.monitor.Constants.DUBBO_PROVIDER_METHOD; -import static org.apache.dubbo.monitor.Constants.SERVICE; -import static org.mockito.BDDMockito.given; -import static org.mockito.Mockito.doNothing; -import static org.mockito.Mockito.mock; - -class MetricsFilterTest { - private int port = NetUtils.getAvailablePort(20880 + new Random().nextInt(10000)); - - private final Function> invokerFunction = (url) -> { - Invoker serviceInvoker = mock(Invoker.class); - - given(serviceInvoker.isAvailable()).willReturn(false); - given(serviceInvoker.getInterface()).willReturn(DemoService.class); - given(serviceInvoker.getUrl()).willReturn(url); - given(serviceInvoker.invoke(Mockito.any(Invocation.class))).willReturn(null); - doNothing().when(serviceInvoker).destroy(); - return serviceInvoker; - }; - - private URL getUrl() { - return URL.valueOf("dubbo://" + NetUtils.getLocalHost() + ":" + port - + "/org.apache.dubbo.monitor.dubbo.service.DemoService?" + "metrics.port" + "=" + port); - } - - private void onInvokeReturns(Invoker invoker, AppResponse response) { - given(invoker.invoke(Mockito.any(Invocation.class))).willReturn(response); - } - - public void onInvokerThrows(Invoker invoker) { - given(invoker.invoke(Mockito.any(Invocation.class))) - .willThrow(new RpcException(RpcException.TIMEOUT_EXCEPTION)); - } - - @Test - void testAll() { - List> testcases = new LinkedList<>(); - testcases.add(() -> { - testConsumerSuccess(); - return null; - }); - testcases.add(() -> { - testConsumerTimeout(); - return null; - }); - testcases.add(() -> { - testProviderSuccess(); - return null; - }); - testcases.add(() -> { - testInvokeMetricsService(); - return null; - }); - testcases.add(() -> { - testInvokeMetricsMethodService(); - return null; - }); - - for (Callable testcase : testcases) { - Throwable throwable = null; - for (int i = 0; i < 10; i++) { - try { - port = NetUtils.getAvailablePort(20880 + new Random().nextInt(10000)); - testcase.call(); - throwable = null; - break; - } catch (Throwable t) { - t.printStackTrace(); - throwable = t; - } finally { - MetricsFilter.exported.set(false); - } - } - Assertions.assertNull(throwable); - } - } - - private void testConsumerSuccess() { - IMetricManager metricManager = MetricManager.getIMetricManager(); - metricManager.clear(); - MetricsFilter metricsFilter = new MetricsFilter(); - metricsFilter.setExtensionAccessor(ApplicationModel.defaultModel()); - Invocation invocation = new RpcInvocation( - "sayName", DemoService.class.getName(), "", new Class[] {Integer.class}, new Object[0]); - RpcContext.getServiceContext() - .setRemoteAddress(NetUtils.getLocalHost(), port) - .setLocalAddress(NetUtils.getLocalHost(), 2345); - URL url = getUrl().addParameter(SIDE_KEY, CONSUMER_SIDE); - Invoker invoker = invokerFunction.apply(url); - AppResponse response = AppResponseBuilder.create().build(); - onInvokeReturns(invoker, response); - for (int i = 0; i < 100; i++) { - metricsFilter.invoke(invoker, invocation); - } - FastCompass dubboClient = - metricManager.getFastCompass(DUBBO_GROUP, new MetricName(DUBBO_CONSUMER, MetricLevel.MAJOR)); - FastCompass dubboMethod = metricManager.getFastCompass( - DUBBO_GROUP, - new MetricName( - DUBBO_CONSUMER_METHOD, - new HashMap(4) { - { - put(SERVICE, "org.apache.dubbo.monitor.dubbo.service.DemoService"); - put(METHOD_KEY, "void sayName(Integer)"); - } - }, - MetricLevel.NORMAL)); - long timestamp = System.currentTimeMillis() / 5000 * 5000; - Assertions.assertEquals( - 100, dubboClient.getMethodCountPerCategory(0).get("success").get(timestamp)); - timestamp = timestamp / 15000 * 15000; - Assertions.assertEquals( - 100, dubboMethod.getMethodCountPerCategory(0).get("success").get(timestamp)); - } - - private void testConsumerTimeout() { - IMetricManager metricManager = MetricManager.getIMetricManager(); - metricManager.clear(); - MetricsFilter metricsFilter = new MetricsFilter(); - metricsFilter.setExtensionAccessor(ApplicationModel.defaultModel()); - Invocation invocation = new RpcInvocation("timeoutException", DemoService.class.getName(), "", null, null); - RpcContext.getServiceContext() - .setRemoteAddress(NetUtils.getLocalHost(), port) - .setLocalAddress(NetUtils.getLocalHost(), 2345); - URL url = getUrl().addParameter(SIDE_KEY, CONSUMER_SIDE).addParameter(TIMEOUT_KEY, 300); - Invoker invoker = invokerFunction.apply(url); - onInvokerThrows(invoker); - for (int i = 0; i < 10; i++) { - try { - metricsFilter.invoke(invoker, invocation); - } catch (RpcException e) { - // ignore - } - } - FastCompass dubboClient = - metricManager.getFastCompass(DUBBO_GROUP, new MetricName(DUBBO_CONSUMER, MetricLevel.MAJOR)); - FastCompass dubboMethod = metricManager.getFastCompass( - DUBBO_GROUP, - new MetricName( - DUBBO_CONSUMER_METHOD, - new HashMap(4) { - { - put(SERVICE, "org.apache.dubbo.monitor.dubbo.service.DemoService"); - put(METHOD_KEY, "void timeoutException()"); - } - }, - MetricLevel.NORMAL)); - long timestamp = System.currentTimeMillis() / 5000 * 5000; - Assertions.assertEquals( - 10, dubboClient.getMethodCountPerCategory(0).get("timeoutError").get(timestamp)); - timestamp = timestamp / 15000 * 15000; - Assertions.assertEquals( - 10, dubboMethod.getMethodCountPerCategory(0).get("timeoutError").get(timestamp)); - } - - private void testProviderSuccess() { - IMetricManager metricManager = MetricManager.getIMetricManager(); - metricManager.clear(); - MetricsFilter metricsFilter = new MetricsFilter(); - metricsFilter.setExtensionAccessor(ApplicationModel.defaultModel()); - Invocation invocation = - new RpcInvocation("sayName", DemoService.class.getName(), "", new Class[0], new Object[0]); - RpcContext.getServiceContext() - .setRemoteAddress(NetUtils.getLocalHost(), port) - .setLocalAddress(NetUtils.getLocalHost(), 2345); - URL url = getUrl().addParameter(SIDE_KEY, PROVIDER).addParameter(TIMEOUT_KEY, 300); - Invoker invoker = invokerFunction.apply(url); - AppResponse response = AppResponseBuilder.create().build(); - onInvokeReturns(invoker, response); - for (int i = 0; i < 100; i++) { - metricsFilter.invoke(invoker, invocation); - } - FastCompass dubboClient = - metricManager.getFastCompass(DUBBO_GROUP, new MetricName(DUBBO_PROVIDER, MetricLevel.MAJOR)); - FastCompass dubboMethod = metricManager.getFastCompass( - DUBBO_GROUP, - new MetricName( - DUBBO_PROVIDER_METHOD, - new HashMap(4) { - { - put(SERVICE, "org.apache.dubbo.monitor.dubbo.service.DemoService"); - put(METHOD_KEY, "void sayName()"); - } - }, - MetricLevel.NORMAL)); - long timestamp = System.currentTimeMillis() / 5000 * 5000; - Assertions.assertEquals( - 100, dubboClient.getMethodCountPerCategory(0).get("success").get(timestamp)); - timestamp = timestamp / 15000 * 15000; - Assertions.assertEquals( - 100, dubboMethod.getMethodCountPerCategory(0).get("success").get(timestamp)); - } - - private void testInvokeMetricsService() { - IMetricManager metricManager = MetricManager.getIMetricManager(); - metricManager.clear(); - MetricsFilter metricsFilter = new MetricsFilter(); - metricsFilter.setExtensionAccessor(ApplicationModel.defaultModel()); - Invocation invocation = - new RpcInvocation("sayName", DemoService.class.getName(), "", new Class[0], new Object[0]); - RpcContext.getServiceContext() - .setRemoteAddress(NetUtils.getLocalHost(), port) - .setLocalAddress(NetUtils.getLocalHost(), 2345); - URL url = getUrl().addParameter(SIDE_KEY, PROVIDER).addParameter(TIMEOUT_KEY, 300); - Invoker serviceInvoker = invokerFunction.apply(url); - Invoker timeoutInvoker = invokerFunction.apply(url); - AppResponse response = AppResponseBuilder.create().build(); - onInvokeReturns(serviceInvoker, response); - onInvokerThrows(timeoutInvoker); - for (int i = 0; i < 50; i++) { - try { - metricsFilter.invoke(serviceInvoker, invocation); - metricsFilter.invoke(timeoutInvoker, invocation); - } catch (RpcException e) { - // ignore - } - } - Protocol protocol = new DubboProtocol(FrameworkModel.defaultModel()); - // using host name might cause connection failure because multiple addresses might be configured to the same - // name! - url = URL.valueOf("dubbo://" + NetUtils.getLocalHost() + ":" + port + "/" + MetricsService.class.getName()); - Invoker invoker = protocol.refer(MetricsService.class, url); - invocation = new RpcInvocation( - "getMetricsByGroup", DemoService.class.getName(), "", new Class[] {String.class}, new Object[] { - DUBBO_GROUP - }); - try { - Thread.sleep(5000); - } catch (Exception e) { - // ignore - } - String resStr = invoker.invoke(invocation).getValue().toString(); - // MetricObject do not have setter, should use gson to parse - List metricObjectList = - new Gson().fromJson(resStr, new TypeToken>() {}.getType()); - Map metricMap = new HashMap<>(); - for (int i = 0; i < metricObjectList.size(); i++) { - MetricObject object = metricObjectList.get(i); - String metric = object.getMetric().substring(object.getMetric().lastIndexOf(".") + 1); - if ((double) object.getValue() > 0.0 && object.getMetricLevel().equals(MetricLevel.MAJOR)) - metricMap.put(metric, object.getValue()); - } - - Assertions.assertEquals(50.0, metricMap.get("success_bucket_count")); - Assertions.assertEquals(50.0, metricMap.get("timeoutError_bucket_count")); - Assertions.assertEquals(100.0, metricMap.get("bucket_count")); - Assertions.assertEquals(100.0 / 5, metricMap.get("qps")); - Assertions.assertEquals(50.0 / 100.0, metricMap.get("success_rate")); - } - - private void testInvokeMetricsMethodService() { - IMetricManager metricManager = MetricManager.getIMetricManager(); - metricManager.clear(); - MetricsFilter metricsFilter = new MetricsFilter(); - metricsFilter.setExtensionAccessor(ApplicationModel.defaultModel()); - Invocation sayNameInvocation = - new RpcInvocation("sayName", DemoService.class.getName(), "", new Class[0], new Object[0]); - Invocation echoInvocation = new RpcInvocation( - "echo", DemoService.class.getName(), "", new Class[] {Integer.class}, new Integer[] {1}); - RpcContext.getServiceContext() - .setRemoteAddress(NetUtils.getLocalHost(), port) - .setLocalAddress(NetUtils.getLocalHost(), 2345); - URL url = getUrl().addParameter(SIDE_KEY, PROVIDER).addParameter(TIMEOUT_KEY, 300); - Invoker serviceInvoker = invokerFunction.apply(url); - Invoker timeoutInvoker = invokerFunction.apply(url); - AppResponse response = AppResponseBuilder.create().build(); - onInvokeReturns(serviceInvoker, response); - onInvokerThrows(timeoutInvoker); - for (int i = 0; i < 50; i++) { - metricsFilter.invoke(serviceInvoker, sayNameInvocation); - metricsFilter.invoke(serviceInvoker, echoInvocation); - try { - metricsFilter.invoke(timeoutInvoker, sayNameInvocation); - } catch (RpcException e) { - // ignore - } - try { - metricsFilter.invoke(timeoutInvoker, echoInvocation); - } catch (RpcException e) { - // ignore - } - } - - Protocol protocol = new DubboProtocol(FrameworkModel.defaultModel()); - // using host name might cause connection failure because multiple addresses might be configured to the same - // name! - url = URL.valueOf("dubbo://" + NetUtils.getLocalHost() + ":" + port + "/" + MetricsService.class.getName()); - Invoker invoker = protocol.refer(MetricsService.class, url); - Invocation invocation = new RpcInvocation( - "getMetricsByGroup", DemoService.class.getName(), "", new Class[] {String.class}, new Object[] { - DUBBO_GROUP - }); - try { - Thread.sleep(15000); - } catch (Exception e) { - // ignore - } - String resStr = invoker.invoke(invocation).getValue().toString(); - List metricObjectList = - new Gson().fromJson(resStr, new TypeToken>() {}.getType()); - Map> methodMetricMap = new HashMap<>(); - for (int i = 0; i < metricObjectList.size(); i++) { - MetricObject object = metricObjectList.get(i); - String service = object.getTags().get("service"); - String method = service + "." + object.getTags().get("method"); - String metric = object.getMetric().substring(object.getMetric().lastIndexOf(".") + 1); - Map map = methodMetricMap.get(method); - if (map == null) { - map = new HashMap(); - methodMetricMap.put(method, map); - } - map.put(metric, object.getValue()); - } - - Assertions.assertEquals( - 50.0, - methodMetricMap - .get("org.apache.dubbo.monitor.dubbo.service.DemoService.void sayName()") - .get("success_bucket_count")); - Assertions.assertEquals( - 50.0, - methodMetricMap - .get("org.apache.dubbo.monitor.dubbo.service.DemoService.void echo(Integer)") - .get("success_bucket_count")); - - Assertions.assertEquals( - 50.0, - methodMetricMap - .get("org.apache.dubbo.monitor.dubbo.service.DemoService.void sayName()") - .get("timeoutError_bucket_count")); - Assertions.assertEquals( - 50.0, - methodMetricMap - .get("org.apache.dubbo.monitor.dubbo.service.DemoService.void echo(Integer)") - .get("timeoutError_bucket_count")); - - Assertions.assertEquals( - 100.0 / 15, - methodMetricMap - .get("org.apache.dubbo.monitor.dubbo.service.DemoService.void sayName()") - .get("qps")); - Assertions.assertEquals( - 100.0 / 15, - methodMetricMap - .get("org.apache.dubbo.monitor.dubbo.service.DemoService.void echo(Integer)") - .get("qps")); - - Assertions.assertEquals( - 50.0 / 100.0, - methodMetricMap - .get("org.apache.dubbo.monitor.dubbo.service.DemoService.void sayName()") - .get("success_rate")); - Assertions.assertEquals( - 50.0 / 100.0, - methodMetricMap - .get("org.apache.dubbo.monitor.dubbo.service.DemoService.void echo(Integer)") - .get("success_rate")); - } -} diff --git a/dubbo-monitor/dubbo-monitor-default/src/test/java/org/apache/dubbo/monitor/dubbo/MockMonitorService.java b/dubbo-monitor/dubbo-monitor-default/src/test/java/org/apache/dubbo/monitor/dubbo/MockMonitorService.java deleted file mode 100644 index ba435e70d190..000000000000 --- a/dubbo-monitor/dubbo-monitor-default/src/test/java/org/apache/dubbo/monitor/dubbo/MockMonitorService.java +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.apache.dubbo.monitor.dubbo; - -import org.apache.dubbo.common.URL; -import org.apache.dubbo.monitor.MonitorService; - -import java.util.List; -import java.util.concurrent.CopyOnWriteArrayList; - -/** - * MockMonitorService - */ -public class MockMonitorService implements MonitorService { - - private List statistics = new CopyOnWriteArrayList<>(); - - public void collect(URL statistics) { - this.statistics.add(statistics); - } - - public List getStatistics() { - return statistics; - } - - public List lookup(URL query) { - return statistics; - } -} diff --git a/dubbo-monitor/dubbo-monitor-default/src/test/java/org/apache/dubbo/monitor/dubbo/StatisticsTest.java b/dubbo-monitor/dubbo-monitor-default/src/test/java/org/apache/dubbo/monitor/dubbo/StatisticsTest.java deleted file mode 100644 index ac4187738240..000000000000 --- a/dubbo-monitor/dubbo-monitor-default/src/test/java/org/apache/dubbo/monitor/dubbo/StatisticsTest.java +++ /dev/null @@ -1,109 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.apache.dubbo.monitor.dubbo; - -import org.apache.dubbo.common.URL; -import org.apache.dubbo.common.URLBuilder; -import org.apache.dubbo.common.url.component.ServiceConfigURL; - -import org.hamcrest.MatcherAssert; -import org.junit.jupiter.api.Test; - -import static org.apache.dubbo.common.constants.CommonConstants.APPLICATION_KEY; -import static org.apache.dubbo.common.constants.CommonConstants.CONSUMER; -import static org.apache.dubbo.common.constants.CommonConstants.DUBBO_PROTOCOL; -import static org.apache.dubbo.common.constants.CommonConstants.GROUP_KEY; -import static org.apache.dubbo.common.constants.CommonConstants.INTERFACE_KEY; -import static org.apache.dubbo.common.constants.CommonConstants.METHOD_KEY; -import static org.apache.dubbo.monitor.Constants.CONCURRENT_KEY; -import static org.apache.dubbo.monitor.Constants.ELAPSED_KEY; -import static org.apache.dubbo.monitor.Constants.FAILURE_KEY; -import static org.apache.dubbo.monitor.Constants.MAX_CONCURRENT_KEY; -import static org.apache.dubbo.monitor.Constants.MAX_ELAPSED_KEY; -import static org.apache.dubbo.monitor.Constants.SUCCESS_KEY; -import static org.hamcrest.MatcherAssert.assertThat; -import static org.hamcrest.Matchers.equalTo; -import static org.hamcrest.Matchers.is; -import static org.hamcrest.Matchers.not; - -class StatisticsTest { - @Test - void testEquals() { - URL statistics = new URLBuilder(DUBBO_PROTOCOL, "10.20.153.10", 0) - .addParameter(APPLICATION_KEY, "morgan") - .addParameter(INTERFACE_KEY, "MemberService") - .addParameter(METHOD_KEY, "findPerson") - .addParameter(CONSUMER, "10.20.153.11") - .addParameter(SUCCESS_KEY, 1) - .addParameter(FAILURE_KEY, 0) - .addParameter(ELAPSED_KEY, 3) - .addParameter(MAX_ELAPSED_KEY, 3) - .addParameter(CONCURRENT_KEY, 1) - .addParameter(MAX_CONCURRENT_KEY, 1) - .build(); - - Statistics statistics1 = new Statistics(statistics); - Statistics statistics2 = new Statistics(statistics); - - MatcherAssert.assertThat(statistics1, equalTo(statistics1)); - MatcherAssert.assertThat(statistics1, equalTo(statistics2)); - - statistics1.setVersion("2"); - MatcherAssert.assertThat(statistics1, not(equalTo(statistics2))); - MatcherAssert.assertThat(statistics1.hashCode(), not(equalTo(statistics2.hashCode()))); - - statistics1.setMethod("anotherMethod"); - MatcherAssert.assertThat(statistics1, not(equalTo(statistics2))); - MatcherAssert.assertThat(statistics1.hashCode(), not(equalTo(statistics2.hashCode()))); - - statistics1.setClient("anotherClient"); - MatcherAssert.assertThat(statistics1, not(equalTo(statistics2))); - MatcherAssert.assertThat(statistics1.hashCode(), not(equalTo(statistics2.hashCode()))); - } - - @Test - void testToString() { - Statistics statistics = new Statistics(new ServiceConfigURL("dubbo", "10.20.153.10", 0)); - statistics.setApplication("demo"); - statistics.setMethod("findPerson"); - statistics.setServer("10.20.153.10"); - statistics.setGroup("unit-test"); - statistics.setService("MemberService"); - assertThat(statistics.toString(), is("dubbo://10.20.153.10")); - - Statistics statisticsWithDetailInfo = new Statistics(new URLBuilder(DUBBO_PROTOCOL, "10.20.153.10", 0) - .addParameter(APPLICATION_KEY, "morgan") - .addParameter(INTERFACE_KEY, "MemberService") - .addParameter(METHOD_KEY, "findPerson") - .addParameter(CONSUMER, "10.20.153.11") - .addParameter(GROUP_KEY, "unit-test") - .addParameter(SUCCESS_KEY, 1) - .addParameter(FAILURE_KEY, 0) - .addParameter(ELAPSED_KEY, 3) - .addParameter(MAX_ELAPSED_KEY, 3) - .addParameter(CONCURRENT_KEY, 1) - .addParameter(MAX_CONCURRENT_KEY, 1) - .build()); - - MatcherAssert.assertThat(statisticsWithDetailInfo.getServer(), equalTo(statistics.getServer())); - MatcherAssert.assertThat(statisticsWithDetailInfo.getService(), equalTo(statistics.getService())); - MatcherAssert.assertThat(statisticsWithDetailInfo.getMethod(), equalTo(statistics.getMethod())); - - MatcherAssert.assertThat(statisticsWithDetailInfo.getGroup(), equalTo(statistics.getGroup())); - MatcherAssert.assertThat(statisticsWithDetailInfo, not(equalTo(statistics))); - } -} diff --git a/dubbo-monitor/dubbo-monitor-default/src/test/java/org/apache/dubbo/monitor/dubbo/service/DemoService.java b/dubbo-monitor/dubbo-monitor-default/src/test/java/org/apache/dubbo/monitor/dubbo/service/DemoService.java deleted file mode 100644 index ac0e13c81d7d..000000000000 --- a/dubbo-monitor/dubbo-monitor-default/src/test/java/org/apache/dubbo/monitor/dubbo/service/DemoService.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.apache.dubbo.monitor.dubbo.service; - -public interface DemoService { - - String sayName(String name); - - void timeoutException(); - - void throwDemoException() throws Exception; - - int echo(int i); -} diff --git a/dubbo-monitor/dubbo-monitor-default/src/test/resources/dubbo.properties b/dubbo-monitor/dubbo-monitor-default/src/test/resources/dubbo.properties deleted file mode 100644 index 1aade88a5619..000000000000 --- a/dubbo-monitor/dubbo-monitor-default/src/test/resources/dubbo.properties +++ /dev/null @@ -1,2 +0,0 @@ -dubbo.application.enable-file-cache=false -dubbo.service.shutdown.wait=200 diff --git a/dubbo-monitor/dubbo-monitor-default/src/test/resources/log4j2-test.xml b/dubbo-monitor/dubbo-monitor-default/src/test/resources/log4j2-test.xml deleted file mode 100644 index ba99f52cc2d2..000000000000 --- a/dubbo-monitor/dubbo-monitor-default/src/test/resources/log4j2-test.xml +++ /dev/null @@ -1,29 +0,0 @@ - - - - - - - - - - - - - - diff --git a/dubbo-monitor/pom.xml b/dubbo-monitor/pom.xml deleted file mode 100644 index e859ef6bad60..000000000000 --- a/dubbo-monitor/pom.xml +++ /dev/null @@ -1,48 +0,0 @@ - - - - 4.0.0 - - org.apache.dubbo - dubbo-parent - ${revision} - ../pom.xml - - dubbo-monitor - pom - ${project.artifactId} - The monitor module of dubbo project - - dubbo-monitor-api - dubbo-monitor-common - dubbo-monitor-default - - - false - - - - - org.apache.dubbo - dubbo-test-check - ${project.parent.version} - test - - - - diff --git a/dubbo-test/dubbo-dependencies-all/pom.xml b/dubbo-test/dubbo-dependencies-all/pom.xml index 251efa12a13f..d25a9ccaa1f8 100644 --- a/dubbo-test/dubbo-dependencies-all/pom.xml +++ b/dubbo-test/dubbo-dependencies-all/pom.xml @@ -213,22 +213,6 @@ ${project.version} - - - org.apache.dubbo - dubbo-monitor-api - ${project.version} - - - org.apache.dubbo - dubbo-monitor-common - ${project.version} - - - org.apache.dubbo - dubbo-monitor-default - ${project.version} - org.apache.dubbo diff --git a/pom.xml b/pom.xml index 2391d78eb139..5ef454d3c610 100644 --- a/pom.xml +++ b/pom.xml @@ -81,7 +81,6 @@ dubbo-rpc dubbo-cluster dubbo-registry - dubbo-monitor dubbo-config dubbo-demo dubbo-plugin