You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@servicecomb.apache.org by wu...@apache.org on 2018/04/12 00:36:45 UTC

[incubator-servicecomb-java-chassis] branch master updated (4f8f810 -> 6f66e26)

This is an automated email from the ASF dual-hosted git repository.

wujimin pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-servicecomb-java-chassis.git.


    from 4f8f810  SCB-422 prometheus switch to new mechanism
     new 7b75150  SCB-445 delete old metrics mechanism
     new 99ac3b7  SCB-445 delete old performance stat mechanism
     new 56391cd  SCB-445 fix indent problem
     new 6f66e26  SCB-445 remove useless dependence

The 4 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 core/pom.xml                                       |   4 -
 .../org/apache/servicecomb/core/Invocation.java    |  30 --
 .../core/metrics/InvocationFinishedEvent.java      |  68 -----
 .../metrics/InvocationStartExecutionEvent.java     |  30 --
 .../core/metrics/InvocationStartedEvent.java       |  46 ---
 .../servicecomb/foundation/metrics/Metrics.java    |  81 ------
 .../foundation/metrics/MetricsConfig.java          |  46 ---
 .../foundation/metrics/MetricsConst.java           |  44 ---
 .../foundation/metrics/MetricsThread.java          |  68 -----
 .../foundation/metrics/performance/PerfResult.java |  93 ------
 .../foundation/metrics/performance/PerfStat.java   |  37 ---
 .../metrics/performance/PerfStatContext.java       |  52 ----
 .../metrics/performance/PerfStatData.java          | 161 -----------
 .../metrics/performance/PerfStatImpl.java          |  91 ------
 .../metrics/performance/PerfStatMonitor.java       |  91 ------
 .../metrics/performance/PerfStatMonitorMgr.java    |  83 ------
 .../metrics/performance/PerfStatSuccFail.java      |  50 ----
 .../foundation/metrics/publish/Metric.java         | 131 ---------
 .../foundation/metrics/publish/MetricNode.java     | 145 ----------
 .../foundation/metrics/publish/MetricsLoader.java  |  62 ----
 .../resources/META-INF/spring/metrics.bean.xml     |  27 --
 .../foundation/metrics/TestMetrics.java            |  35 ---
 .../foundation/metrics/TestMetricsThread.java      |  47 ---
 .../metrics/performance/TestPerfResult.java        |  70 -----
 .../metrics/performance/TestPerfStatContext.java   |  68 -----
 .../metrics/performance/TestPerfStatData.java      |  83 ------
 .../metrics/performance/TestPerfStatImpl.java      |  70 -----
 .../metrics/performance/TestPerfStatMonitor.java   |  56 ----
 .../performance/TestPerfStatMonitorMgr.java        |  68 -----
 .../metrics/performance/TestPerfStatSuccFail.java  |  48 ---
 .../foundation/metrics/publish/TestMetric.java     | 118 --------
 .../foundation/metrics/publish/TestMetricNode.java | 109 -------
 .../metrics/publish/TestMetricsLoader.java         |  69 -----
 java-chassis-dependencies/pom.xml                  |  12 +-
 .../metrics/core/AbstractInvocationMetrics.java    |  73 -----
 .../metrics/core/ConsumerInvocationMetrics.java    |  33 ---
 .../metrics/core/InvocationMetricsManager.java     |  85 ------
 .../servicecomb/metrics/core/MetricsConfig.java    |  22 --
 .../servicecomb/metrics/core/MonitorManager.java   | 217 --------------
 .../metrics/core/ProducerInvocationMetrics.java    |  37 ---
 .../event/InvocationFinishedEventListener.java     |  41 ---
 .../InvocationStartExecutionEventListener.java     |  34 ---
 .../core/event/InvocationStartedEventListener.java |  37 ---
 .../metrics/core/TestAnMonitorManager.java         | 321 ---------------------
 .../async/CseAsyncRequestCallbackTest.java         |   2 +-
 45 files changed, 7 insertions(+), 3188 deletions(-)
 delete mode 100644 core/src/main/java/org/apache/servicecomb/core/metrics/InvocationFinishedEvent.java
 delete mode 100644 core/src/main/java/org/apache/servicecomb/core/metrics/InvocationStartExecutionEvent.java
 delete mode 100644 core/src/main/java/org/apache/servicecomb/core/metrics/InvocationStartedEvent.java
 delete mode 100644 foundations/foundation-metrics/src/main/java/org/apache/servicecomb/foundation/metrics/Metrics.java
 delete mode 100644 foundations/foundation-metrics/src/main/java/org/apache/servicecomb/foundation/metrics/MetricsConfig.java
 delete mode 100644 foundations/foundation-metrics/src/main/java/org/apache/servicecomb/foundation/metrics/MetricsConst.java
 delete mode 100644 foundations/foundation-metrics/src/main/java/org/apache/servicecomb/foundation/metrics/MetricsThread.java
 delete mode 100644 foundations/foundation-metrics/src/main/java/org/apache/servicecomb/foundation/metrics/performance/PerfResult.java
 delete mode 100644 foundations/foundation-metrics/src/main/java/org/apache/servicecomb/foundation/metrics/performance/PerfStat.java
 delete mode 100644 foundations/foundation-metrics/src/main/java/org/apache/servicecomb/foundation/metrics/performance/PerfStatContext.java
 delete mode 100644 foundations/foundation-metrics/src/main/java/org/apache/servicecomb/foundation/metrics/performance/PerfStatData.java
 delete mode 100644 foundations/foundation-metrics/src/main/java/org/apache/servicecomb/foundation/metrics/performance/PerfStatImpl.java
 delete mode 100644 foundations/foundation-metrics/src/main/java/org/apache/servicecomb/foundation/metrics/performance/PerfStatMonitor.java
 delete mode 100644 foundations/foundation-metrics/src/main/java/org/apache/servicecomb/foundation/metrics/performance/PerfStatMonitorMgr.java
 delete mode 100644 foundations/foundation-metrics/src/main/java/org/apache/servicecomb/foundation/metrics/performance/PerfStatSuccFail.java
 delete mode 100644 foundations/foundation-metrics/src/main/java/org/apache/servicecomb/foundation/metrics/publish/Metric.java
 delete mode 100644 foundations/foundation-metrics/src/main/java/org/apache/servicecomb/foundation/metrics/publish/MetricNode.java
 delete mode 100644 foundations/foundation-metrics/src/main/java/org/apache/servicecomb/foundation/metrics/publish/MetricsLoader.java
 delete mode 100644 foundations/foundation-metrics/src/main/resources/META-INF/spring/metrics.bean.xml
 delete mode 100644 foundations/foundation-metrics/src/test/java/org/apache/servicecomb/foundation/metrics/TestMetrics.java
 delete mode 100644 foundations/foundation-metrics/src/test/java/org/apache/servicecomb/foundation/metrics/TestMetricsThread.java
 delete mode 100644 foundations/foundation-metrics/src/test/java/org/apache/servicecomb/foundation/metrics/performance/TestPerfResult.java
 delete mode 100644 foundations/foundation-metrics/src/test/java/org/apache/servicecomb/foundation/metrics/performance/TestPerfStatContext.java
 delete mode 100644 foundations/foundation-metrics/src/test/java/org/apache/servicecomb/foundation/metrics/performance/TestPerfStatData.java
 delete mode 100644 foundations/foundation-metrics/src/test/java/org/apache/servicecomb/foundation/metrics/performance/TestPerfStatImpl.java
 delete mode 100644 foundations/foundation-metrics/src/test/java/org/apache/servicecomb/foundation/metrics/performance/TestPerfStatMonitor.java
 delete mode 100644 foundations/foundation-metrics/src/test/java/org/apache/servicecomb/foundation/metrics/performance/TestPerfStatMonitorMgr.java
 delete mode 100644 foundations/foundation-metrics/src/test/java/org/apache/servicecomb/foundation/metrics/performance/TestPerfStatSuccFail.java
 delete mode 100644 foundations/foundation-metrics/src/test/java/org/apache/servicecomb/foundation/metrics/publish/TestMetric.java
 delete mode 100644 foundations/foundation-metrics/src/test/java/org/apache/servicecomb/foundation/metrics/publish/TestMetricNode.java
 delete mode 100644 foundations/foundation-metrics/src/test/java/org/apache/servicecomb/foundation/metrics/publish/TestMetricsLoader.java
 delete mode 100644 metrics/metrics-core/src/main/java/org/apache/servicecomb/metrics/core/AbstractInvocationMetrics.java
 delete mode 100644 metrics/metrics-core/src/main/java/org/apache/servicecomb/metrics/core/ConsumerInvocationMetrics.java
 delete mode 100644 metrics/metrics-core/src/main/java/org/apache/servicecomb/metrics/core/InvocationMetricsManager.java
 delete mode 100644 metrics/metrics-core/src/main/java/org/apache/servicecomb/metrics/core/MetricsConfig.java
 delete mode 100644 metrics/metrics-core/src/main/java/org/apache/servicecomb/metrics/core/MonitorManager.java
 delete mode 100644 metrics/metrics-core/src/main/java/org/apache/servicecomb/metrics/core/ProducerInvocationMetrics.java
 delete mode 100644 metrics/metrics-core/src/main/java/org/apache/servicecomb/metrics/core/event/InvocationFinishedEventListener.java
 delete mode 100644 metrics/metrics-core/src/main/java/org/apache/servicecomb/metrics/core/event/InvocationStartExecutionEventListener.java
 delete mode 100644 metrics/metrics-core/src/main/java/org/apache/servicecomb/metrics/core/event/InvocationStartedEventListener.java
 delete mode 100644 metrics/metrics-core/src/test/java/org/apache/servicecomb/metrics/core/TestAnMonitorManager.java

-- 
To stop receiving notification emails like this one, please contact
wujimin@apache.org.

[incubator-servicecomb-java-chassis] 03/04: SCB-445 fix indent problem

Posted by wu...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

wujimin pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-servicecomb-java-chassis.git

commit 56391cd0d25c9be9af3b42895254bf48b06f7dd2
Author: wujimin <wu...@huawei.com>
AuthorDate: Tue Apr 10 21:47:25 2018 +0800

    SCB-445 fix indent problem
---
 java-chassis-dependencies/pom.xml                            | 12 ++++++------
 .../reference/async/CseAsyncRequestCallbackTest.java         |  2 +-
 2 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/java-chassis-dependencies/pom.xml b/java-chassis-dependencies/pom.xml
index b9ab059..95bb502 100644
--- a/java-chassis-dependencies/pom.xml
+++ b/java-chassis-dependencies/pom.xml
@@ -246,7 +246,7 @@
         <groupId>io.netty</groupId>
         <artifactId>netty-tcnative-boringssl-static</artifactId>
         <version>${tcnetty.version}</version>
-      </dependency>      
+      </dependency>
       <dependency>
         <groupId>org.powermock</groupId>
         <artifactId>powermock-api-mockito</artifactId>
@@ -756,16 +756,16 @@
       </dependency>
       <dependency>
         <groupId>org.apache.servicecomb</groupId>
-	<artifactId>config-cc</artifactId>
-	<version>1.0.0-m2-SNAPSHOT</version>
-	</dependency>
+        <artifactId>config-cc</artifactId>
+        <version>1.0.0-m2-SNAPSHOT</version>
+      </dependency>
       <dependency>
         <groupId>org.apache.servicecomb</groupId>
         <artifactId>config-apollo</artifactId>
         <version>1.0.0-m2-SNAPSHOT</version>
       </dependency>
-	<dependency>
-	<groupId>org.apache.servicecomb</groupId>
+      <dependency>
+        <groupId>org.apache.servicecomb</groupId>
         <artifactId>foundation-vertx</artifactId>
         <version>1.0.0-m2-SNAPSHOT</version>
       </dependency>
diff --git a/providers/provider-springmvc/src/test/java/org/apache/servicecomb/provider/springmvc/reference/async/CseAsyncRequestCallbackTest.java b/providers/provider-springmvc/src/test/java/org/apache/servicecomb/provider/springmvc/reference/async/CseAsyncRequestCallbackTest.java
index 4e906e3..daefd3a 100644
--- a/providers/provider-springmvc/src/test/java/org/apache/servicecomb/provider/springmvc/reference/async/CseAsyncRequestCallbackTest.java
+++ b/providers/provider-springmvc/src/test/java/org/apache/servicecomb/provider/springmvc/reference/async/CseAsyncRequestCallbackTest.java
@@ -45,7 +45,7 @@ public class CseAsyncRequestCallbackTest {
   public void testCseEntity(@Injectable CseHttpEntity<String> entity) {
     CseAsyncClientHttpRequest request = new CseAsyncClientHttpRequest();
     entity.addContext("c1", "c2");
-	  CseAsyncRequestCallback<String> cb = new CseAsyncRequestCallback<>(entity);
+    CseAsyncRequestCallback<String> cb = new CseAsyncRequestCallback<>(entity);
     cb.doWithRequest(request);
     Assert.assertEquals(entity.getContext(), request.getContext());
   }

-- 
To stop receiving notification emails like this one, please contact
wujimin@apache.org.

[incubator-servicecomb-java-chassis] 02/04: SCB-445 delete old performance stat mechanism

Posted by wu...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

wujimin pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-servicecomb-java-chassis.git

commit 99ac3b75b5d02f7c5464ed737be0c2fcac4b7d77
Author: wujimin <wu...@huawei.com>
AuthorDate: Wed Apr 4 17:05:32 2018 +0800

    SCB-445 delete old performance stat mechanism
---
 .../servicecomb/foundation/metrics/Metrics.java    |  81 -----------
 .../foundation/metrics/MetricsConfig.java          |  46 ------
 .../foundation/metrics/MetricsThread.java          |  68 ---------
 .../foundation/metrics/performance/PerfResult.java |  93 ------------
 .../foundation/metrics/performance/PerfStat.java   |  37 -----
 .../metrics/performance/PerfStatContext.java       |  52 -------
 .../metrics/performance/PerfStatData.java          | 161 ---------------------
 .../metrics/performance/PerfStatImpl.java          |  91 ------------
 .../metrics/performance/PerfStatMonitor.java       |  91 ------------
 .../metrics/performance/PerfStatMonitorMgr.java    |  83 -----------
 .../metrics/performance/PerfStatSuccFail.java      |  50 -------
 .../resources/META-INF/spring/metrics.bean.xml     |  27 ----
 .../foundation/metrics/TestMetrics.java            |  35 -----
 .../foundation/metrics/TestMetricsThread.java      |  47 ------
 .../metrics/performance/TestPerfResult.java        |  70 ---------
 .../metrics/performance/TestPerfStatContext.java   |  68 ---------
 .../metrics/performance/TestPerfStatData.java      |  83 -----------
 .../metrics/performance/TestPerfStatImpl.java      |  70 ---------
 .../metrics/performance/TestPerfStatMonitor.java   |  56 -------
 .../performance/TestPerfStatMonitorMgr.java        |  68 ---------
 .../metrics/performance/TestPerfStatSuccFail.java  |  48 ------
 21 files changed, 1425 deletions(-)

diff --git a/foundations/foundation-metrics/src/main/java/org/apache/servicecomb/foundation/metrics/Metrics.java b/foundations/foundation-metrics/src/main/java/org/apache/servicecomb/foundation/metrics/Metrics.java
deleted file mode 100644
index ae7a47f..0000000
--- a/foundations/foundation-metrics/src/main/java/org/apache/servicecomb/foundation/metrics/Metrics.java
+++ /dev/null
@@ -1,81 +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.servicecomb.foundation.metrics;
-
-import java.util.HashMap;
-import java.util.Map;
-
-import org.apache.servicecomb.foundation.common.CommonThread;
-import org.apache.servicecomb.foundation.metrics.performance.PerfStat;
-import org.apache.servicecomb.foundation.metrics.performance.PerfStatMonitorMgr;
-import org.apache.servicecomb.foundation.metrics.performance.PerfStatSuccFail;
-
-/**
- * Metrics
- * core layer performance logger
- *
- */
-public class Metrics extends CommonThread {
-  // 每个线程只在本线程内部做统计,不涉及多线程并发
-  // 每个周期,统计线程会对所有线程做一次汇总,并与前一周期结果做对比,得出本周期的统计数据
-  protected static final ThreadLocal<Map<String, PerfStatSuccFail>> LOCAL_PERF_STAT_MAP = new ThreadLocal<>();
-
-  private static PerfStatMonitorMgr perfMonitorMgr = new PerfStatMonitorMgr();
-
-  public static void onCycle() throws Exception {
-    long msNow = System.currentTimeMillis();
-
-    synchronized (perfMonitorMgr) {
-      perfMonitorMgr.onCycle(msNow, MetricsConfig.getMsCycle());
-    }
-  }
-
-  public static long getMsTick() {
-    return MetricsThread.getMsTick();
-  }
-
-  public static void registerPerfStat(PerfStat perfStat, int index) {
-    synchronized (perfMonitorMgr) {
-      perfMonitorMgr.registerPerfStat(perfStat, index);
-    }
-  }
-
-  public static PerfStatSuccFail getOrCreateLocalPerfStat(String name, int index) {
-    Map<String, PerfStatSuccFail> map = LOCAL_PERF_STAT_MAP.get();
-    if (map == null) {
-      map = new HashMap<>();
-      LOCAL_PERF_STAT_MAP.set(map);
-    }
-
-    PerfStatSuccFail perfStat = map.get(name);
-    if (perfStat == null) {
-      perfStat = new PerfStatSuccFail(name);
-      map.put(name, perfStat);
-
-      registerPerfStat(perfStat, index);
-    }
-
-    return perfStat;
-  }
-
-  public static Map<String, PerfStat> getMonitorPerfStat() {
-    synchronized (perfMonitorMgr) {
-      return perfMonitorMgr.getMonitorPerfStat();
-    }
-  }
-}
diff --git a/foundations/foundation-metrics/src/main/java/org/apache/servicecomb/foundation/metrics/MetricsConfig.java b/foundations/foundation-metrics/src/main/java/org/apache/servicecomb/foundation/metrics/MetricsConfig.java
deleted file mode 100644
index 3787434..0000000
--- a/foundations/foundation-metrics/src/main/java/org/apache/servicecomb/foundation/metrics/MetricsConfig.java
+++ /dev/null
@@ -1,46 +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.servicecomb.foundation.metrics;
-
-import org.springframework.beans.factory.InitializingBean;
-
-import com.netflix.config.DynamicPropertyFactory;
-
-public class MetricsConfig implements InitializingBean {
-
-  private static final int DEFAULT_METRICS_CYCLE = 60000;
-
-  public static int getMsCycle() {
-    return DynamicPropertyFactory.getInstance()
-        .getIntProperty("cse.metrics.cycle.ms", DEFAULT_METRICS_CYCLE)
-        .get();
-  }
-
-  public static boolean isEnable() {
-    return DynamicPropertyFactory.getInstance().getBooleanProperty("cse.metrics.enabled", false).get();
-  }
-
-  @Override
-  public void afterPropertiesSet() throws Exception {
-    if (!isEnable()) {
-      return;
-    }
-
-    new MetricsThread().start();
-  }
-}
diff --git a/foundations/foundation-metrics/src/main/java/org/apache/servicecomb/foundation/metrics/MetricsThread.java b/foundations/foundation-metrics/src/main/java/org/apache/servicecomb/foundation/metrics/MetricsThread.java
deleted file mode 100644
index a1e7c39..0000000
--- a/foundations/foundation-metrics/src/main/java/org/apache/servicecomb/foundation/metrics/MetricsThread.java
+++ /dev/null
@@ -1,68 +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.servicecomb.foundation.metrics;
-
-import org.apache.servicecomb.foundation.common.CommonThread;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-public class MetricsThread extends CommonThread {
-  private static final Logger LOGGER = LoggerFactory.getLogger(MetricsThread.class);
-
-  private static final long SECOND_MILLS = 1000;
-
-  // 从进程启动开始,每秒加1000
-  // 这不是一个精确值,用于不关注精度的超时检测
-  private static long msTick = 0;
-
-  public MetricsThread() {
-    setName("metrics");
-  }
-
-  @Override
-  public void run() {
-    while (isRunning()) {
-      waitOneCycle();
-
-      try {
-        Metrics.onCycle();
-      } catch (Exception e) {
-        LOGGER.info(e.getMessage());
-      }
-    }
-  }
-
-  private void waitOneCycle() {
-    long msLastCycle = msTick;
-    for (;;) {
-      try {
-        sleep(SECOND_MILLS);
-      } catch (InterruptedException e) {
-      }
-      msTick += SECOND_MILLS;
-
-      if (msTick - msLastCycle >= MetricsConfig.getMsCycle()) {
-        break;
-      }
-    }
-  }
-
-  public static long getMsTick() {
-    return msTick;
-  }
-}
diff --git a/foundations/foundation-metrics/src/main/java/org/apache/servicecomb/foundation/metrics/performance/PerfResult.java b/foundations/foundation-metrics/src/main/java/org/apache/servicecomb/foundation/metrics/performance/PerfResult.java
deleted file mode 100644
index bc91ae4..0000000
--- a/foundations/foundation-metrics/src/main/java/org/apache/servicecomb/foundation/metrics/performance/PerfResult.java
+++ /dev/null
@@ -1,93 +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.servicecomb.foundation.metrics.performance;
-
-/**
- * PerfResult
- *
- *
- */
-public class PerfResult {
-  private String name;
-
-  private long callCount;
-
-  private long msgCount;
-
-  private long avgCallCount;
-
-  private double msAvgLatency;
-
-  private long[] msLatencySegments;
-
-  public String getName() {
-    return name;
-  }
-
-  public void setName(String name) {
-    this.name = name;
-  }
-
-  public long getCallCount() {
-    return callCount;
-  }
-
-  public void setCallCount(long callCount) {
-    this.callCount = callCount;
-  }
-
-  public long getMsgCount() {
-    return msgCount;
-  }
-
-  public void setMsgCount(long msgCount) {
-    this.msgCount = msgCount;
-  }
-
-  public long getAvgCallCount() {
-    return avgCallCount;
-  }
-
-  public void setAvgCallCount(long avgCallCount) {
-    this.avgCallCount = avgCallCount;
-  }
-
-  public double getMsAvgLatency() {
-    return msAvgLatency;
-  }
-
-  public void setMsAvgLatency(double msAvgLatency) {
-    this.msAvgLatency = msAvgLatency;
-  }
-
-  public long[] getMsLatencySegments() {
-    return msLatencySegments;
-  }
-
-  public void setMsLatencySegments(long[] msLatencySegments) {
-    this.msLatencySegments = msLatencySegments;
-  }
-
-  public String segmentsToString(String fmt) {
-    StringBuilder sb = new StringBuilder();
-    for (long segCount : msLatencySegments) {
-      sb.append(String.format(fmt, segCount));
-    }
-    return sb.toString();
-  }
-}
diff --git a/foundations/foundation-metrics/src/main/java/org/apache/servicecomb/foundation/metrics/performance/PerfStat.java b/foundations/foundation-metrics/src/main/java/org/apache/servicecomb/foundation/metrics/performance/PerfStat.java
deleted file mode 100644
index df999a3..0000000
--- a/foundations/foundation-metrics/src/main/java/org/apache/servicecomb/foundation/metrics/performance/PerfStat.java
+++ /dev/null
@@ -1,37 +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.servicecomb.foundation.metrics.performance;
-
-import java.util.List;
-
-/**
- * PerfStat
- *
- *
- */
-public interface PerfStat {
-  String getName();
-
-  List<PerfStatData> getPerfStatDataList();
-
-  void mergeFrom(PerfStat otherPerfStat);
-
-  void calc(long msNow, List<PerfResult> perfResultList);
-
-  void calc(PerfStat lastCycle, long msCycle, List<PerfResult> perfResultList);
-}
diff --git a/foundations/foundation-metrics/src/main/java/org/apache/servicecomb/foundation/metrics/performance/PerfStatContext.java b/foundations/foundation-metrics/src/main/java/org/apache/servicecomb/foundation/metrics/performance/PerfStatContext.java
deleted file mode 100644
index 68d9f72..0000000
--- a/foundations/foundation-metrics/src/main/java/org/apache/servicecomb/foundation/metrics/performance/PerfStatContext.java
+++ /dev/null
@@ -1,52 +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.servicecomb.foundation.metrics.performance;
-
-/**
- * PerfStatContext
- *
- *
- */
-public class PerfStatContext {
-  // 调用开始时间,用于统计
-  protected long callBegin;
-
-  // 本次统计涉及消息数量
-  private int msgCount;
-
-  public PerfStatContext() {
-    reset();
-  }
-
-  public long getLatency() {
-    return System.currentTimeMillis() - callBegin;
-  }
-
-  public int getMsgCount() {
-    return msgCount;
-  }
-
-  public void setMsgCount(int msgCount) {
-    this.msgCount = msgCount;
-  }
-
-  public void reset() {
-    callBegin = System.currentTimeMillis();
-    msgCount = 0;
-  }
-}
diff --git a/foundations/foundation-metrics/src/main/java/org/apache/servicecomb/foundation/metrics/performance/PerfStatData.java b/foundations/foundation-metrics/src/main/java/org/apache/servicecomb/foundation/metrics/performance/PerfStatData.java
deleted file mode 100644
index 53c28bf..0000000
--- a/foundations/foundation-metrics/src/main/java/org/apache/servicecomb/foundation/metrics/performance/PerfStatData.java
+++ /dev/null
@@ -1,161 +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.servicecomb.foundation.metrics.performance;
-
-import java.util.Arrays;
-
-/**
- * PerfStatData
- *
- *
- */
-public class PerfStatData {
-  private static long processBegin = System.currentTimeMillis();
-
-  private static long[] segmentDef;
-
-  private static final long[] SEGMENT_BOUNDRYS = new long[] {20, 100, 300, 500};
-
-  static {
-    setSegmentDef(SEGMENT_BOUNDRYS);
-  }
-
-  //CodeDEX 不允许public static 非final的成员
-  private static String strSegmentDef;
-
-  private String name;
-
-  private long callCount;
-
-  private long msgCount;
-
-  private long msLatency;
-
-  private long[] msLatencySegments;
-
-  private static final int MILLI_COUNT_IN_SECOND = 1000;
-
-  public PerfStatData(String name) {
-    msLatencySegments = new long[segmentDef.length + 1];
-    this.name = name;
-  }
-
-  public static void setSegmentDef(long[] segmentDef) {
-    PerfStatData.segmentDef = segmentDef;
-
-    StringBuilder sb = new StringBuilder();
-    long last = 0;
-    for (long def : segmentDef) {
-      sb.append(String.format("%-10s", String.format("[%d,%d)", last, def)));
-      last = def;
-    }
-    sb.append(String.format("%-10s", String.format("[%d,...)", last)));
-    strSegmentDef = sb.toString();
-  }
-
-  public static String getStrSegmentDef() {
-    return strSegmentDef;
-  }
-
-  public String getName() {
-    return name;
-  }
-
-  public long getCallCount() {
-    return callCount;
-  }
-
-  public long getMsgCount() {
-    return msgCount;
-  }
-
-  public long getMsLatency() {
-    return msLatency;
-  }
-
-  public long[] getMsLatencySegments() {
-    return msLatencySegments;
-  }
-
-  protected int findSegmentIdx(long latency) {
-    long lastDef = 0;
-    for (int idx = 0; idx < segmentDef.length; idx++) {
-      long def = segmentDef[idx];
-      if (latency >= lastDef && latency < def) {
-        return idx;
-      }
-
-      lastDef = def;
-    }
-
-    return segmentDef.length;
-  }
-
-  public void add(int count, long latency) {
-    this.callCount++;
-    this.msgCount += count;
-    this.msLatency += latency;
-
-    int segmentIdx = findSegmentIdx(latency);
-    this.msLatencySegments[segmentIdx]++;
-  }
-
-  public void add(PerfStatContext context) {
-    add(context.getMsgCount(), context.getLatency());
-  }
-
-  public void mergeFrom(PerfStatData other) {
-    callCount += other.callCount;
-    msgCount += other.msgCount;
-    msLatency += other.msLatency;
-    for (int idx = 0; idx < msLatencySegments.length; idx++) {
-      msLatencySegments[idx] += other.msLatencySegments[idx];
-    }
-  }
-
-  public PerfResult calc(long msNow) {
-    PerfResult perf = new PerfResult();
-    perf.setName("  all " + name + "  :");
-    perf.setCallCount(callCount);
-    perf.setMsgCount(msgCount);
-    perf.setAvgCallCount(
-        callCount * MILLI_COUNT_IN_SECOND / (msNow - processBegin > 0 ? msNow - processBegin : 1));
-    perf.setMsAvgLatency((callCount != 0) ? (double) msLatency / callCount : 0);
-    perf.setMsLatencySegments(msLatencySegments);
-    return perf;
-  }
-
-  public PerfResult calc(PerfStatData lastCycle, long msCycle) {
-    PerfResult perf = new PerfResult();
-
-    long diffCount = callCount - lastCycle.callCount;
-    perf.setName("  cycle " + name + ":");
-    perf.setCallCount(diffCount);
-    perf.setMsgCount(msgCount - lastCycle.msgCount);
-    perf.setAvgCallCount(diffCount * MILLI_COUNT_IN_SECOND / msCycle);
-    perf.setMsAvgLatency((diffCount != 0) ? (double) (msLatency - lastCycle.msLatency) / diffCount : 0);
-
-    long[] clone = Arrays.copyOf(msLatencySegments, msLatencySegments.length);
-    long[] lastCycleSegments = lastCycle.getMsLatencySegments();
-    for (int idx = 0; idx < clone.length; idx++) {
-      clone[idx] -= lastCycleSegments[idx];
-    }
-    perf.setMsLatencySegments(clone);
-    return perf;
-  }
-}
diff --git a/foundations/foundation-metrics/src/main/java/org/apache/servicecomb/foundation/metrics/performance/PerfStatImpl.java b/foundations/foundation-metrics/src/main/java/org/apache/servicecomb/foundation/metrics/performance/PerfStatImpl.java
deleted file mode 100644
index 1ba26b1..0000000
--- a/foundations/foundation-metrics/src/main/java/org/apache/servicecomb/foundation/metrics/performance/PerfStatImpl.java
+++ /dev/null
@@ -1,91 +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.servicecomb.foundation.metrics.performance;
-
-import java.util.ArrayList;
-import java.util.List;
-
-/**
- * PerfStatImpl
- *
- *
- */
-public class PerfStatImpl implements PerfStat {
-  // 接口或是场景名称
-  private String name;
-
-  private List<PerfStatData> dataList = new ArrayList<>();
-
-  public PerfStatImpl(String name) {
-    this.name = name;
-  }
-
-  public PerfStatImpl(String name, PerfStatData data) {
-    this.name = name;
-    addPerfStatData(data);
-  }
-
-  public void addPerfStatData(PerfStatData data) {
-    dataList.add(data);
-  }
-
-  @Override
-  public String getName() {
-    return name;
-  }
-
-  @Override
-  public List<PerfStatData> getPerfStatDataList() {
-    return dataList;
-  }
-
-  @Override
-  public void mergeFrom(PerfStat otherPerfStat) {
-    name = otherPerfStat.getName();
-    List<PerfStatData> otherDataList = otherPerfStat.getPerfStatDataList();
-    if (dataList.isEmpty()) {
-      otherDataList.forEach(otherData -> dataList.add(new PerfStatData(otherData.getName())));
-    }
-
-    for (int idx = 0; idx < otherDataList.size(); idx++) {
-      dataList.get(idx).mergeFrom(otherDataList.get(idx));
-    }
-  }
-
-  @Override
-  public void calc(long msNow, List<PerfResult> perfResultList) {
-    for (PerfStatData data : dataList) {
-      perfResultList.add(data.calc(msNow));
-    }
-  }
-
-  @Override
-  public void calc(PerfStat lastCycle, long msCycle, List<PerfResult> perfResultList) {
-    if (lastCycle == null) {
-      return;
-    }
-
-    List<PerfStatData> lastCycleDataList = lastCycle.getPerfStatDataList();
-    for (int idx = 0; idx < dataList.size(); idx++) {
-      PerfStatData data = dataList.get(idx);
-      PerfStatData lastCycleData = lastCycleDataList.get(idx);
-
-      perfResultList.add(data.calc(lastCycleData, msCycle));
-    }
-  }
-}
diff --git a/foundations/foundation-metrics/src/main/java/org/apache/servicecomb/foundation/metrics/performance/PerfStatMonitor.java b/foundations/foundation-metrics/src/main/java/org/apache/servicecomb/foundation/metrics/performance/PerfStatMonitor.java
deleted file mode 100644
index 33b575a..0000000
--- a/foundations/foundation-metrics/src/main/java/org/apache/servicecomb/foundation/metrics/performance/PerfStatMonitor.java
+++ /dev/null
@@ -1,91 +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.servicecomb.foundation.metrics.performance;
-
-import java.util.ArrayList;
-import java.util.List;
-
-/**
- * PerfStatMonitor
- *
- *
- */
-public class PerfStatMonitor {
-  // 各线程内部的统计数据
-  private List<PerfStat> threadStats = new ArrayList<>();
-
-  private String name;
-
-  private int index;
-
-  // 每周期,对threadStats进行汇总,结果保存在这里
-  private PerfStat sumStat;
-
-  // 每周期计算产生的结果
-  private List<PerfResult> perfResultList;
-
-  public PerfStatMonitor(String name, int index) {
-    this.name = name;
-    this.index = index;
-  }
-
-  public String getName() {
-    return name;
-  }
-
-  public int getIndex() {
-    return index;
-  }
-
-  public void addThreadStat(PerfStat threadStat) {
-    threadStats.add(threadStat);
-  }
-
-  public void calcCycle(long msNow, long msCycle) {
-    PerfStat newSumStat = new PerfStatImpl(null);
-    for (PerfStat threadStat : threadStats) {
-      newSumStat.mergeFrom(threadStat);
-    }
-
-    perfResultList = new ArrayList<>();
-    newSumStat.calc(msNow, perfResultList);
-    newSumStat.calc(sumStat, msCycle, perfResultList);
-
-    sumStat = newSumStat;
-  }
-
-  public void format(StringBuilder sb, String fmt) {
-    for (PerfResult result : perfResultList) {
-      String msg = String.format(result.getName() + fmt,
-          result.getCallCount(),
-          result.getMsgCount(),
-          result.getAvgCallCount(),
-          result.getMsAvgLatency(),
-          result.segmentsToString("%-10d"));
-      sb.append(msg);
-    }
-  }
-
-  public PerfStat getPerfStat() {
-    return sumStat;
-  }
-
-  public List<PerfResult> getPerfResultList() {
-    return perfResultList;
-  }
-}
diff --git a/foundations/foundation-metrics/src/main/java/org/apache/servicecomb/foundation/metrics/performance/PerfStatMonitorMgr.java b/foundations/foundation-metrics/src/main/java/org/apache/servicecomb/foundation/metrics/performance/PerfStatMonitorMgr.java
deleted file mode 100644
index 2c88e79..0000000
--- a/foundations/foundation-metrics/src/main/java/org/apache/servicecomb/foundation/metrics/performance/PerfStatMonitorMgr.java
+++ /dev/null
@@ -1,83 +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.servicecomb.foundation.metrics.performance;
-
-import java.util.ArrayList;
-import java.util.Comparator;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.stream.Collectors;
-
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * PerfStatMonitorMgr
- *
- *
- */
-public class PerfStatMonitorMgr {
-  private static final Logger LOGGER = LoggerFactory.getLogger(PerfStatMonitorMgr.class);
-
-  private Map<String, PerfStatMonitor> monitorMap = new HashMap<>();
-
-  private List<PerfStatMonitor> monitorList = new ArrayList<>();
-
-  private String header = String.format(
-      "             call count       msg count        avg tps    avg latency(ms) |%s",
-      PerfStatData.getStrSegmentDef());
-
-  private String statFmt = "%-16d %-16d %-10d %-16.3f %s\n";
-
-  public void registerPerfStat(PerfStat perfStat, int index) {
-    String name = perfStat.getName();
-    PerfStatMonitor monitor = monitorMap.get(name);
-    if (monitor == null) {
-      monitor = new PerfStatMonitor(name, index);
-      monitorMap.put(name, monitor);
-
-      monitorList.add(monitor);
-
-      monitorList.sort(Comparator.comparingInt(PerfStatMonitor::getIndex));
-    }
-
-    monitor.addThreadStat(perfStat);
-  }
-
-  public void onCycle(long msNow, long msCycle) {
-    StringBuilder sb = new StringBuilder();
-    sb.append("Cycle stat output:\n" + header + "\n");
-    for (PerfStatMonitor monitor : monitorList) {
-      monitor.calcCycle(msNow, msCycle);
-
-      sb.append(" " + monitor.getName() + ":\n");
-      monitor.format(sb, statFmt);
-    }
-
-    LOGGER.info(sb.toString());
-  }
-
-  public Map<String, PerfStat> getMonitorPerfStat() {
-    return monitorList.stream().collect(Collectors.toMap(PerfStatMonitor::getName, PerfStatMonitor::getPerfStat));
-  }
-
-  public List<PerfStatMonitor> getMonitorList() {
-    return monitorList;
-  }
-}
diff --git a/foundations/foundation-metrics/src/main/java/org/apache/servicecomb/foundation/metrics/performance/PerfStatSuccFail.java b/foundations/foundation-metrics/src/main/java/org/apache/servicecomb/foundation/metrics/performance/PerfStatSuccFail.java
deleted file mode 100644
index a5eb015..0000000
--- a/foundations/foundation-metrics/src/main/java/org/apache/servicecomb/foundation/metrics/performance/PerfStatSuccFail.java
+++ /dev/null
@@ -1,50 +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.servicecomb.foundation.metrics.performance;
-
-/**
- * PerfStatSuccFail
- *
- *
- */
-public class PerfStatSuccFail extends PerfStatImpl {
-
-  private PerfStatData succ = new PerfStatData("succ");
-
-  private PerfStatData fail = new PerfStatData("fail");
-
-  public PerfStatSuccFail(String name) {
-    super(name);
-
-    addPerfStatData(succ);
-    addPerfStatData(fail);
-  }
-
-  public void add(boolean isSucc, int msgCount, long latency) {
-    PerfStatData statData = succ;
-    if (!isSucc) {
-      msgCount = 0;
-      statData = fail;
-    }
-    statData.add(msgCount, latency);
-  }
-
-  public void add(boolean isSucc, PerfStatContext context) {
-    add(isSucc, context.getMsgCount(), context.getLatency());
-  }
-}
diff --git a/foundations/foundation-metrics/src/main/resources/META-INF/spring/metrics.bean.xml b/foundations/foundation-metrics/src/main/resources/META-INF/spring/metrics.bean.xml
deleted file mode 100644
index c0c178f..0000000
--- a/foundations/foundation-metrics/src/main/resources/META-INF/spring/metrics.bean.xml
+++ /dev/null
@@ -1,27 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-  ~ 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.
-  -->
-
-<beans xmlns="http://www.springframework.org/schema/beans"
-  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-  xsi:schemaLocation="
-        http://www.springframework.org/schema/beans
-        http://www.springframework.org/schema/beans/spring-beans-3.0.xsd">
-
-  <bean class="org.apache.servicecomb.foundation.metrics.MetricsConfig">
-  </bean>
-</beans>
diff --git a/foundations/foundation-metrics/src/test/java/org/apache/servicecomb/foundation/metrics/TestMetrics.java b/foundations/foundation-metrics/src/test/java/org/apache/servicecomb/foundation/metrics/TestMetrics.java
deleted file mode 100644
index e4a23bc..0000000
--- a/foundations/foundation-metrics/src/test/java/org/apache/servicecomb/foundation/metrics/TestMetrics.java
+++ /dev/null
@@ -1,35 +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.servicecomb.foundation.metrics;
-
-import org.apache.servicecomb.foundation.metrics.performance.PerfStatSuccFail;
-import org.junit.Assert;
-import org.junit.Test;
-
-public class TestMetrics {
-
-  @Test
-  public void testOnCycle() throws Exception {
-    PerfStatSuccFail oPerfStatSuccFail = Metrics.getOrCreateLocalPerfStat("test", 1);
-    Metrics.onCycle();
-    Assert.assertEquals(0, Metrics.getMsTick());
-    Assert.assertEquals(1, Metrics.getMonitorPerfStat().size());
-    Assert.assertEquals("test", oPerfStatSuccFail.getName());
-    Assert.assertEquals(2, oPerfStatSuccFail.getPerfStatDataList().size());
-  }
-}
diff --git a/foundations/foundation-metrics/src/test/java/org/apache/servicecomb/foundation/metrics/TestMetricsThread.java b/foundations/foundation-metrics/src/test/java/org/apache/servicecomb/foundation/metrics/TestMetricsThread.java
deleted file mode 100644
index e184fbe..0000000
--- a/foundations/foundation-metrics/src/test/java/org/apache/servicecomb/foundation/metrics/TestMetricsThread.java
+++ /dev/null
@@ -1,47 +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.servicecomb.foundation.metrics;
-
-import org.junit.After;
-import org.junit.Assert;
-import org.junit.Before;
-import org.junit.Test;
-
-public class TestMetricsThread {
-
-  MetricsThread oMetricsThread = null;
-
-  @Before
-  public void setUp() throws Exception {
-    oMetricsThread = new MetricsThread();
-  }
-
-  @After
-  public void tearDown() throws Exception {
-    oMetricsThread.shutdown();
-    oMetricsThread = null;
-  }
-
-  @Test
-  public void test() {
-    oMetricsThread.start();
-    Assert.assertEquals(true, oMetricsThread.isRunning());
-    oMetricsThread.shutdown();
-    Assert.assertEquals(false, oMetricsThread.isRunning());
-  }
-}
diff --git a/foundations/foundation-metrics/src/test/java/org/apache/servicecomb/foundation/metrics/performance/TestPerfResult.java b/foundations/foundation-metrics/src/test/java/org/apache/servicecomb/foundation/metrics/performance/TestPerfResult.java
deleted file mode 100644
index 5c23ea5..0000000
--- a/foundations/foundation-metrics/src/test/java/org/apache/servicecomb/foundation/metrics/performance/TestPerfResult.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.servicecomb.foundation.metrics.performance;
-
-import org.junit.After;
-import org.junit.Assert;
-import org.junit.Before;
-import org.junit.Test;
-
-public class TestPerfResult {
-
-  PerfResult oPerfResult = null;
-
-  @Before
-  public void setUp() throws Exception {
-    oPerfResult = new PerfResult();
-  }
-
-  @After
-  public void tearDown() throws Exception {
-    oPerfResult = null;
-  }
-
-  @Test
-  public void testDefaultValues() {
-    Assert.assertNull(oPerfResult.getName());
-    Assert.assertEquals(0, oPerfResult.getCallCount());
-    Assert.assertEquals(0, oPerfResult.getMsAvgLatency(), 0);
-    Assert.assertEquals(0, oPerfResult.getAvgCallCount());
-    Assert.assertNull(oPerfResult.getMsLatencySegments());
-    Assert.assertEquals(0, oPerfResult.getMsgCount());
-  }
-
-  @Test
-  public void testIntializedValues() {
-    initializeObject(); //Initialize the object.
-    Assert.assertEquals("testPerf", oPerfResult.getName());
-    Assert.assertEquals(1, oPerfResult.getCallCount());
-    Assert.assertEquals(56, oPerfResult.getMsAvgLatency(), 0);
-    Assert.assertEquals(2, oPerfResult.getAvgCallCount());
-    Assert.assertEquals(2, oPerfResult.getMsLatencySegments().length);
-    Assert.assertEquals(10, oPerfResult.getMsgCount());
-    Assert.assertEquals("testStringtestString", oPerfResult.segmentsToString("testString"));
-  }
-
-  private void initializeObject() {
-    long[] oLongLatencySegment = new long[] {123, 154};
-    oPerfResult.setAvgCallCount(2);
-    oPerfResult.setCallCount(1);
-    oPerfResult.setMsAvgLatency(56);
-    oPerfResult.setMsgCount(10);
-    oPerfResult.setName("testPerf");
-    oPerfResult.setMsLatencySegments(oLongLatencySegment);
-  }
-}
diff --git a/foundations/foundation-metrics/src/test/java/org/apache/servicecomb/foundation/metrics/performance/TestPerfStatContext.java b/foundations/foundation-metrics/src/test/java/org/apache/servicecomb/foundation/metrics/performance/TestPerfStatContext.java
deleted file mode 100644
index 38fd83b..0000000
--- a/foundations/foundation-metrics/src/test/java/org/apache/servicecomb/foundation/metrics/performance/TestPerfStatContext.java
+++ /dev/null
@@ -1,68 +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.servicecomb.foundation.metrics.performance;
-
-import org.junit.After;
-import org.junit.Assert;
-import org.junit.Before;
-import org.junit.Test;
-
-import mockit.Mock;
-import mockit.MockUp;
-
-public class TestPerfStatContext {
-
-  PerfStatContext oPerfStatContext = null;
-
-  @Before
-  public void setUp() throws Exception {
-    oPerfStatContext = new PerfStatContext();
-  }
-
-  @After
-  public void tearDown() throws Exception {
-    oPerfStatContext = null;
-  }
-
-  @Test
-  public void testDefaultValues() {
-    Assert.assertEquals(0, oPerfStatContext.getMsgCount());
-    Assert.assertTrue(oPerfStatContext.getLatency() >= 0);
-  }
-
-  @Test
-  public void testIntializedValues() throws InterruptedException {
-    new MockUp<System>() {
-      int count = 0;
-
-      @Mock
-      public long currentTimeMillis() {
-        if (count == 0) {
-          count++;
-          return 10;
-        } else {
-          return 20;
-        }
-      }
-    };
-    PerfStatContext oPerfStatContext = new PerfStatContext();
-    oPerfStatContext.setMsgCount(10);
-    Assert.assertEquals(10, oPerfStatContext.getMsgCount());
-    Assert.assertEquals(10, oPerfStatContext.getLatency());
-  }
-}
diff --git a/foundations/foundation-metrics/src/test/java/org/apache/servicecomb/foundation/metrics/performance/TestPerfStatData.java b/foundations/foundation-metrics/src/test/java/org/apache/servicecomb/foundation/metrics/performance/TestPerfStatData.java
deleted file mode 100644
index 85bea31..0000000
--- a/foundations/foundation-metrics/src/test/java/org/apache/servicecomb/foundation/metrics/performance/TestPerfStatData.java
+++ /dev/null
@@ -1,83 +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.servicecomb.foundation.metrics.performance;
-
-import org.junit.After;
-import org.junit.Assert;
-import org.junit.Before;
-import org.junit.Test;
-
-public class TestPerfStatData {
-
-  PerfStatData oPerfStatData = null;
-
-  @Before
-  public void setUp() throws Exception {
-    oPerfStatData = new PerfStatData("testData");
-  }
-
-  @After
-  public void tearDown() throws Exception {
-    oPerfStatData = null;
-  }
-
-  @Test
-  public void testDefaultValues() {
-    Assert.assertEquals("testData", oPerfStatData.getName());
-    Assert.assertEquals(0, oPerfStatData.getCallCount());
-    Assert.assertEquals(0, oPerfStatData.getMsLatency());
-    Assert.assertNotNull(oPerfStatData.getMsLatencySegments());
-    Assert.assertEquals(0, oPerfStatData.getMsgCount());
-    Assert.assertNotNull(PerfStatData.getStrSegmentDef());
-  }
-
-  @Test
-  public void testAdd() {
-    oPerfStatData.add(10, 100);
-    Assert.assertEquals(10, oPerfStatData.getMsgCount());
-    Assert.assertEquals(100, oPerfStatData.getMsLatency());
-
-    //Test Add function with PerfStatContext
-    PerfStatContext oPerfStatContext = new PerfStatContext();
-    oPerfStatContext.setMsgCount(30);
-    oPerfStatData.add(oPerfStatContext);
-    Assert.assertEquals(40, oPerfStatData.getMsgCount());
-  }
-
-  @Test
-  public void testMergeFrom() {
-    oPerfStatData.mergeFrom(new PerfStatData("anotherData"));
-    Assert.assertEquals(0, oPerfStatData.getMsgCount());
-    Assert.assertEquals(0, oPerfStatData.getCallCount());
-    Assert.assertEquals(0, oPerfStatData.getMsLatency());
-  }
-
-  @Test
-  public void testCalc() {
-    PerfResult oPerfResult = oPerfStatData.calc(System.currentTimeMillis() + 18989);
-    Assert.assertEquals("  all testData  :", oPerfResult.getName());
-    Assert.assertEquals(0, oPerfResult.getCallCount());
-    Assert.assertEquals(0, oPerfResult.getMsgCount());
-
-    //test calc with another PerfStatData
-    oPerfResult = oPerfStatData.calc(new PerfStatData("anotherData"), System.currentTimeMillis() + 18989);
-    Assert.assertEquals("  cycle testData:", oPerfResult.getName());
-    Assert.assertEquals(0, oPerfResult.getCallCount());
-    Assert.assertEquals(0, oPerfResult.getMsgCount());
-  }
-}
diff --git a/foundations/foundation-metrics/src/test/java/org/apache/servicecomb/foundation/metrics/performance/TestPerfStatImpl.java b/foundations/foundation-metrics/src/test/java/org/apache/servicecomb/foundation/metrics/performance/TestPerfStatImpl.java
deleted file mode 100644
index 322b4f5..0000000
--- a/foundations/foundation-metrics/src/test/java/org/apache/servicecomb/foundation/metrics/performance/TestPerfStatImpl.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.servicecomb.foundation.metrics.performance;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.junit.After;
-import org.junit.Assert;
-import org.junit.Before;
-import org.junit.Test;
-
-public class TestPerfStatImpl {
-
-  PerfStatImpl oPerfStatImpl = null;
-
-  PerfStatSuccFail oPerfStatSuccFail = null;
-
-  @Before
-  public void setUp() throws Exception {
-    oPerfStatImpl = new PerfStatImpl("testData");
-    oPerfStatSuccFail = new PerfStatSuccFail("testMergeFrom");
-  }
-
-  @After
-  public void tearDown() throws Exception {
-    oPerfStatImpl = null;
-  }
-
-  @Test
-  public void testMergeFrom() {
-    oPerfStatImpl.mergeFrom(oPerfStatSuccFail);
-    Assert.assertEquals("testMergeFrom", oPerfStatImpl.getName());
-    Assert.assertEquals(2, oPerfStatImpl.getPerfStatDataList().size());
-  }
-
-  @Test
-  public void testCalc() {
-    oPerfStatImpl = new PerfStatImpl("testConstructor", new PerfStatData("test"));
-    PerfResult oPerfResult = new PerfResult();
-    oPerfResult.setName("test");
-    List<PerfResult> oPerfResultList = new ArrayList<>();
-    oPerfResultList.add(oPerfResult);
-    oPerfStatImpl.calc(System.currentTimeMillis(), oPerfResultList);
-    Assert.assertEquals(2, oPerfResultList.size());
-
-    //Testing Calc with null PerfStat
-    oPerfStatImpl.calc(null, 20, oPerfResultList);
-    Assert.assertEquals(2, oPerfResultList.size()); //The list size does not increase
-
-    //Testing Calc with PerfStat
-    oPerfStatImpl.calc(oPerfStatSuccFail, 20, oPerfResultList);
-    Assert.assertEquals(3, oPerfResultList.size());
-  }
-}
diff --git a/foundations/foundation-metrics/src/test/java/org/apache/servicecomb/foundation/metrics/performance/TestPerfStatMonitor.java b/foundations/foundation-metrics/src/test/java/org/apache/servicecomb/foundation/metrics/performance/TestPerfStatMonitor.java
deleted file mode 100644
index 8148d99..0000000
--- a/foundations/foundation-metrics/src/test/java/org/apache/servicecomb/foundation/metrics/performance/TestPerfStatMonitor.java
+++ /dev/null
@@ -1,56 +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.servicecomb.foundation.metrics.performance;
-
-import org.junit.After;
-import org.junit.Assert;
-import org.junit.Before;
-import org.junit.Test;
-
-public class TestPerfStatMonitor {
-
-  PerfStatMonitor oPerfStatMonitor = null;
-
-  PerfStatSuccFail oPerfStatSuccFail = null;
-
-  @Before
-  public void setUp() throws Exception {
-    oPerfStatMonitor = new PerfStatMonitor("testMonitor", 0);
-    oPerfStatSuccFail = new PerfStatSuccFail("testMergeFrom");
-  }
-
-  @After
-  public void tearDown() throws Exception {
-    oPerfStatMonitor = null;
-  }
-
-  @Test
-  public void testCalcCycle() {
-    Assert.assertEquals("testMonitor", oPerfStatMonitor.getName());
-    Assert.assertEquals(0, oPerfStatMonitor.getIndex());
-    oPerfStatMonitor.addThreadStat(oPerfStatSuccFail);
-    oPerfStatMonitor.calcCycle(System.currentTimeMillis(), 20);
-    Assert.assertEquals("testMergeFrom", oPerfStatMonitor.getPerfStat().getName());
-    Assert.assertEquals(2, oPerfStatMonitor.getPerfResultList().size());
-
-    //Test Format
-    StringBuilder oBuilder = new StringBuilder();
-    oPerfStatMonitor.format(oBuilder, "Test");
-    Assert.assertEquals("  all succ  :Test  all fail  :Test", oBuilder.toString());
-  }
-}
diff --git a/foundations/foundation-metrics/src/test/java/org/apache/servicecomb/foundation/metrics/performance/TestPerfStatMonitorMgr.java b/foundations/foundation-metrics/src/test/java/org/apache/servicecomb/foundation/metrics/performance/TestPerfStatMonitorMgr.java
deleted file mode 100644
index 6692e90..0000000
--- a/foundations/foundation-metrics/src/test/java/org/apache/servicecomb/foundation/metrics/performance/TestPerfStatMonitorMgr.java
+++ /dev/null
@@ -1,68 +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.servicecomb.foundation.metrics.performance;
-
-import java.util.stream.Collectors;
-
-import org.hamcrest.Matchers;
-import org.junit.After;
-import org.junit.Assert;
-import org.junit.Before;
-import org.junit.Test;
-
-public class TestPerfStatMonitorMgr {
-
-  PerfStatMonitorMgr oPerfStatMonitorMgr = null;
-
-  PerfStatSuccFail oPerfStatSuccFail = null;
-
-  @Before
-  public void setUp() throws Exception {
-    oPerfStatMonitorMgr = new PerfStatMonitorMgr();
-    oPerfStatSuccFail = new PerfStatSuccFail("testMergeFrom");
-  }
-
-  @After
-  public void tearDown() throws Exception {
-    oPerfStatMonitorMgr = null;
-    oPerfStatSuccFail = null;
-  }
-
-  @Test
-  public void testRegisterPerfStat() {
-    oPerfStatMonitorMgr.registerPerfStat(oPerfStatSuccFail, 0);
-    Assert.assertEquals(1, oPerfStatMonitorMgr.getMonitorList().size());
-  }
-
-  @Test
-  public void testOnCycle() {
-    oPerfStatMonitorMgr.registerPerfStat(oPerfStatSuccFail, 0);
-    oPerfStatMonitorMgr.onCycle(System.currentTimeMillis(), 10);
-    Assert.assertEquals(1, oPerfStatMonitorMgr.getMonitorPerfStat().size());
-  }
-
-  @Test
-  public void testSort() {
-    oPerfStatMonitorMgr.registerPerfStat(new PerfStatSuccFail("a"), -1);
-    oPerfStatMonitorMgr.registerPerfStat(new PerfStatSuccFail("b"), Integer.MAX_VALUE);
-
-    Assert.assertThat(
-        oPerfStatMonitorMgr.getMonitorList().stream().map(PerfStatMonitor::getName).collect(Collectors.toList()),
-        Matchers.contains("a", "b"));
-  }
-}
diff --git a/foundations/foundation-metrics/src/test/java/org/apache/servicecomb/foundation/metrics/performance/TestPerfStatSuccFail.java b/foundations/foundation-metrics/src/test/java/org/apache/servicecomb/foundation/metrics/performance/TestPerfStatSuccFail.java
deleted file mode 100644
index 52bd759..0000000
--- a/foundations/foundation-metrics/src/test/java/org/apache/servicecomb/foundation/metrics/performance/TestPerfStatSuccFail.java
+++ /dev/null
@@ -1,48 +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.servicecomb.foundation.metrics.performance;
-
-import org.junit.After;
-import org.junit.Assert;
-import org.junit.Before;
-import org.junit.Test;
-
-public class TestPerfStatSuccFail {
-
-  PerfStatSuccFail oPerfStatSuccFail = null;
-
-  @Before
-  public void setUp() throws Exception {
-    oPerfStatSuccFail = new PerfStatSuccFail("testSuccFail");
-  }
-
-  @After
-  public void tearDown() throws Exception {
-    oPerfStatSuccFail = null;
-  }
-
-  @Test
-  public void testAdd() {
-    oPerfStatSuccFail.add(true, new PerfStatContext());
-    Assert.assertEquals(2, oPerfStatSuccFail.getPerfStatDataList().size());
-
-    //Test org.apache.servicecomb.foundation.metrics.performance.PerfStatSuccFail.add(boolean, int, long)
-    oPerfStatSuccFail.add(false, 10, 100);
-    Assert.assertEquals(2, oPerfStatSuccFail.getPerfStatDataList().size());
-  }
-}

-- 
To stop receiving notification emails like this one, please contact
wujimin@apache.org.

[incubator-servicecomb-java-chassis] 04/04: SCB-445 remove useless dependence

Posted by wu...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

wujimin pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-servicecomb-java-chassis.git

commit 6f66e2622b0c056d26682672b881c15920f06fba
Author: wujimin <wu...@huawei.com>
AuthorDate: Wed Apr 11 11:44:29 2018 +0800

    SCB-445 remove useless dependence
---
 core/pom.xml | 4 ----
 1 file changed, 4 deletions(-)

diff --git a/core/pom.xml b/core/pom.xml
index 2b593a3..4c67a61 100644
--- a/core/pom.xml
+++ b/core/pom.xml
@@ -37,10 +37,6 @@
       <artifactId>swagger-invocation-core</artifactId>
     </dependency>
     <dependency>
-      <groupId>org.apache.servicecomb</groupId>
-      <artifactId>foundation-metrics</artifactId>
-    </dependency>
-    <dependency>
       <groupId>io.zipkin.brave</groupId>
       <artifactId>brave</artifactId>
     </dependency>

-- 
To stop receiving notification emails like this one, please contact
wujimin@apache.org.

[incubator-servicecomb-java-chassis] 01/04: SCB-445 delete old metrics mechanism

Posted by wu...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

wujimin pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-servicecomb-java-chassis.git

commit 7b751501ef8a483034ca20a6ff130acdfec3b92a
Author: wujimin <wu...@huawei.com>
AuthorDate: Wed Apr 4 17:02:45 2018 +0800

    SCB-445 delete old metrics mechanism
---
 .../org/apache/servicecomb/core/Invocation.java    |  30 --
 .../core/metrics/InvocationFinishedEvent.java      |  68 -----
 .../metrics/InvocationStartExecutionEvent.java     |  30 --
 .../core/metrics/InvocationStartedEvent.java       |  46 ---
 .../foundation/metrics/MetricsConst.java           |  44 ---
 .../foundation/metrics/publish/Metric.java         | 131 ---------
 .../foundation/metrics/publish/MetricNode.java     | 145 ----------
 .../foundation/metrics/publish/MetricsLoader.java  |  62 ----
 .../foundation/metrics/publish/TestMetric.java     | 118 --------
 .../foundation/metrics/publish/TestMetricNode.java | 109 -------
 .../metrics/publish/TestMetricsLoader.java         |  69 -----
 .../metrics/core/AbstractInvocationMetrics.java    |  73 -----
 .../metrics/core/ConsumerInvocationMetrics.java    |  33 ---
 .../metrics/core/InvocationMetricsManager.java     |  85 ------
 .../servicecomb/metrics/core/MetricsConfig.java    |  22 --
 .../servicecomb/metrics/core/MonitorManager.java   | 217 --------------
 .../metrics/core/ProducerInvocationMetrics.java    |  37 ---
 .../event/InvocationFinishedEventListener.java     |  41 ---
 .../InvocationStartExecutionEventListener.java     |  34 ---
 .../core/event/InvocationStartedEventListener.java |  37 ---
 .../metrics/core/TestAnMonitorManager.java         | 321 ---------------------
 21 files changed, 1752 deletions(-)

diff --git a/core/src/main/java/org/apache/servicecomb/core/Invocation.java b/core/src/main/java/org/apache/servicecomb/core/Invocation.java
index 369f071..b3ba281 100644
--- a/core/src/main/java/org/apache/servicecomb/core/Invocation.java
+++ b/core/src/main/java/org/apache/servicecomb/core/Invocation.java
@@ -26,10 +26,7 @@ import org.apache.servicecomb.core.definition.OperationMeta;
 import org.apache.servicecomb.core.definition.SchemaMeta;
 import org.apache.servicecomb.core.event.InvocationFinishEvent;
 import org.apache.servicecomb.core.event.InvocationStartEvent;
-import org.apache.servicecomb.core.metrics.InvocationStartExecutionEvent;
-import org.apache.servicecomb.core.metrics.InvocationStartedEvent;
 import org.apache.servicecomb.core.provider.consumer.ReferenceConfig;
-import org.apache.servicecomb.foundation.common.event.EventBus;
 import org.apache.servicecomb.foundation.common.event.EventManager;
 import org.apache.servicecomb.swagger.invocation.AsyncResponse;
 import org.apache.servicecomb.swagger.invocation.InvocationType;
@@ -195,41 +192,14 @@ public class Invocation extends SwaggerInvocation {
   public void onStart() {
     this.startTime = System.nanoTime();
     EventManager.post(new InvocationStartEvent(this));
-
-    // old logic, need to be deleted
-    EventBus.getInstance().triggerEvent(new InvocationStartedEvent(getMicroserviceQualifiedName(),
-        invocationType, startTime));
   }
 
   public void onStartExecute() {
     this.startExecutionTime = System.nanoTime();
-
-    // old logic, need to be deleted
-    triggerStartExecutionEvent();
-  }
-
-  private void triggerStartExecutionEvent() {
-    if (InvocationType.PRODUCER.equals(invocationType)) {
-      this.startExecutionTime = System.nanoTime();
-      EventBus.getInstance()
-          .triggerEvent(new InvocationStartExecutionEvent(operationMeta.getMicroserviceQualifiedName()));
-    }
   }
 
   public void onFinish(Response response) {
     EventManager.post(new InvocationFinishEvent(this, response));
-
-    // old logic, need to be deleted
-    triggerFinishedEvent(response.getStatusCode());
-  }
-
-  private void triggerFinishedEvent(int statusCode) {
-    long finishedTime = System.nanoTime();
-    EventBus.getInstance()
-        .triggerEvent(new org.apache.servicecomb.core.metrics.InvocationFinishedEvent(
-            operationMeta.getMicroserviceQualifiedName(), this.invocationType,
-            startExecutionTime - startTime, finishedTime - startExecutionTime,
-            finishedTime - startTime, statusCode));
   }
 
   public boolean isSync() {
diff --git a/core/src/main/java/org/apache/servicecomb/core/metrics/InvocationFinishedEvent.java b/core/src/main/java/org/apache/servicecomb/core/metrics/InvocationFinishedEvent.java
deleted file mode 100644
index e0a10d1..0000000
--- a/core/src/main/java/org/apache/servicecomb/core/metrics/InvocationFinishedEvent.java
+++ /dev/null
@@ -1,68 +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.servicecomb.core.metrics;
-
-import org.apache.servicecomb.swagger.invocation.InvocationType;
-
-public class InvocationFinishedEvent {
-  private final String operationName;
-
-  private final InvocationType invocationType;
-
-  private final long inQueueNanoTime;
-
-  private final long executionElapsedNanoTime;
-
-  private final long totalElapsedNanoTime;
-
-  private final int statusCode;
-
-  public String getOperationName() {
-    return operationName;
-  }
-
-  public InvocationType getInvocationType() {
-    return invocationType;
-  }
-
-  public long getInQueueNanoTime() {
-    return inQueueNanoTime;
-  }
-
-  public long getExecutionElapsedNanoTime() {
-    return executionElapsedNanoTime;
-  }
-
-  public long getTotalElapsedNanoTime() {
-    return totalElapsedNanoTime;
-  }
-
-  public int getStatusCode() {
-    return statusCode;
-  }
-
-  public InvocationFinishedEvent(String operationName, InvocationType invocationType,
-      long inQueueNanoTime, long executionElapsedNanoTime, long totalElapsedNanoTime, int statusCode) {
-    this.operationName = operationName;
-    this.invocationType = invocationType;
-    this.inQueueNanoTime = inQueueNanoTime;
-    this.executionElapsedNanoTime = executionElapsedNanoTime;
-    this.totalElapsedNanoTime = totalElapsedNanoTime;
-    this.statusCode = statusCode;
-  }
-}
diff --git a/core/src/main/java/org/apache/servicecomb/core/metrics/InvocationStartExecutionEvent.java b/core/src/main/java/org/apache/servicecomb/core/metrics/InvocationStartExecutionEvent.java
deleted file mode 100644
index 2d7c5a9..0000000
--- a/core/src/main/java/org/apache/servicecomb/core/metrics/InvocationStartExecutionEvent.java
+++ /dev/null
@@ -1,30 +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.servicecomb.core.metrics;
-
-public class InvocationStartExecutionEvent {
-  private final String operationName;
-
-  public String getOperationName() {
-    return operationName;
-  }
-
-  public InvocationStartExecutionEvent(String operationName) {
-    this.operationName = operationName;
-  }
-}
diff --git a/core/src/main/java/org/apache/servicecomb/core/metrics/InvocationStartedEvent.java b/core/src/main/java/org/apache/servicecomb/core/metrics/InvocationStartedEvent.java
deleted file mode 100644
index 9ce7759..0000000
--- a/core/src/main/java/org/apache/servicecomb/core/metrics/InvocationStartedEvent.java
+++ /dev/null
@@ -1,46 +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.servicecomb.core.metrics;
-
-import org.apache.servicecomb.swagger.invocation.InvocationType;
-
-public class InvocationStartedEvent {
-  private final String operationName;
-
-  private final InvocationType invocationType;
-
-  private final long startedTime;
-
-  public String getOperationName() {
-    return operationName;
-  }
-
-  public InvocationType getInvocationType() {
-    return invocationType;
-  }
-
-  public long getStartedTime() {
-    return startedTime;
-  }
-
-  public InvocationStartedEvent(String operationName, InvocationType invocationType, long startedTime) {
-    this.operationName = operationName;
-    this.invocationType = invocationType;
-    this.startedTime = startedTime;
-  }
-}
diff --git a/foundations/foundation-metrics/src/main/java/org/apache/servicecomb/foundation/metrics/MetricsConst.java b/foundations/foundation-metrics/src/main/java/org/apache/servicecomb/foundation/metrics/MetricsConst.java
deleted file mode 100644
index fe82da4..0000000
--- a/foundations/foundation-metrics/src/main/java/org/apache/servicecomb/foundation/metrics/MetricsConst.java
+++ /dev/null
@@ -1,44 +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.servicecomb.foundation.metrics;
-
-public class MetricsConst {
-  public static final String JVM = "jvm";
-
-  public static final String SERVICECOMB_INVOCATION = "servicecomb.invocation";
-
-  public static final String TAG_NAME = "name";
-
-  public static final String TAG_OPERATION = "operation";
-
-  public static final String TAG_STATUS = "status";
-
-  public static final String TAG_STAGE = "stage";
-
-  public static final String TAG_ROLE = "role";
-
-  public static final String TAG_STATISTIC = "statistic";
-
-  public static final String TAG_UNIT = "unit";
-
-  public static final String STAGE_TOTAL = "total";
-
-  public static final String STAGE_QUEUE = "queue";
-
-  public static final String STAGE_EXECUTION = "execution";
-}
diff --git a/foundations/foundation-metrics/src/main/java/org/apache/servicecomb/foundation/metrics/publish/Metric.java b/foundations/foundation-metrics/src/main/java/org/apache/servicecomb/foundation/metrics/publish/Metric.java
deleted file mode 100644
index b894b58..0000000
--- a/foundations/foundation-metrics/src/main/java/org/apache/servicecomb/foundation/metrics/publish/Metric.java
+++ /dev/null
@@ -1,131 +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.servicecomb.foundation.metrics.publish;
-
-import java.util.HashMap;
-import java.util.Map;
-import java.util.concurrent.TimeUnit;
-
-import org.apache.servicecomb.foundation.common.exceptions.ServiceCombException;
-import org.apache.servicecomb.foundation.metrics.MetricsConst;
-
-public class Metric {
-  private String name;
-
-  private Map<String, String> tags;
-
-  private double value;
-
-  public String getName() {
-    return name;
-  }
-
-  public Metric(String id, double value) {
-    if (validateMetricId(id)) {
-      this.tags = new HashMap<>();
-      this.value = value;
-      String[] nameAndTag = id.split("[()]");
-      if (nameAndTag.length == 1) {
-        processIdWithoutTags(id, nameAndTag[0]);
-      } else if (nameAndTag.length == 2) {
-        processIdHadTags(id, nameAndTag);
-      } else {
-        throw new ServiceCombException("bad format id " + id);
-      }
-    } else {
-      throw new ServiceCombException("bad format id " + id);
-    }
-  }
-
-  private void processIdWithoutTags(String id, String name) {
-    if (!id.endsWith(")")) {
-      this.name = name;
-    } else {
-      throw new ServiceCombException("bad format id " + id);
-    }
-  }
-
-  private void processIdHadTags(String id, String[] nameAndTag) {
-    this.name = nameAndTag[0];
-    String[] tagAnValues = nameAndTag[1].split(",");
-    for (String tagAnValue : tagAnValues) {
-      String[] kv = tagAnValue.split("=");
-      if (kv.length == 2) {
-        this.tags.put(kv[0], kv[1]);
-      } else {
-        throw new ServiceCombException("bad format tag " + id);
-      }
-    }
-  }
-
-  public double getValue() {
-    return value;
-  }
-
-  public double getValue(TimeUnit unit) {
-    if (tags.containsKey(MetricsConst.TAG_UNIT)) {
-      if (!tags.get(MetricsConst.TAG_UNIT).equals(String.valueOf(unit))) {
-        return unit.convert((long) value, TimeUnit.valueOf(tags.get(MetricsConst.TAG_UNIT)));
-      }
-    }
-    return value;
-  }
-
-  public int getTagsCount() {
-    return tags.size();
-  }
-
-  public boolean containsTagKey(String tagKey) {
-    return tags.containsKey(tagKey);
-  }
-
-  public String getTagValue(String tagKey) {
-    return tags.get(tagKey);
-  }
-
-  public boolean containsTag(String tagKey, String tagValue) {
-    return tags.containsKey(tagKey) && tagValue.equals(tags.get(tagKey));
-  }
-
-  public boolean containsTag(String... tags) {
-    if (tags.length >= 2 && tags.length % 2 == 0) {
-      for (int i = 0; i < tags.length; i += 2) {
-        if (!containsTag(tags[i], tags[i + 1])) {
-          return false;
-        }
-      }
-      return true;
-    }
-    throw new ServiceCombException("bad tags count : " + String.join(",", tags));
-  }
-
-  private int getCharCount(String id, char c) {
-    int count = 0;
-    for (char cr : id.toCharArray()) {
-      if (cr == c) {
-        count++;
-      }
-    }
-    return count;
-  }
-
-  private boolean validateMetricId(String id) {
-    return id != null && !"".equals(id) && !id.endsWith("(") &&
-        getCharCount(id, '(') <= 1 && getCharCount(id, ')') <= 1;
-  }
-}
\ No newline at end of file
diff --git a/foundations/foundation-metrics/src/main/java/org/apache/servicecomb/foundation/metrics/publish/MetricNode.java b/foundations/foundation-metrics/src/main/java/org/apache/servicecomb/foundation/metrics/publish/MetricNode.java
deleted file mode 100644
index 1d47366..0000000
--- a/foundations/foundation-metrics/src/main/java/org/apache/servicecomb/foundation/metrics/publish/MetricNode.java
+++ /dev/null
@@ -1,145 +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.servicecomb.foundation.metrics.publish;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.Map.Entry;
-import java.util.concurrent.TimeUnit;
-
-import org.apache.servicecomb.foundation.metrics.MetricsConst;
-
-import com.google.common.collect.Lists;
-
-public class MetricNode {
-  private final String tagKey;
-
-  private final List<Metric> metrics;
-
-  private final Map<String, MetricNode> children;
-
-  public MetricNode(Iterable<Metric> metrics, String... groupTagKeys) {
-    if (groupTagKeys == null || groupTagKeys.length == 0) {
-      this.tagKey = null;
-      this.metrics = Lists.newArrayList(metrics);
-      this.children = null;
-    } else {
-      this.tagKey = groupTagKeys[0];
-      this.metrics = null;
-      this.children = new HashMap<>();
-      Map<String, List<Metric>> groups = groupByTag(metrics, this.tagKey);
-      if (groupTagKeys.length == 1) {
-        for (Entry<String, List<Metric>> group : groups.entrySet()) {
-          this.children.put(group.getKey(), new MetricNode(null, group.getValue(), null));
-        }
-      } else {
-        for (Entry<String, List<Metric>> group : groups.entrySet()) {
-          this.children.put(group.getKey(),
-              new MetricNode(group.getValue(), Arrays.copyOfRange(groupTagKeys, 1, groupTagKeys.length)));
-        }
-      }
-    }
-  }
-
-  private MetricNode(String tagKey, List<Metric> metrics, Map<String, MetricNode> children) {
-    this.tagKey = tagKey;
-    this.metrics = metrics;
-    this.children = children;
-  }
-
-  public Iterable<Metric> getMetrics() {
-    return metrics;
-  }
-
-  public int getMetricCount() {
-    return metrics.size();
-  }
-
-  public Iterable<Entry<String, MetricNode>> getChildren() {
-    return children.entrySet();
-  }
-
-  public MetricNode getChildren(String tagValue) {
-    return children.get(tagValue);
-  }
-
-  public int getChildrenCount() {
-    return children.size();
-  }
-
-  public MetricNode getChildrenNode(String tagValue) {
-    return children.get(tagValue);
-  }
-
-  public Double getFirstMatchMetricValue(String tagKey, String tagValue) {
-    for (Metric metric : this.metrics) {
-      if (metric.containsTag(tagKey, tagValue)) {
-        return metric.getValue();
-      }
-    }
-    return Double.NaN;
-  }
-
-  public Double getFirstMatchMetricValue(TimeUnit unit, String tagKey, String tagValue) {
-    for (Metric metric : this.metrics) {
-      if (metric.containsTag(tagKey, tagValue)) {
-        return metric.getValue(unit);
-      }
-    }
-    return Double.NaN;
-  }
-
-  public Double getFirstMatchMetricValue(String... tags) {
-    for (Metric metric : this.metrics) {
-      if (metric.containsTag(tags)) {
-        return metric.getValue();
-      }
-    }
-    return Double.NaN;
-  }
-
-  public Double getFirstMatchMetricValue(TimeUnit unit, String... tags) {
-    for (Metric metric : this.metrics) {
-      if (metric.containsTag(tags)) {
-        return metric.getValue(unit);
-      }
-    }
-    return Double.NaN;
-  }
-
-  public double getMatchStatisticMetricValue(String statisticValue) {
-    return getFirstMatchMetricValue(MetricsConst.TAG_STATISTIC, statisticValue);
-  }
-
-  public double getMatchStatisticMetricValue(TimeUnit unit, String statisticValue) {
-    return getFirstMatchMetricValue(unit, MetricsConst.TAG_STATISTIC, statisticValue);
-  }
-
-  private Map<String, List<Metric>> groupByTag(Iterable<Metric> metrics, String tagKey) {
-    Map<String, List<Metric>> groups = new HashMap<>();
-    for (Metric metric : metrics) {
-      if (metric.containsTagKey(tagKey)) {
-        groups.computeIfAbsent(metric.getTagValue(tagKey), g -> new ArrayList<>()).add(metric);
-      }
-    }
-    return groups;
-  }
-}
\ No newline at end of file
diff --git a/foundations/foundation-metrics/src/main/java/org/apache/servicecomb/foundation/metrics/publish/MetricsLoader.java b/foundations/foundation-metrics/src/main/java/org/apache/servicecomb/foundation/metrics/publish/MetricsLoader.java
deleted file mode 100644
index 6d3a396..0000000
--- a/foundations/foundation-metrics/src/main/java/org/apache/servicecomb/foundation/metrics/publish/MetricsLoader.java
+++ /dev/null
@@ -1,62 +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.servicecomb.foundation.metrics.publish;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.Map.Entry;
-
-import org.apache.servicecomb.foundation.common.exceptions.ServiceCombException;
-
-//load origin metrics value and publish tree
-public class MetricsLoader {
-
-  private final Map<String, List<Metric>> metrics;
-
-  public MetricsLoader(Map<String, Double> metrics) {
-    this.metrics = new HashMap<>();
-    for (Entry<String, Double> entry : metrics.entrySet()) {
-      Metric metric = new Metric(entry.getKey(), entry.getValue());
-      this.metrics.computeIfAbsent(metric.getName(), m -> new ArrayList<>()).add(metric);
-    }
-  }
-
-  public MetricNode getMetricTree(String id, String... groupTagKeys) {
-    if (containsId(id)) {
-      return new MetricNode(metrics.get(id), groupTagKeys);
-    }
-    throw new ServiceCombException("no such id : " + id);
-  }
-
-  public boolean containsId(String id) {
-    return metrics.containsKey(id);
-  }
-
-  public double getFirstMatchMetricValue(String name, String tagKey, String tagValue) {
-    if (metrics.containsKey(name)) {
-      for (Metric metric : this.metrics.get(name)) {
-        if (metric.containsTag(tagKey, tagValue)) {
-          return metric.getValue();
-        }
-      }
-    }
-    return Double.NaN;
-  }
-}
\ No newline at end of file
diff --git a/foundations/foundation-metrics/src/test/java/org/apache/servicecomb/foundation/metrics/publish/TestMetric.java b/foundations/foundation-metrics/src/test/java/org/apache/servicecomb/foundation/metrics/publish/TestMetric.java
deleted file mode 100644
index eb47dd7..0000000
--- a/foundations/foundation-metrics/src/test/java/org/apache/servicecomb/foundation/metrics/publish/TestMetric.java
+++ /dev/null
@@ -1,118 +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.servicecomb.foundation.metrics.publish;
-
-import org.apache.servicecomb.foundation.common.exceptions.ServiceCombException;
-import org.junit.Assert;
-import org.junit.Rule;
-import org.junit.Test;
-import org.junit.rules.ExpectedException;
-
-public class TestMetric {
-  @Test
-  public void testNewMetric() {
-
-    Metric metric = new Metric("Key", 100);
-    Assert.assertEquals(0, metric.getTagsCount());
-
-    metric = new Metric("Key(A=1)", 100);
-    Assert.assertEquals(1, metric.getTagsCount());
-    Assert.assertEquals(true, metric.containsTagKey("A"));
-
-    metric = new Metric("Key(A=1,B=X)", 100);
-    Assert.assertEquals(2, metric.getTagsCount());
-    Assert.assertEquals(true, metric.containsTagKey("A"));
-    Assert.assertEquals(true, metric.containsTagKey("B"));
-    Assert.assertEquals("1", metric.getTagValue("A"));
-    Assert.assertEquals("X", metric.getTagValue("B"));
-
-    checkBadIdFormat(null);
-    checkBadIdFormat("");
-    checkBadIdFormat("(");
-    checkBadIdFormat(")");
-    checkBadIdFormat("()");
-
-    checkBadIdFormat("Key(");
-    checkBadIdFormat("Key)");
-    checkBadIdFormat("Key()");
-
-    checkBadIdFormat("Key(X)");
-    checkBadIdFormat("Key(X");
-    checkBadIdFormat("Key(X))");
-    checkBadIdFormat("Key((X)");
-
-    checkBadIdFormat("Key(X=)");
-    checkBadIdFormat("Key(X=");
-    checkBadIdFormat("Key(X=))");
-    checkBadIdFormat("Key((X=)");
-
-    checkBadIdFormat("Key(X=,)");
-    checkBadIdFormat("Key(X=,");
-    checkBadIdFormat("Key(X=,))");
-    checkBadIdFormat("Key((X=,)");
-
-    checkBadIdFormat("Key(X=,Y)");
-    checkBadIdFormat("Key(X=,Y");
-    checkBadIdFormat("Key(X=,Y))");
-    checkBadIdFormat("Key((X=,Y)");
-
-    checkBadIdFormat("Key(X=1,Y)");
-    checkBadIdFormat("Key(X=1,Y");
-    checkBadIdFormat("Key(X=1,Y))");
-    checkBadIdFormat("Key((X=1,Y)");
-
-    checkBadIdFormat("Key(X=1))");
-    checkBadIdFormat("Key((X=1)");
-
-    checkBadIdFormat("Key(X=1) ");
-    checkBadIdFormat("Key(X=1,Y=2)Z");
-
-    checkBadIdFormat("Key(X=1)()");
-    checkBadIdFormat("Key(X=1)(Y=1)");
-  }
-
-  @Test
-  public void checkMetricContainsTag() {
-    Metric metric = new Metric("Key(A=1,B=X)", 100);
-    Assert.assertEquals(true, metric.containsTag("A", "1"));
-  }
-
-  @Test
-  public void checkMetricContainsTagWithWrongTagsCount() {
-    Metric metric = new Metric("Key(A=1,B=X)", 100);
-    checkMetricContainsTagWithWrongTagsCount(metric, "A");
-    checkMetricContainsTagWithWrongTagsCount(metric, "A", "1", "B");
-    checkMetricContainsTagWithWrongTagsCount(metric, "A", "1", "B", "X", "C");
-  }
-
-
-  @Rule
-  public ExpectedException thrown = ExpectedException.none();
-
-  private void checkMetricContainsTagWithWrongTagsCount(Metric metric, String... tags) {
-    thrown.expect(ServiceCombException.class);
-    metric.containsTag(tags);
-    Assert.fail("checkMetricContainsTagWithWrongTagsCount failed : " + String.join(",", tags));
-  }
-
-  private void checkBadIdFormat(String id) {
-    thrown.expect(ServiceCombException.class);
-    new Metric(id, 100);
-    Assert.fail("checkBadIdFormat failed : " + id);
-  }
-}
diff --git a/foundations/foundation-metrics/src/test/java/org/apache/servicecomb/foundation/metrics/publish/TestMetricNode.java b/foundations/foundation-metrics/src/test/java/org/apache/servicecomb/foundation/metrics/publish/TestMetricNode.java
deleted file mode 100644
index 53427b5..0000000
--- a/foundations/foundation-metrics/src/test/java/org/apache/servicecomb/foundation/metrics/publish/TestMetricNode.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.servicecomb.foundation.metrics.publish;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.concurrent.TimeUnit;
-
-import org.junit.Assert;
-import org.junit.BeforeClass;
-import org.junit.Test;
-
-public class TestMetricNode {
-  private static MetricsLoader loader;
-
-  @BeforeClass
-  public static void steup() {
-    Map<String, Double> metrics = new HashMap<>();
-    metrics.put("X(K1=1,K2=2,K3=3,unit=SECONDS,statistic=A)", 100.0);
-    metrics.put("X(K1=1,K2=2,K3=30000,unit=SECONDS,statistic=AA)", 110.0);
-    metrics.put("X(K1=1,K2=20,K3=30,unit=SECONDS,statistic=B)", 200.0);
-    metrics.put("X(K1=2,K2=200,K3=300,unit=SECONDS,statistic=C)", 300.0);
-    metrics.put("X(K1=2,K2=2000,K3=3000,unit=SECONDS,statistic=D)", 400.0);
-
-    metrics.put("Y(K1=1,K2=2,K3=3)", 500.0);
-    metrics.put("Y(K1=10,K2=20,K3=30)", 600.0);
-    metrics.put("Y(K1=100,K2=200,K3=300)", 700.0);
-    metrics.put("Y(K1=1000,K2=2000,K3=3000)", 800.0);
-
-    loader = new MetricsLoader(metrics);
-  }
-
-  @Test
-  public void checkNodeMetricCount() {
-    MetricNode node = loader.getMetricTree("X", "K1");
-    MetricNode node_k1 = node.getChildrenNode("1");
-    Assert.assertEquals(3, node_k1.getMetricCount());
-  }
-
-  @Test
-  public void checkGetFirstMatchMetricValueWithSingleTag() {
-    MetricNode node = loader.getMetricTree("X", "K1");
-    MetricNode node_k1 = node.getChildrenNode("1");
-    Assert.assertEquals(100, node_k1.getFirstMatchMetricValue("K2", "2"), 0);
-    Assert.assertEquals(100 * 1000, node_k1.getFirstMatchMetricValue(TimeUnit.MILLISECONDS, "K2", "2"), 0);
-    Assert.assertEquals(100 * 1000, node_k1.getFirstMatchMetricValue(TimeUnit.MILLISECONDS, "K2", "2"), 0);
-  }
-
-  @Test
-  public void checkGetFirstMatchMetricValueWithMultiTag() {
-    MetricNode node = loader.getMetricTree("X", "K1");
-    MetricNode node_k1 = node.getChildrenNode("1");
-    Assert.assertEquals(200, node_k1.getFirstMatchMetricValue("K3", "30", "K2", "20"), 0);
-    Assert.assertEquals(200 * 1000, node_k1.getFirstMatchMetricValue(TimeUnit.MILLISECONDS, "K3", "30", "K2", "20"), 0);
-    Assert.assertEquals(110.0, node_k1.getFirstMatchMetricValue("K2", "2", "K3", "30000"), 0);
-    Assert
-        .assertEquals(110 * 1000, node_k1.getFirstMatchMetricValue(TimeUnit.MILLISECONDS, "K2", "2", "K3", "30000"), 0);
-  }
-
-  @Test
-  public void checkGetMatchStatisticMetricValue() {
-    MetricNode node = loader.getMetricTree("X", "K1");
-    MetricNode node_k1 = node.getChildrenNode("1");
-    Assert.assertEquals(100, node_k1.getMatchStatisticMetricValue("A"), 0);
-    Assert.assertEquals(100 * 1000, node_k1.getMatchStatisticMetricValue(TimeUnit.MILLISECONDS, "A"), 0);
-  }
-
-  @Test
-  public void checkGenerateMetricNodeFromExistedNode() {
-    MetricNode node = loader.getMetricTree("X", "K1");
-    MetricNode node_k1 = node.getChildrenNode("1");
-    MetricNode newNode = new MetricNode(node_k1.getMetrics(), "K2", "K3");
-    Assert.assertEquals(1, newNode.getChildrenNode("2").getChildrenNode("3").getMetricCount(), 0);
-  }
-
-  @Test
-  public void testNewMetricNode() {
-    List<Metric> metrics = new ArrayList<>();
-    metrics.add(new Metric("Y(K1=1,K2=2,K3=3)", 1));
-    metrics.add(new Metric("Y(K1=1,K2=20,K3=30)", 10));
-    metrics.add(new Metric("Y(K1=10,K2=20,K3=300)", 100));
-    metrics.add(new Metric("Y(K1=10,K2=20,K3=3000)", 1000));
-
-    MetricNode node = new MetricNode(metrics);
-    Assert.assertEquals(4, node.getMetricCount());
-    Assert.assertEquals(1.0, node.getFirstMatchMetricValue("K3", "3"), 0);
-
-    node = new MetricNode(metrics, "K1");
-    Assert.assertEquals(2, node.getChildrenCount());
-    Assert.assertEquals(1.0, node.getChildren("1").getFirstMatchMetricValue("K3", "3"), 0);
-  }
-}
diff --git a/foundations/foundation-metrics/src/test/java/org/apache/servicecomb/foundation/metrics/publish/TestMetricsLoader.java b/foundations/foundation-metrics/src/test/java/org/apache/servicecomb/foundation/metrics/publish/TestMetricsLoader.java
deleted file mode 100644
index c3eed5e..0000000
--- a/foundations/foundation-metrics/src/test/java/org/apache/servicecomb/foundation/metrics/publish/TestMetricsLoader.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.servicecomb.foundation.metrics.publish;
-
-import java.util.HashMap;
-import java.util.Map;
-
-import org.apache.servicecomb.foundation.common.exceptions.ServiceCombException;
-import org.junit.Assert;
-import org.junit.BeforeClass;
-import org.junit.Rule;
-import org.junit.Test;
-import org.junit.rules.ExpectedException;
-
-public class TestMetricsLoader {
-  private static MetricsLoader loader;
-
-  @BeforeClass
-  public static void setup() {
-    Map<String, Double> metrics = new HashMap<>();
-    metrics.put("X(K1=1,K2=2,K3=3)", 100.0);
-    metrics.put("X(K1=1,K2=20,K3=30)", 200.0);
-    metrics.put("X(K1=2,K2=200,K3=300)", 300.0);
-    metrics.put("X(K1=2,K2=2000,K3=3000)", 400.0);
-
-    metrics.put("Y(K1=1,K2=2,K3=3)", 500.0);
-    metrics.put("Y(K1=10,K2=20,K3=30)", 600.0);
-    metrics.put("Y(K1=100,K2=200,K3=300)", 700.0);
-    metrics.put("Y(K1=1000,K2=2000,K3=3000)", 800.0);
-
-    loader = new MetricsLoader(metrics);
-  }
-
-  @Test
-  public void checkFirstMatchMetricValue() {
-    Assert.assertEquals(200.0, loader.getFirstMatchMetricValue("X", "K3", "30"), 0);
-  }
-
-  @Test
-  public void checkGetChildrenCount() {
-    MetricNode node = loader.getMetricTree("X", "K1");
-    Assert.assertEquals(2, node.getChildrenCount());
-  }
-
-  @Rule
-  public ExpectedException thrown = ExpectedException.none();
-
-  @Test
-  public void checkNoSuchId() {
-    thrown.expect(ServiceCombException.class);
-    loader.getMetricTree("Z");
-    Assert.fail("checkNoSuchId failed");
-  }
-}
diff --git a/metrics/metrics-core/src/main/java/org/apache/servicecomb/metrics/core/AbstractInvocationMetrics.java b/metrics/metrics-core/src/main/java/org/apache/servicecomb/metrics/core/AbstractInvocationMetrics.java
deleted file mode 100644
index 104aa64..0000000
--- a/metrics/metrics-core/src/main/java/org/apache/servicecomb/metrics/core/AbstractInvocationMetrics.java
+++ /dev/null
@@ -1,73 +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.servicecomb.metrics.core;
-
-import java.util.HashMap;
-import java.util.Map;
-import java.util.concurrent.TimeUnit;
-
-import org.apache.commons.lang3.ArrayUtils;
-import org.apache.servicecomb.foundation.metrics.MetricsConst;
-
-import com.netflix.servo.monitor.Counter;
-import com.netflix.servo.monitor.MaxGauge;
-import com.netflix.servo.monitor.StepCounter;
-import com.netflix.servo.monitor.Timer;
-
-abstract class AbstractInvocationMetrics {
-  private final Counter tps;
-
-  private final Counter count;
-
-  private final Map<String, Timer> averageLatencies;
-
-  private final Map<String, MaxGauge> maxLatencies;
-
-  AbstractInvocationMetrics(String... tags) {
-    String[] tagsWithStage = ArrayUtils.addAll(tags, MetricsConst.TAG_STAGE, MetricsConst.STAGE_TOTAL);
-    this.tps = MonitorManager.getInstance().getCounter(StepCounter::new, MetricsConst.SERVICECOMB_INVOCATION,
-        ArrayUtils.addAll(tagsWithStage, MetricsConst.TAG_STATISTIC, "tps"));
-    this.count = MonitorManager.getInstance().getCounter(MetricsConst.SERVICECOMB_INVOCATION,
-        ArrayUtils.addAll(tagsWithStage, MetricsConst.TAG_STATISTIC, "count"));
-
-    this.averageLatencies = new HashMap<>();
-    this.maxLatencies = new HashMap<>();
-    this.addLatencyMonitors(MetricsConst.STAGE_TOTAL, tags);
-  }
-
-  void updateCallMonitors() {
-    tps.increment();
-    count.increment();
-  }
-
-  void updateLatencyMonitors(String stage, long value, TimeUnit unit) {
-    averageLatencies.get(stage).record(value, unit);
-    maxLatencies.get(stage).update(unit.toMillis(value));
-  }
-
-  void addLatencyMonitors(String stage, String... tags) {
-    String[] tagsWithStageAndUnit = ArrayUtils
-        .addAll(tags, MetricsConst.TAG_STAGE, stage, MetricsConst.TAG_UNIT, String.valueOf(TimeUnit.MILLISECONDS));
-    this.averageLatencies.put(stage, MonitorManager.getInstance()
-        .getTimer(MetricsConst.SERVICECOMB_INVOCATION,
-            ArrayUtils.addAll(tagsWithStageAndUnit, MetricsConst.TAG_STATISTIC, "latency")));
-    this.maxLatencies.put(stage, MonitorManager.getInstance()
-        .getMaxGauge(MetricsConst.SERVICECOMB_INVOCATION,
-            ArrayUtils.addAll(tagsWithStageAndUnit, MetricsConst.TAG_STATISTIC, "max")));
-  }
-}
diff --git a/metrics/metrics-core/src/main/java/org/apache/servicecomb/metrics/core/ConsumerInvocationMetrics.java b/metrics/metrics-core/src/main/java/org/apache/servicecomb/metrics/core/ConsumerInvocationMetrics.java
deleted file mode 100644
index c370f79..0000000
--- a/metrics/metrics-core/src/main/java/org/apache/servicecomb/metrics/core/ConsumerInvocationMetrics.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.servicecomb.metrics.core;
-
-import java.util.concurrent.TimeUnit;
-
-import org.apache.servicecomb.foundation.metrics.MetricsConst;
-
-public class ConsumerInvocationMetrics extends AbstractInvocationMetrics {
-  public ConsumerInvocationMetrics(String... tags) {
-    super(tags);
-  }
-
-  public void update(long totalElapsedNanoTime) {
-    this.updateCallMonitors();
-    this.updateLatencyMonitors(MetricsConst.STAGE_TOTAL, totalElapsedNanoTime, TimeUnit.NANOSECONDS);
-  }
-}
diff --git a/metrics/metrics-core/src/main/java/org/apache/servicecomb/metrics/core/InvocationMetricsManager.java b/metrics/metrics-core/src/main/java/org/apache/servicecomb/metrics/core/InvocationMetricsManager.java
deleted file mode 100644
index 887cc71..0000000
--- a/metrics/metrics-core/src/main/java/org/apache/servicecomb/metrics/core/InvocationMetricsManager.java
+++ /dev/null
@@ -1,85 +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.servicecomb.metrics.core;
-
-import java.util.Map;
-
-import org.apache.servicecomb.foundation.common.concurrent.ConcurrentHashMapEx;
-import org.apache.servicecomb.foundation.metrics.MetricsConst;
-import org.apache.servicecomb.swagger.invocation.InvocationType;
-
-import com.netflix.servo.monitor.Counter;
-
-public class InvocationMetricsManager {
-
-  //invocationName -> statusCode -> ConsumerInvocationMetrics
-  private final Map<String, Map<Integer, ConsumerInvocationMetrics>> consumerMetrics;
-
-  //invocationName -> statusCode -> ProducerInvocationMetrics
-  private final Map<String, Map<Integer, ProducerInvocationMetrics>> producerMetrics;
-
-  //invocationName -> Counter
-  private final Map<String, Counter> waitInQueueCounters;
-
-  private static final InvocationMetricsManager INSTANCE = new InvocationMetricsManager();
-
-  public static InvocationMetricsManager getInstance() {
-    return INSTANCE;
-  }
-
-  private InvocationMetricsManager() {
-    this.consumerMetrics = new ConcurrentHashMapEx<>();
-    this.producerMetrics = new ConcurrentHashMapEx<>();
-    this.waitInQueueCounters = new ConcurrentHashMapEx<>();
-  }
-
-  public void incrementWaitInQueue(String invocationName) {
-    updateWaitInQueue(invocationName, 1);
-  }
-
-  public void decrementWaitInQueue(String invocationName) {
-    updateWaitInQueue(invocationName, -1);
-  }
-
-  private void updateWaitInQueue(String invocationName, long value) {
-    waitInQueueCounters.computeIfAbsent(invocationName,
-        f -> MonitorManager.getInstance().getCounter(
-            MetricsConst.SERVICECOMB_INVOCATION, MetricsConst.TAG_OPERATION, invocationName,
-            MetricsConst.TAG_STAGE, MetricsConst.STAGE_QUEUE,
-            MetricsConst.TAG_ROLE, String.valueOf(InvocationType.PRODUCER).toLowerCase(),
-            MetricsConst.TAG_STATISTIC, "waitInQueue")).increment(value);
-  }
-
-  public void updateProducer(String invocationName, int statusCode, long inQueueNanoTime, long executionElapsedNanoTime,
-      long totalElapsedNanoTime) {
-    producerMetrics.computeIfAbsent(invocationName, f -> new ConcurrentHashMapEx<>())
-        .computeIfAbsent(statusCode, f -> new ProducerInvocationMetrics(
-            MetricsConst.TAG_OPERATION, invocationName,
-            MetricsConst.TAG_ROLE, String.valueOf(InvocationType.PRODUCER).toLowerCase(),
-            MetricsConst.TAG_STATUS, String.valueOf(statusCode)))
-        .update(inQueueNanoTime, executionElapsedNanoTime, totalElapsedNanoTime);
-  }
-
-  public void updateConsumer(String invocationName, int statusCode, long totalElapsedNanoTime) {
-    consumerMetrics.computeIfAbsent(invocationName, f -> new ConcurrentHashMapEx<>())
-        .computeIfAbsent(statusCode, f -> new ConsumerInvocationMetrics(
-            MetricsConst.TAG_OPERATION, invocationName,
-            MetricsConst.TAG_ROLE, String.valueOf(InvocationType.CONSUMER).toLowerCase(),
-            MetricsConst.TAG_STATUS, String.valueOf(statusCode))).update(totalElapsedNanoTime);
-  }
-}
diff --git a/metrics/metrics-core/src/main/java/org/apache/servicecomb/metrics/core/MetricsConfig.java b/metrics/metrics-core/src/main/java/org/apache/servicecomb/metrics/core/MetricsConfig.java
deleted file mode 100644
index 2bccfcf..0000000
--- a/metrics/metrics-core/src/main/java/org/apache/servicecomb/metrics/core/MetricsConfig.java
+++ /dev/null
@@ -1,22 +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.servicecomb.metrics.core;
-
-public class MetricsConfig {
-  public static final String METRICS_WINDOW_TIME = "servicecomb.metrics.window_time";
-}
diff --git a/metrics/metrics-core/src/main/java/org/apache/servicecomb/metrics/core/MonitorManager.java b/metrics/metrics-core/src/main/java/org/apache/servicecomb/metrics/core/MonitorManager.java
deleted file mode 100644
index be71b62..0000000
--- a/metrics/metrics-core/src/main/java/org/apache/servicecomb/metrics/core/MonitorManager.java
+++ /dev/null
@@ -1,217 +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.servicecomb.metrics.core;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.Map.Entry;
-import java.util.SortedMap;
-import java.util.TreeMap;
-import java.util.concurrent.Callable;
-import java.util.function.Function;
-
-import org.apache.commons.lang3.StringUtils;
-import org.apache.servicecomb.foundation.common.concurrent.ConcurrentHashMapEx;
-import org.apache.servicecomb.foundation.common.exceptions.ServiceCombException;
-import org.apache.servicecomb.foundation.metrics.MetricsConst;
-
-import com.netflix.config.DynamicPropertyFactory;
-import com.netflix.servo.BasicMonitorRegistry;
-import com.netflix.servo.MonitorRegistry;
-import com.netflix.servo.monitor.BasicCounter;
-import com.netflix.servo.monitor.BasicGauge;
-import com.netflix.servo.monitor.BasicTimer;
-import com.netflix.servo.monitor.Counter;
-import com.netflix.servo.monitor.Gauge;
-import com.netflix.servo.monitor.MaxGauge;
-import com.netflix.servo.monitor.Monitor;
-import com.netflix.servo.monitor.MonitorConfig;
-import com.netflix.servo.monitor.MonitorConfig.Builder;
-import com.netflix.servo.monitor.Timer;
-import com.netflix.servo.tag.Tag;
-import com.netflix.servo.tag.TagList;
-
-public class MonitorManager {
-
-  private final Map<String, Counter> counters;
-
-  private final Map<String, MaxGauge> maxGauges;
-
-  private final Map<String, Gauge<?>> gauges;
-
-  private final Map<String, Timer> timers;
-
-  private final MonitorRegistry basicMonitorRegistry;
-
-  private static final char[] forbiddenCharacter = new char[] {'(', ')', '=', ','};
-
-  private static final MonitorManager INSTANCE = new MonitorManager();
-
-  public static MonitorManager getInstance() {
-    return INSTANCE;
-  }
-
-  private MonitorManager() {
-    this.counters = new ConcurrentHashMapEx<>();
-    this.maxGauges = new ConcurrentHashMapEx<>();
-    this.gauges = new ConcurrentHashMapEx<>();
-    this.timers = new ConcurrentHashMapEx<>();
-    this.basicMonitorRegistry = new BasicMonitorRegistry();
-    setupWindowTime();
-    registerSystemMetrics();
-  }
-
-  private void setupWindowTime() {
-    int time = DynamicPropertyFactory.getInstance().getIntProperty(MetricsConfig.METRICS_WINDOW_TIME, 5000).get();
-    System.getProperties().setProperty("servo.pollers", time > 0 ? String.valueOf(time) : "5000");
-  }
-
-  public Counter getCounter(String name, String... tags) {
-    validateMonitorNameAndTags(name, tags);
-    return counters.computeIfAbsent(getMonitorKey(name, tags), f -> {
-      Counter counter = new BasicCounter(getConfig(name, tags));
-      basicMonitorRegistry.register(counter);
-      return counter;
-    });
-  }
-
-  public Counter getCounter(Function<MonitorConfig, Counter> function, String name, String... tags) {
-    validateMonitorNameAndTags(name, tags);
-    return counters.computeIfAbsent(getMonitorKey(name, tags), f -> {
-      Counter counter = function.apply(getConfig(name, tags));
-      basicMonitorRegistry.register(counter);
-      return counter;
-    });
-  }
-
-  public MaxGauge getMaxGauge(String name, String... tags) {
-    validateMonitorNameAndTags(name, tags);
-    return maxGauges.computeIfAbsent(getMonitorKey(name, tags), f -> {
-      MaxGauge maxGauge = new MaxGauge(getConfig(name, tags));
-      basicMonitorRegistry.register(maxGauge);
-      return maxGauge;
-    });
-  }
-
-  public <V extends Number> Gauge<?> getGauge(Callable<V> callable, String name, String... tags) {
-    validateMonitorNameAndTags(name, tags);
-    return gauges.computeIfAbsent(getMonitorKey(name, tags), f -> {
-      Gauge<?> gauge = new BasicGauge<>(getConfig(name, tags), callable);
-      basicMonitorRegistry.register(gauge);
-      return gauge;
-    });
-  }
-
-  public Timer getTimer(String name, String... tags) {
-    validateMonitorNameAndTags(name, tags);
-    return timers.computeIfAbsent(getMonitorKey(name, tags), f -> {
-      Timer timer = new BasicTimer(getConfig(name, tags));
-      basicMonitorRegistry.register(timer);
-      return timer;
-    });
-  }
-
-  public Map<String, Double> measure() {
-    Map<String, Double> measurements = new HashMap<>();
-    for (Monitor<?> monitor : basicMonitorRegistry.getRegisteredMonitors()) {
-      measurements.put(getMonitorKey(monitor.getConfig()),
-          ((Number) monitor.getValue(0)).doubleValue());
-    }
-    return measurements;
-  }
-
-  private MonitorConfig getConfig(String name, String... tags) {
-    validateMonitorNameAndTags(name, tags);
-    Builder builder = MonitorConfig.builder(name);
-    for (int i = 0; i < tags.length; i += 2) {
-      builder.withTag(tags[i], tags[i + 1]);
-    }
-    return builder.build();
-  }
-
-  private String getMonitorKey(String name, String... tags) {
-    validateMonitorNameAndTags(name, tags);
-    if (tags.length != 0) {
-      SortedMap<String, String> tagMap = new TreeMap<>();
-      for (int i = 0; i < tags.length; i += 2) {
-        tagMap.put(tags[i], tags[i + 1]);
-      }
-      StringBuilder builder = new StringBuilder("(");
-      for (Entry<String, String> entry : tagMap.entrySet()) {
-        builder.append(String.format("%s=%s,", entry.getKey(), entry.getValue()));
-      }
-      builder.deleteCharAt(builder.length() - 1);
-      builder.append(")");
-      return name + builder.toString();
-    }
-    return name;
-  }
-
-  private String getMonitorKey(MonitorConfig config) {
-    TagList tagList = config.getTags();
-    List<String> tags = new ArrayList<>();
-    for (Tag tag : tagList) {
-      if (!"type".equals(tag.getKey())) {
-        tags.add(tag.getKey());
-        tags.add(tag.getValue());
-      }
-    }
-    return getMonitorKey(config.getName(), tags.toArray(new String[0]));
-  }
-
-
-  private void registerSystemMetrics() {
-    SystemMetrics resource = new SystemMetrics();
-    registerSystemMetricItem(resource::getCpuLoad, "cpuLoad");
-    registerSystemMetricItem(resource::getCpuRunningThreads, "cpuRunningThreads");
-    registerSystemMetricItem(resource::getHeapInit, "heapInit");
-    registerSystemMetricItem(resource::getHeapCommit, "heapCommit");
-    registerSystemMetricItem(resource::getHeapUsed, "heapUsed");
-    registerSystemMetricItem(resource::getHeapMax, "heapMax");
-    registerSystemMetricItem(resource::getNonHeapInit, "nonHeapInit");
-    registerSystemMetricItem(resource::getNonHeapCommit, "nonHeapCommit");
-    registerSystemMetricItem(resource::getNonHeapUsed, "nonHeapUsed");
-    registerSystemMetricItem(resource::getNonHeapMax, "nonHeapMax");
-  }
-
-  private <V extends Number> void registerSystemMetricItem(Callable<V> callable, String name) {
-    this.getGauge(callable, MetricsConst.JVM, MetricsConst.TAG_STATISTIC, "gauge", MetricsConst.TAG_NAME, name);
-  }
-
-  private void validateMonitorNameAndTags(String name, String... tags) {
-    boolean passed = StringUtils.isNotEmpty(name) && tags.length % 2 == 0;
-    if (passed) {
-      if (StringUtils.containsNone(name, forbiddenCharacter)) {
-        for (String tag : tags) {
-          if (StringUtils.containsAny(tag, forbiddenCharacter)) {
-            throw new ServiceCombException(
-                "validate name and tags failed name = " + name + " tags = " + String.join(",", tags));
-          }
-        }
-      } else {
-        throw new ServiceCombException(
-            "validate name and tags failed name = " + name + " tags = " + String.join(",", tags));
-      }
-    } else {
-      throw new ServiceCombException(
-          "validate name and tags failed name = " + name + " tags = " + String.join(",", tags));
-    }
-  }
-}
\ No newline at end of file
diff --git a/metrics/metrics-core/src/main/java/org/apache/servicecomb/metrics/core/ProducerInvocationMetrics.java b/metrics/metrics-core/src/main/java/org/apache/servicecomb/metrics/core/ProducerInvocationMetrics.java
deleted file mode 100644
index c869be0..0000000
--- a/metrics/metrics-core/src/main/java/org/apache/servicecomb/metrics/core/ProducerInvocationMetrics.java
+++ /dev/null
@@ -1,37 +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.servicecomb.metrics.core;
-
-import java.util.concurrent.TimeUnit;
-
-import org.apache.servicecomb.foundation.metrics.MetricsConst;
-
-public class ProducerInvocationMetrics extends AbstractInvocationMetrics {
-  public ProducerInvocationMetrics(String... tags) {
-    super(tags);
-    this.addLatencyMonitors(MetricsConst.STAGE_QUEUE, tags);
-    this.addLatencyMonitors(MetricsConst.STAGE_EXECUTION, tags);
-  }
-
-  public void update(long inQueueNanoTime, long executionElapsedNanoTime, long totalElapsedNanoTime) {
-    this.updateCallMonitors();
-    this.updateLatencyMonitors(MetricsConst.STAGE_QUEUE, inQueueNanoTime, TimeUnit.NANOSECONDS);
-    this.updateLatencyMonitors(MetricsConst.STAGE_EXECUTION, executionElapsedNanoTime, TimeUnit.NANOSECONDS);
-    this.updateLatencyMonitors(MetricsConst.STAGE_TOTAL, totalElapsedNanoTime, TimeUnit.NANOSECONDS);
-  }
-}
diff --git a/metrics/metrics-core/src/main/java/org/apache/servicecomb/metrics/core/event/InvocationFinishedEventListener.java b/metrics/metrics-core/src/main/java/org/apache/servicecomb/metrics/core/event/InvocationFinishedEventListener.java
deleted file mode 100644
index 51edc6b..0000000
--- a/metrics/metrics-core/src/main/java/org/apache/servicecomb/metrics/core/event/InvocationFinishedEventListener.java
+++ /dev/null
@@ -1,41 +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.servicecomb.metrics.core.event;
-
-import org.apache.servicecomb.core.metrics.InvocationFinishedEvent;
-import org.apache.servicecomb.foundation.common.event.EventListener;
-import org.apache.servicecomb.metrics.core.InvocationMetricsManager;
-import org.apache.servicecomb.swagger.invocation.InvocationType;
-
-public class InvocationFinishedEventListener implements EventListener<InvocationFinishedEvent> {
-  @Override
-  public Class<InvocationFinishedEvent> getEventClass() {
-    return InvocationFinishedEvent.class;
-  }
-
-  @Override
-  public void process(InvocationFinishedEvent data) {
-    if (InvocationType.PRODUCER.equals(data.getInvocationType())) {
-      InvocationMetricsManager.getInstance().updateProducer(data.getOperationName(), data.getStatusCode(),
-          data.getInQueueNanoTime(), data.getExecutionElapsedNanoTime(), data.getTotalElapsedNanoTime());
-    } else {
-      InvocationMetricsManager.getInstance().updateConsumer(data.getOperationName(), data.getStatusCode(),
-          data.getTotalElapsedNanoTime());
-    }
-  }
-}
diff --git a/metrics/metrics-core/src/main/java/org/apache/servicecomb/metrics/core/event/InvocationStartExecutionEventListener.java b/metrics/metrics-core/src/main/java/org/apache/servicecomb/metrics/core/event/InvocationStartExecutionEventListener.java
deleted file mode 100644
index 89ff1b5..0000000
--- a/metrics/metrics-core/src/main/java/org/apache/servicecomb/metrics/core/event/InvocationStartExecutionEventListener.java
+++ /dev/null
@@ -1,34 +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.servicecomb.metrics.core.event;
-
-import org.apache.servicecomb.core.metrics.InvocationStartExecutionEvent;
-import org.apache.servicecomb.foundation.common.event.EventListener;
-import org.apache.servicecomb.metrics.core.InvocationMetricsManager;
-
-public class InvocationStartExecutionEventListener implements EventListener<InvocationStartExecutionEvent> {
-  @Override
-  public Class<InvocationStartExecutionEvent> getEventClass() {
-    return InvocationStartExecutionEvent.class;
-  }
-
-  @Override
-  public void process(InvocationStartExecutionEvent data) {
-    InvocationMetricsManager.getInstance().decrementWaitInQueue(data.getOperationName());
-  }
-}
diff --git a/metrics/metrics-core/src/main/java/org/apache/servicecomb/metrics/core/event/InvocationStartedEventListener.java b/metrics/metrics-core/src/main/java/org/apache/servicecomb/metrics/core/event/InvocationStartedEventListener.java
deleted file mode 100644
index 117387b..0000000
--- a/metrics/metrics-core/src/main/java/org/apache/servicecomb/metrics/core/event/InvocationStartedEventListener.java
+++ /dev/null
@@ -1,37 +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.servicecomb.metrics.core.event;
-
-import org.apache.servicecomb.core.metrics.InvocationStartedEvent;
-import org.apache.servicecomb.foundation.common.event.EventListener;
-import org.apache.servicecomb.metrics.core.InvocationMetricsManager;
-import org.apache.servicecomb.swagger.invocation.InvocationType;
-
-public class InvocationStartedEventListener implements EventListener<InvocationStartedEvent> {
-  @Override
-  public Class<InvocationStartedEvent> getEventClass() {
-    return InvocationStartedEvent.class;
-  }
-
-  @Override
-  public void process(InvocationStartedEvent data) {
-    if (InvocationType.PRODUCER.equals(data.getInvocationType())) {
-      InvocationMetricsManager.getInstance().incrementWaitInQueue(data.getOperationName());
-    }
-  }
-}
diff --git a/metrics/metrics-core/src/test/java/org/apache/servicecomb/metrics/core/TestAnMonitorManager.java b/metrics/metrics-core/src/test/java/org/apache/servicecomb/metrics/core/TestAnMonitorManager.java
deleted file mode 100644
index 0fe669a..0000000
--- a/metrics/metrics-core/src/test/java/org/apache/servicecomb/metrics/core/TestAnMonitorManager.java
+++ /dev/null
@@ -1,321 +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.servicecomb.metrics.core;
-
-import java.util.Map;
-import java.util.concurrent.TimeUnit;
-
-import org.apache.servicecomb.core.metrics.InvocationFinishedEvent;
-import org.apache.servicecomb.core.metrics.InvocationStartExecutionEvent;
-import org.apache.servicecomb.core.metrics.InvocationStartedEvent;
-import org.apache.servicecomb.foundation.common.event.EventBus;
-import org.apache.servicecomb.foundation.common.exceptions.ServiceCombException;
-import org.apache.servicecomb.foundation.metrics.MetricsConst;
-import org.apache.servicecomb.foundation.metrics.publish.MetricNode;
-import org.apache.servicecomb.foundation.metrics.publish.MetricsLoader;
-import org.apache.servicecomb.swagger.invocation.InvocationType;
-import org.junit.Assert;
-import org.junit.BeforeClass;
-import org.junit.Rule;
-import org.junit.Test;
-import org.junit.rules.ExpectedException;
-
-import com.netflix.servo.monitor.Counter;
-
-public class TestAnMonitorManager {
-
-  private static MetricsLoader currentWindowMetricsLoader;
-
-  //  private static MetricsLoader nextWindowMetricsLoader;
-
-  @BeforeClass
-  public static void setup() throws InterruptedException {
-    System.getProperties().setProperty(MetricsConfig.METRICS_WINDOW_TIME, "2000");
-
-    //==========================================================================
-    //fun1 is a PRODUCER invocation call 2 time and all is completed
-    //two time success
-    EventBus.getInstance().triggerEvent(new InvocationStartedEvent("fun1", InvocationType.PRODUCER, System.nanoTime()));
-    EventBus.getInstance().triggerEvent(new InvocationStartExecutionEvent("fun1"));
-    EventBus.getInstance()
-        .triggerEvent(new InvocationFinishedEvent("fun1", InvocationType.PRODUCER, TimeUnit.MILLISECONDS.toNanos(100),
-            TimeUnit.MILLISECONDS.toNanos(200), TimeUnit.MILLISECONDS.toNanos(300), 200));
-
-    EventBus.getInstance().triggerEvent(new InvocationStartedEvent("fun1", InvocationType.PRODUCER, System.nanoTime()));
-    EventBus.getInstance().triggerEvent(new InvocationStartExecutionEvent("fun1"));
-    EventBus.getInstance()
-        .triggerEvent(new InvocationFinishedEvent("fun1", InvocationType.PRODUCER, TimeUnit.MILLISECONDS.toNanos(300),
-            TimeUnit.MILLISECONDS.toNanos(400), TimeUnit.MILLISECONDS.toNanos(700), 200));
-
-    EventBus.getInstance().triggerEvent(new InvocationStartedEvent("fun1", InvocationType.PRODUCER, System.nanoTime()));
-    EventBus.getInstance().triggerEvent(new InvocationStartExecutionEvent("fun1"));
-    EventBus.getInstance()
-        .triggerEvent(new InvocationFinishedEvent("fun1", InvocationType.PRODUCER, TimeUnit.MILLISECONDS.toNanos(300),
-            TimeUnit.MILLISECONDS.toNanos(400), TimeUnit.MILLISECONDS.toNanos(700), 500));
-
-    //==========================================================================
-    //fun2 is a CONSUMER invocation call once and completed
-    EventBus.getInstance()
-        .triggerEvent(new InvocationFinishedEvent("fun2", InvocationType.CONSUMER, 0, 0,
-            TimeUnit.MILLISECONDS.toNanos(300), 200));
-
-    //==========================================================================
-    //fun3 is a PRODUCER invocation call uncompleted
-    EventBus.getInstance().triggerEvent(new InvocationStartedEvent("fun3", InvocationType.PRODUCER, System.nanoTime()));
-    EventBus.getInstance().triggerEvent(new InvocationStartExecutionEvent("fun3"));
-
-    //==========================================================================
-    //fun4 is a PRODUCER call only started and no processing start and finished
-    EventBus.getInstance().triggerEvent(new InvocationStartedEvent("fun4", InvocationType.PRODUCER, System.nanoTime()));
-
-    Map<String, Double> metrics = MonitorManager.getInstance().measure();
-    currentWindowMetricsLoader = new MetricsLoader(metrics);
-
-    //sim at lease one window time
-    Thread.sleep(2000);
-
-    metrics = MonitorManager.getInstance().measure();
-//    nextWindowMetricsLoader = new MetricsLoader(metrics);
-  }
-
-  @Test
-  public void checkFun1WaitInQueue() {
-    MetricNode node = currentWindowMetricsLoader
-        .getMetricTree(MetricsConst.SERVICECOMB_INVOCATION, MetricsConst.TAG_OPERATION, MetricsConst.TAG_ROLE,
-            MetricsConst.TAG_STAGE);
-    MetricNode node1_queue = node.getChildrenNode("fun1")
-        .getChildrenNode(String.valueOf(InvocationType.PRODUCER).toLowerCase())
-        .getChildrenNode(MetricsConst.STAGE_QUEUE);
-    Assert.assertEquals(0, node1_queue.getMatchStatisticMetricValue("waitInQueue"), 0);
-  }
-
-  @Test
-  public void checkFun1Latency() {
-    MetricNode node = currentWindowMetricsLoader
-        .getMetricTree(MetricsConst.SERVICECOMB_INVOCATION, MetricsConst.TAG_OPERATION, MetricsConst.TAG_ROLE,
-            MetricsConst.TAG_STAGE);
-    MetricNode node1_queue = node.getChildrenNode("fun1")
-        .getChildrenNode(String.valueOf(InvocationType.PRODUCER).toLowerCase())
-        .getChildrenNode(MetricsConst.STAGE_QUEUE);
-    MetricNode node1_queue_status = new MetricNode(node1_queue.getMetrics(), MetricsConst.TAG_STATUS);
-    Assert.assertEquals(200,
-        node1_queue_status.getChildrenNode("200").getMatchStatisticMetricValue(TimeUnit.MILLISECONDS, "latency"), 0);
-    Assert.assertEquals(300,
-        node1_queue_status.getChildrenNode("500").getMatchStatisticMetricValue(TimeUnit.MILLISECONDS, "latency"), 0);
-
-    MetricNode node1_exec = node.getChildrenNode("fun1")
-        .getChildrenNode(String.valueOf(InvocationType.PRODUCER).toLowerCase())
-        .getChildrenNode(MetricsConst.STAGE_EXECUTION);
-    MetricNode node1_exec_status = new MetricNode(node1_exec.getMetrics(), MetricsConst.TAG_STATUS);
-    Assert.assertEquals(300,
-        node1_exec_status.getChildrenNode("200").getMatchStatisticMetricValue(TimeUnit.MILLISECONDS, "latency"), 0);
-    Assert.assertEquals(400,
-        node1_exec_status.getChildrenNode("500").getMatchStatisticMetricValue(TimeUnit.MILLISECONDS, "latency"), 0);
-
-    MetricNode node1_whole = node.getChildrenNode("fun1")
-        .getChildrenNode(String.valueOf(InvocationType.PRODUCER).toLowerCase())
-        .getChildrenNode(MetricsConst.STAGE_TOTAL);
-    MetricNode node1_whole_status = new MetricNode(node1_whole.getMetrics(), MetricsConst.TAG_STATUS);
-    Assert.assertEquals(500,
-        node1_whole_status.getChildrenNode("200").getMatchStatisticMetricValue(TimeUnit.MILLISECONDS, "latency"), 0);
-    Assert.assertEquals(700,
-        node1_whole_status.getChildrenNode("500").getMatchStatisticMetricValue(TimeUnit.MILLISECONDS, "latency"), 0);
-  }
-
-  @Test
-  public void checkFun1Count() {
-    MetricNode node = currentWindowMetricsLoader
-        .getMetricTree(MetricsConst.SERVICECOMB_INVOCATION, MetricsConst.TAG_OPERATION, MetricsConst.TAG_ROLE,
-            MetricsConst.TAG_STAGE);
-    MetricNode node1_whole = node.getChildrenNode("fun1")
-        .getChildrenNode(String.valueOf(InvocationType.PRODUCER).toLowerCase())
-        .getChildrenNode(MetricsConst.STAGE_TOTAL);
-    MetricNode node1_whole_status = new MetricNode(node1_whole.getMetrics(), MetricsConst.TAG_STATUS);
-    Assert.assertEquals(2, node1_whole_status.getChildrenNode("200").getMatchStatisticMetricValue("count"), 0);
-    Assert.assertEquals(1, node1_whole_status.getChildrenNode("500").getMatchStatisticMetricValue("count"), 0);
-  }
-
-  @Test
-  public void checkFun1Max() {
-    //    MetricNode node = nextWindowMetricsLoader
-    //        .getMetricTree(MetricsConst.SERVICECOMB_INVOCATION, MetricsConst.TAG_OPERATION, MetricsConst.TAG_ROLE,
-    //            MetricsConst.TAG_STAGE);
-    //    MetricNode node1_queue = node.getChildrenNode("fun1")
-    //        .getChildrenNode(String.valueOf(InvocationType.PRODUCER).toLowerCase())
-    //        .getChildrenNode(MetricsConst.STAGE_QUEUE);
-    //    MetricNode node1_queue_status = new MetricNode(node1_queue.getMetrics(), MetricsConst.TAG_STATUS);
-    //    Assert.assertEquals(300,
-    //        node1_queue_status.getChildrenNode("200").getMatchStatisticMetricValue(TimeUnit.MILLISECONDS, "max"), 0);
-    //    Assert.assertEquals(300,
-    //        node1_queue_status.getChildrenNode("500").getMatchStatisticMetricValue(TimeUnit.MILLISECONDS, "max"), 0);
-    //
-    //    MetricNode node1_exec = node.getChildrenNode("fun1")
-    //        .getChildrenNode(String.valueOf(InvocationType.PRODUCER).toLowerCase())
-    //        .getChildrenNode(MetricsConst.STAGE_EXECUTION);
-    //    MetricNode node1_exec_status = new MetricNode(node1_exec.getMetrics(), MetricsConst.TAG_STATUS);
-    //    Assert.assertEquals(400,
-    //        node1_exec_status.getChildrenNode("200").getMatchStatisticMetricValue(TimeUnit.MILLISECONDS, "max"), 0);
-    //    Assert.assertEquals(400,
-    //        node1_exec_status.getChildrenNode("500").getMatchStatisticMetricValue(TimeUnit.MILLISECONDS, "max"), 0);
-    //
-    //    MetricNode node1_whole = node.getChildrenNode("fun1")
-    //        .getChildrenNode(String.valueOf(InvocationType.PRODUCER).toLowerCase())
-    //        .getChildrenNode(MetricsConst.STAGE_TOTAL);
-    //    MetricNode node1_whole_status = new MetricNode(node1_whole.getMetrics(), MetricsConst.TAG_STATUS);
-    //    Assert.assertEquals(700,
-    //        node1_whole_status.getChildrenNode("200").getMatchStatisticMetricValue(TimeUnit.MILLISECONDS, "max"), 0);
-    //    Assert.assertEquals(700,
-    //        node1_whole_status.getChildrenNode("500").getMatchStatisticMetricValue(TimeUnit.MILLISECONDS, "max"), 0);
-  }
-
-  @Test
-  public void checkFun1Tps() {
-    //    MetricNode node = nextWindowMetricsLoader
-    //        .getMetricTree(MetricsConst.SERVICECOMB_INVOCATION, MetricsConst.TAG_OPERATION, MetricsConst.TAG_ROLE,
-    //            MetricsConst.TAG_STAGE);
-    //    MetricNode node1_whole = node.getChildrenNode("fun1")
-    //        .getChildrenNode(String.valueOf(InvocationType.PRODUCER).toLowerCase())
-    //        .getChildrenNode(MetricsConst.STAGE_TOTAL);
-    //    MetricNode node1_whole_status = new MetricNode(node1_whole.getMetrics(), MetricsConst.TAG_STATUS);
-    //    Assert.assertEquals(1, node1_whole_status.getChildrenNode("200").getMatchStatisticMetricValue("tps"), 0);
-    //    Assert.assertEquals(0.5, node1_whole_status.getChildrenNode("500").getMatchStatisticMetricValue("tps"), 0);
-  }
-
-  @Test
-  public void checkFun2Latency() {
-    MetricNode node = currentWindowMetricsLoader
-        .getMetricTree(MetricsConst.SERVICECOMB_INVOCATION, MetricsConst.TAG_OPERATION, MetricsConst.TAG_ROLE,
-            MetricsConst.TAG_STAGE);
-    MetricNode node2_whole = node.getChildrenNode("fun2")
-        .getChildrenNode(String.valueOf(InvocationType.CONSUMER).toLowerCase())
-        .getChildrenNode(MetricsConst.STAGE_TOTAL);
-    MetricNode node2_whole_status = new MetricNode(node2_whole.getMetrics(), MetricsConst.TAG_STATUS);
-    Assert.assertEquals(300,
-        node2_whole_status.getChildrenNode("200").getMatchStatisticMetricValue(TimeUnit.MILLISECONDS, "latency"), 0);
-  }
-
-  @Test
-  public void checkFun2Count() {
-    MetricNode node = currentWindowMetricsLoader
-        .getMetricTree(MetricsConst.SERVICECOMB_INVOCATION, MetricsConst.TAG_OPERATION, MetricsConst.TAG_ROLE,
-            MetricsConst.TAG_STAGE);
-    MetricNode node2_whole = node.getChildrenNode("fun2")
-        .getChildrenNode(String.valueOf(InvocationType.CONSUMER).toLowerCase())
-        .getChildrenNode(MetricsConst.STAGE_TOTAL);
-    MetricNode node2_whole_status = new MetricNode(node2_whole.getMetrics(), MetricsConst.TAG_STATUS);
-    Assert.assertEquals(1, node2_whole_status.getChildrenNode("200").getMatchStatisticMetricValue("count"), 0);
-  }
-
-  @Test
-  public void checkFun2Tps() {
-    //    MetricNode node = nextWindowMetricsLoader
-    //        .getMetricTree(MetricsConst.SERVICECOMB_INVOCATION, MetricsConst.TAG_OPERATION, MetricsConst.TAG_ROLE,
-    //            MetricsConst.TAG_STAGE);
-    //    MetricNode node2_whole = node.getChildrenNode("fun2")
-    //        .getChildrenNode(String.valueOf(InvocationType.CONSUMER).toLowerCase())
-    //        .getChildrenNode(MetricsConst.STAGE_TOTAL);
-    //    MetricNode node2_whole_status = new MetricNode(node2_whole.getMetrics(), MetricsConst.TAG_STATUS);
-    //    Assert.assertEquals(0.5, node2_whole_status.getChildrenNode("200").getMatchStatisticMetricValue("tps"), 0);
-  }
-
-  @Test
-  public void checkFun2Max() {
-    //    MetricNode node = nextWindowMetricsLoader
-    //        .getMetricTree(MetricsConst.SERVICECOMB_INVOCATION, MetricsConst.TAG_OPERATION, MetricsConst.TAG_ROLE,
-    //            MetricsConst.TAG_STAGE);
-    //    MetricNode node2_whole = node.getChildrenNode("fun2")
-    //        .getChildrenNode(String.valueOf(InvocationType.CONSUMER).toLowerCase())
-    //        .getChildrenNode(MetricsConst.STAGE_TOTAL);
-    //    MetricNode node2_whole_status = new MetricNode(node2_whole.getMetrics(), MetricsConst.TAG_STATUS);
-    //    Assert.assertEquals(300,
-    //        node2_whole_status.getChildrenNode("200").getMatchStatisticMetricValue(TimeUnit.MILLISECONDS, "max"), 0);
-  }
-
-  @Test
-  public void checkFun3WaitInQueue() {
-    MetricNode node = currentWindowMetricsLoader
-        .getMetricTree(MetricsConst.SERVICECOMB_INVOCATION, MetricsConst.TAG_OPERATION, MetricsConst.TAG_ROLE,
-            MetricsConst.TAG_STAGE);
-    MetricNode node3_queue = node.getChildrenNode("fun3")
-        .getChildrenNode(String.valueOf(InvocationType.PRODUCER).toLowerCase())
-        .getChildrenNode(MetricsConst.STAGE_QUEUE);
-    Assert.assertEquals(0, node3_queue.getMatchStatisticMetricValue("waitInQueue"), 0);
-  }
-
-  @Test
-  public void checkFun4WaitInQueue() {
-    MetricNode node = currentWindowMetricsLoader
-        .getMetricTree(MetricsConst.SERVICECOMB_INVOCATION, MetricsConst.TAG_OPERATION, MetricsConst.TAG_ROLE,
-            MetricsConst.TAG_STAGE);
-    MetricNode node4_queue = node.getChildrenNode("fun4")
-        .getChildrenNode(String.valueOf(InvocationType.PRODUCER).toLowerCase())
-        .getChildrenNode(MetricsConst.STAGE_QUEUE);
-    Assert.assertEquals(1, node4_queue.getMatchStatisticMetricValue("waitInQueue"), 0);
-  }
-
-  @Test
-  public void checkRegisterMonitorWithoutAnyTags() {
-    Counter counter = MonitorManager.getInstance().getCounter("MonitorWithoutAnyTag");
-    counter.increment(999);
-    Assert.assertTrue(MonitorManager.getInstance().measure().containsKey("MonitorWithoutAnyTag"));
-    Assert.assertEquals(999, MonitorManager.getInstance().measure().get("MonitorWithoutAnyTag"), 0);
-  }
-
-  @Rule
-  public ExpectedException thrown = ExpectedException.none();
-
-  @Test
-  public void checkRegisterMonitor() {
-    MonitorManager.getInstance().getCounter("Monitor", "X", "Y");
-  }
-
-  @Test
-  public void checkRegisterMonitorWithBadTags() {
-    thrown.expect(ServiceCombException.class);
-    MonitorManager.getInstance().getCounter("MonitorWithBadCountTag", "X");
-    Assert.fail("checkRegisterMonitorWithBadTags failed");
-  }
-
-  @Test
-  public void checkRegisterMonitorWithBadNameAndTags_ContainLeftParenthesisChar() {
-    thrown.expect(ServiceCombException.class);
-    MonitorManager.getInstance().getCounter("MonitorWithBad(");
-    Assert.fail("checkRegisterMonitorWithBadTags failed : MonitorWithBad(");
-  }
-
-  @Test
-  public void checkRegisterMonitorWithBadNameAndTags_ContainCommaChar() {
-    thrown.expect(ServiceCombException.class);
-    MonitorManager.getInstance().getCounter("MonitorWithBad,");
-    Assert.fail("checkRegisterMonitorWithBadTags failed : MonitorWithBad,");
-  }
-
-  @Test
-  public void checkRegisterMonitorWithBadNameAndTags_ContainEqualChar() {
-    thrown.expect(ServiceCombException.class);
-    MonitorManager.getInstance().getCounter("MonitorWithBad", "TagX=", "Y");
-    Assert.fail("checkRegisterMonitorWithBadTags failed : name = MonitorWithBad, tags = TagX=,Y");
-  }
-
-  @Test
-  public void checkRegisterMonitorWithBadNameAndTags_ContainRightParenthesisChar() {
-    thrown.expect(ServiceCombException.class);
-    MonitorManager.getInstance().getCounter("MonitorWithBad", "TagX", "Y)");
-    Assert.fail("checkRegisterMonitorWithBadTags failed : name = MonitorWithBad, tags = TagX,Y)");
-  }
-}
\ No newline at end of file

-- 
To stop receiving notification emails like this one, please contact
wujimin@apache.org.