zhengyangyong closed pull request #540: [SCB-320] Feature adjustment for 
1.0.0-m1 publish
URL: https://github.com/apache/incubator-servicecomb-java-chassis/pull/540
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git 
a/common/common-rest/src/main/java/org/apache/servicecomb/common/rest/AbstractRestInvocation.java
 
b/common/common-rest/src/main/java/org/apache/servicecomb/common/rest/AbstractRestInvocation.java
index 5e8743678..dd102161b 100644
--- 
a/common/common-rest/src/main/java/org/apache/servicecomb/common/rest/AbstractRestInvocation.java
+++ 
b/common/common-rest/src/main/java/org/apache/servicecomb/common/rest/AbstractRestInvocation.java
@@ -39,7 +39,7 @@
 import org.apache.servicecomb.core.definition.MicroserviceMeta;
 import org.apache.servicecomb.core.definition.OperationMeta;
 import org.apache.servicecomb.core.metrics.InvocationStartedEvent;
-import org.apache.servicecomb.foundation.common.utils.EventUtils;
+import org.apache.servicecomb.foundation.common.event.EventManager;
 import org.apache.servicecomb.foundation.common.utils.JsonUtils;
 import org.apache.servicecomb.foundation.vertx.http.HttpServletRequestEx;
 import org.apache.servicecomb.foundation.vertx.http.HttpServletResponseEx;
@@ -116,7 +116,7 @@ protected void scheduleInvocation() {
 
     InvocationStartedEvent startedEvent = new 
InvocationStartedEvent(operationMeta.getMicroserviceQualifiedName(),
         InvocationType.PRODUCER, System.nanoTime());
-    EventUtils.triggerEvent(startedEvent);
+    EventManager.post(startedEvent);
 
     operationMeta.getExecutor().execute(() -> {
       synchronized (this.requestEx) {
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 96a84b901..83f0d111d 100644
--- a/core/src/main/java/org/apache/servicecomb/core/Invocation.java
+++ b/core/src/main/java/org/apache/servicecomb/core/Invocation.java
@@ -27,7 +27,7 @@
 import org.apache.servicecomb.core.metrics.InvocationFinishedEvent;
 import org.apache.servicecomb.core.metrics.InvocationStartProcessingEvent;
 import org.apache.servicecomb.core.provider.consumer.ReferenceConfig;
-import org.apache.servicecomb.foundation.common.utils.EventUtils;
+import org.apache.servicecomb.foundation.common.event.EventManager;
 import org.apache.servicecomb.swagger.invocation.AsyncResponse;
 import org.apache.servicecomb.swagger.invocation.InvocationType;
 import org.apache.servicecomb.swagger.invocation.SwaggerInvocation;
@@ -187,16 +187,15 @@ public String getMicroserviceQualifiedName() {
 
   public void triggerStartProcessingEvent() {
     this.startProcessingTime = System.nanoTime();
-    EventUtils.triggerEvent(new InvocationStartProcessingEvent(
+    EventManager.post(new InvocationStartProcessingEvent(
         operationMeta.getMicroserviceQualifiedName(), this.invocationType, 
startProcessingTime - startTime));
   }
 
   public void triggerFinishedEvent(int statusCode, boolean success) {
     long finishedTime = System.nanoTime();
-    EventUtils
-        .triggerEvent(new 
InvocationFinishedEvent(operationMeta.getMicroserviceQualifiedName(),
-            this.invocationType, finishedTime - startProcessingTime,
-            finishedTime - startTime, statusCode, success));
+    EventManager.post(new 
InvocationFinishedEvent(operationMeta.getMicroserviceQualifiedName(),
+        this.invocationType, finishedTime - startProcessingTime,
+        finishedTime - startTime, statusCode, success));
   }
 
   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
index 4de6154e0..dbcfbde49 100644
--- 
a/core/src/main/java/org/apache/servicecomb/core/metrics/InvocationFinishedEvent.java
+++ 
b/core/src/main/java/org/apache/servicecomb/core/metrics/InvocationFinishedEvent.java
@@ -17,10 +17,9 @@
 
 package org.apache.servicecomb.core.metrics;
 
-import org.apache.servicecomb.foundation.common.event.Event;
 import org.apache.servicecomb.swagger.invocation.InvocationType;
 
-public class InvocationFinishedEvent implements Event {
+public class InvocationFinishedEvent {
   private final String operationName;
 
   private final InvocationType invocationType;
diff --git 
a/core/src/main/java/org/apache/servicecomb/core/metrics/InvocationStartProcessingEvent.java
 
b/core/src/main/java/org/apache/servicecomb/core/metrics/InvocationStartProcessingEvent.java
index dd579e889..64af73f7a 100644
--- 
a/core/src/main/java/org/apache/servicecomb/core/metrics/InvocationStartProcessingEvent.java
+++ 
b/core/src/main/java/org/apache/servicecomb/core/metrics/InvocationStartProcessingEvent.java
@@ -17,10 +17,9 @@
 
 package org.apache.servicecomb.core.metrics;
 
-import org.apache.servicecomb.foundation.common.event.Event;
 import org.apache.servicecomb.swagger.invocation.InvocationType;
 
-public class InvocationStartProcessingEvent implements Event {
+public class InvocationStartProcessingEvent {
   private final String operationName;
 
   private final InvocationType invocationType;
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
index 4bc4a8fc4..9ce7759a2 100644
--- 
a/core/src/main/java/org/apache/servicecomb/core/metrics/InvocationStartedEvent.java
+++ 
b/core/src/main/java/org/apache/servicecomb/core/metrics/InvocationStartedEvent.java
@@ -17,10 +17,9 @@
 
 package org.apache.servicecomb.core.metrics;
 
-import org.apache.servicecomb.foundation.common.event.Event;
 import org.apache.servicecomb.swagger.invocation.InvocationType;
 
-public class InvocationStartedEvent implements Event {
+public class InvocationStartedEvent {
   private final String operationName;
 
   private final InvocationType invocationType;
diff --git 
a/core/src/main/java/org/apache/servicecomb/core/provider/consumer/InvokerUtils.java
 
b/core/src/main/java/org/apache/servicecomb/core/provider/consumer/InvokerUtils.java
index 2504ab00d..d1715cd25 100644
--- 
a/core/src/main/java/org/apache/servicecomb/core/provider/consumer/InvokerUtils.java
+++ 
b/core/src/main/java/org/apache/servicecomb/core/provider/consumer/InvokerUtils.java
@@ -21,7 +21,7 @@
 import org.apache.servicecomb.core.definition.SchemaMeta;
 import org.apache.servicecomb.core.invocation.InvocationFactory;
 import org.apache.servicecomb.core.metrics.InvocationStartedEvent;
-import org.apache.servicecomb.foundation.common.utils.EventUtils;
+import org.apache.servicecomb.foundation.common.event.EventManager;
 import org.apache.servicecomb.swagger.invocation.AsyncResponse;
 import org.apache.servicecomb.swagger.invocation.InvocationType;
 import org.apache.servicecomb.swagger.invocation.Response;
@@ -59,7 +59,7 @@ public static Object syncInvoke(Invocation invocation) throws 
InvocationExceptio
       return response.getResult();
     }
 
-    throw ExceptionFactory.convertConsumerException((Throwable) 
response.getResult());
+    throw ExceptionFactory.convertConsumerException(response.getResult());
   }
 
   public static Response innerSyncInvoke(Invocation invocation) {
@@ -118,7 +118,7 @@ public static Object invoke(Invocation invocation) {
 
   private static void triggerStartedEvent(Invocation invocation) {
     long startTime = System.nanoTime();
-    EventUtils.triggerEvent(new 
InvocationStartedEvent(invocation.getMicroserviceQualifiedName(),
+    EventManager.post(new 
InvocationStartedEvent(invocation.getMicroserviceQualifiedName(),
         InvocationType.CONSUMER, startTime));
     invocation.setStartTime(startTime);
   }
diff --git 
a/demo/demo-springmvc/springmvc-client/src/main/java/org/apache/servicecomb/demo/springmvc/client/SpringmvcClient.java
 
b/demo/demo-springmvc/springmvc-client/src/main/java/org/apache/servicecomb/demo/springmvc/client/SpringmvcClient.java
index 71f885f32..3275204bc 100644
--- 
a/demo/demo-springmvc/springmvc-client/src/main/java/org/apache/servicecomb/demo/springmvc/client/SpringmvcClient.java
+++ 
b/demo/demo-springmvc/springmvc-client/src/main/java/org/apache/servicecomb/demo/springmvc/client/SpringmvcClient.java
@@ -29,9 +29,7 @@
 import org.apache.servicecomb.foundation.common.utils.BeanUtils;
 import org.apache.servicecomb.foundation.common.utils.JsonUtils;
 import org.apache.servicecomb.foundation.common.utils.Log4jUtils;
-import org.apache.servicecomb.metrics.common.MetricsDimension;
 import org.apache.servicecomb.metrics.common.MetricsPublisher;
-import org.apache.servicecomb.metrics.common.RegistryMetric;
 import org.apache.servicecomb.provider.springmvc.reference.CseRestTemplate;
 import org.apache.servicecomb.provider.springmvc.reference.RestTemplateBuilder;
 import 
org.apache.servicecomb.provider.springmvc.reference.UrlWithServiceNameClientHttpRequestFactory;
@@ -91,14 +89,9 @@ public static void run() {
 
     //0.5.0 later version metrics integration test
     try {
-      RegistryMetric metric = metricsPublisher.metrics();
-
-      TestMgr
-          .check(true, 
metric.getInstanceMetric().getSystemMetric().getHeapUsed() != 0);
-      TestMgr.check(true, metric.getProducerMetrics().size() > 0);
-      TestMgr.check(true,
-          
metric.getProducerMetrics().get("springmvc.codeFirst.saySomething").getProducerCall()
-              .getTotalValue(MetricsDimension.DIMENSION_STATUS, 
MetricsDimension.DIMENSION_STATUS_ALL).getValue() > 0);
+      Map<String, Double> metric = metricsPublisher.metrics();
+      TestMgr.check(true, 
metric.get("servicecomb.instance.system.heap.commit") != 0);
+      TestMgr.check(true, 
metric.get("servicecomb.springmvc.codeFirst.saySomething.producer.producerCall.total.{Status=all}")
 > 0);
     } catch (Exception e) {
       TestMgr.check("true", "false");
     }
diff --git 
a/foundations/foundation-common/src/main/java/org/apache/servicecomb/foundation/common/event/Event.java
 
b/foundations/foundation-common/src/main/java/org/apache/servicecomb/foundation/common/event/Event.java
deleted file mode 100644
index d089f0198..000000000
--- 
a/foundations/foundation-common/src/main/java/org/apache/servicecomb/foundation/common/event/Event.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.foundation.common.event;
-
-//Common event interface for event extension
-public interface Event {
-}
diff --git 
a/foundations/foundation-common/src/main/java/org/apache/servicecomb/foundation/common/event/EventBus.java
 
b/foundations/foundation-common/src/main/java/org/apache/servicecomb/foundation/common/event/EventBus.java
deleted file mode 100644
index 4305acee9..000000000
--- 
a/foundations/foundation-common/src/main/java/org/apache/servicecomb/foundation/common/event/EventBus.java
+++ /dev/null
@@ -1,49 +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.common.event;
-
-import java.util.Collections;
-import java.util.List;
-import java.util.Map;
-import java.util.concurrent.ConcurrentHashMap;
-import java.util.concurrent.CopyOnWriteArrayList;
-
-public class EventBus {
-  private final Map<Class<? extends Event>, List<EventListener>> 
allEventListeners = new ConcurrentHashMap<>();
-
-  public void registerEventListener(EventListener eventListener) {
-    List<EventListener> eventListeners = allEventListeners
-        .computeIfAbsent(eventListener.getConcernedEvent(), f -> new 
CopyOnWriteArrayList<>());
-    eventListeners.add(eventListener);
-  }
-
-  public void unregisterEventListener(EventListener eventListener) {
-    List<EventListener> eventListeners = allEventListeners
-        .computeIfAbsent(eventListener.getConcernedEvent(), f -> new 
CopyOnWriteArrayList<>());
-    if (eventListeners.contains(eventListener)) {
-      eventListeners.remove(eventListener);
-    }
-  }
-
-  public void triggerEvent(Event event) {
-    List<EventListener> eventListeners = 
allEventListeners.getOrDefault(event.getClass(), Collections.emptyList());
-    for (EventListener eventListener : eventListeners) {
-      eventListener.process(event);
-    }
-  }
-}
diff --git 
a/foundations/foundation-common/src/main/java/org/apache/servicecomb/foundation/common/event/EventListener.java
 
b/foundations/foundation-common/src/main/java/org/apache/servicecomb/foundation/common/event/EventListener.java
deleted file mode 100644
index 5f208d6f6..000000000
--- 
a/foundations/foundation-common/src/main/java/org/apache/servicecomb/foundation/common/event/EventListener.java
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.servicecomb.foundation.common.event;
-
-//Common event listener interface,java chassis component can trigger event let 
high level component perceive data change.
-public interface EventListener {
-
-  //what is type event this listener concerned
-  Class<? extends Event> getConcernedEvent();
-
-  //process event data
-  void process(Event data);
-}
diff --git 
a/foundations/foundation-common/src/main/java/org/apache/servicecomb/foundation/common/utils/EventUtils.java
 
b/foundations/foundation-common/src/main/java/org/apache/servicecomb/foundation/common/utils/EventUtils.java
deleted file mode 100644
index 731d8ffa8..000000000
--- 
a/foundations/foundation-common/src/main/java/org/apache/servicecomb/foundation/common/utils/EventUtils.java
+++ /dev/null
@@ -1,38 +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.common.utils;
-
-import org.apache.servicecomb.foundation.common.event.Event;
-import org.apache.servicecomb.foundation.common.event.EventBus;
-import org.apache.servicecomb.foundation.common.event.EventListener;
-
-public final class EventUtils {
-  private static final EventBus eventBus = new EventBus();
-
-  public static void registerEventListener(EventListener eventListener) {
-    eventBus.registerEventListener(eventListener);
-  }
-
-  public static void unregisterEventListener(EventListener eventListener) {
-    eventBus.unregisterEventListener(eventListener);
-  }
-
-  public static void triggerEvent(Event event) {
-    eventBus.triggerEvent(event);
-  }
-}
diff --git 
a/foundations/foundation-common/src/test/java/org/apache/servicecomb/foundation/common/event/TestEventBus.java
 
b/foundations/foundation-common/src/test/java/org/apache/servicecomb/foundation/common/event/TestEventBus.java
deleted file mode 100644
index 28b9575c8..000000000
--- 
a/foundations/foundation-common/src/test/java/org/apache/servicecomb/foundation/common/event/TestEventBus.java
+++ /dev/null
@@ -1,63 +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.common.event;
-
-import static org.awaitility.Awaitility.await;
-
-import java.util.concurrent.TimeUnit;
-import java.util.concurrent.atomic.AtomicBoolean;
-
-import org.apache.servicecomb.foundation.common.utils.EventUtils;
-import org.junit.Assert;
-import org.junit.Test;
-
-public class TestEventBus {
-
-  @Test
-  public void test() throws InterruptedException {
-    AtomicBoolean eventReceived = new AtomicBoolean(false);
-
-    EventListener listener = new EventListener() {
-      @Override
-      public Class<? extends Event> getConcernedEvent() {
-        return TestEvent.class;
-      }
-
-      @Override
-      public void process(Event data) {
-        eventReceived.set(true);
-      }
-    };
-
-    EventUtils.registerEventListener(listener);
-    EventUtils.triggerEvent(new TestEvent());
-    await().atMost(1, TimeUnit.SECONDS)
-        .until(eventReceived::get);
-    Assert.assertTrue(eventReceived.get());
-
-    eventReceived.set(false);
-
-    EventUtils.unregisterEventListener(listener);
-    EventUtils.triggerEvent(new TestEvent());
-    Thread.sleep(1000);
-    Assert.assertFalse(eventReceived.get());
-  }
-
-  private class TestEvent implements Event {
-  }
-}
diff --git 
a/metrics/metrics-common/src/main/java/org/apache/servicecomb/metrics/common/CallMetric.java
 
b/metrics/metrics-common/src/main/java/org/apache/servicecomb/metrics/common/CallMetric.java
index 36e1d49bf..60f816767 100644
--- 
a/metrics/metrics-common/src/main/java/org/apache/servicecomb/metrics/common/CallMetric.java
+++ 
b/metrics/metrics-common/src/main/java/org/apache/servicecomb/metrics/common/CallMetric.java
@@ -79,10 +79,10 @@ public CallMetric merge(CallMetric metric) {
         DoubleMetricValue.merge(metric.getTpsValues(), this.getTpsValues()));
   }
 
-  public Map<String, Number> toMap() {
-    Map<String, Number> metrics = new HashMap<>();
+  public Map<String, Double> toMap() {
+    Map<String, Double> metrics = new HashMap<>();
     for (LongMetricValue totalValue : totalValues) {
-      metrics.put(prefix + ".total." + totalValue.getKey(), 
totalValue.getValue());
+      metrics.put(prefix + ".total." + totalValue.getKey(), 
totalValue.getValue().doubleValue());
     }
     for (DoubleMetricValue tpsValue : tpsValues) {
       metrics.put(prefix + ".tps." + tpsValue.getKey(), tpsValue.getValue());
diff --git 
a/metrics/metrics-common/src/main/java/org/apache/servicecomb/metrics/common/ConsumerInvocationMetric.java
 
b/metrics/metrics-common/src/main/java/org/apache/servicecomb/metrics/common/ConsumerInvocationMetric.java
index 681e1d489..e2266316f 100644
--- 
a/metrics/metrics-common/src/main/java/org/apache/servicecomb/metrics/common/ConsumerInvocationMetric.java
+++ 
b/metrics/metrics-common/src/main/java/org/apache/servicecomb/metrics/common/ConsumerInvocationMetric.java
@@ -50,8 +50,8 @@ public ConsumerInvocationMetric 
merge(ConsumerInvocationMetric metric) {
         consumerCall.merge(metric.getConsumerCall()));
   }
 
-  public Map<String, Number> toMap() {
-    Map<String, Number> metrics = new HashMap<>();
+  public Map<String, Double> toMap() {
+    Map<String, Double> metrics = new HashMap<>();
     metrics.putAll(consumerLatency.toMap());
     metrics.putAll(consumerCall.toMap());
     return metrics;
diff --git 
a/metrics/metrics-common/src/main/java/org/apache/servicecomb/metrics/common/InstanceMetric.java
 
b/metrics/metrics-common/src/main/java/org/apache/servicecomb/metrics/common/InstanceMetric.java
index 58ae2cd4d..34a42a7b8 100644
--- 
a/metrics/metrics-common/src/main/java/org/apache/servicecomb/metrics/common/InstanceMetric.java
+++ 
b/metrics/metrics-common/src/main/java/org/apache/servicecomb/metrics/common/InstanceMetric.java
@@ -49,8 +49,8 @@ public InstanceMetric(@JsonProperty("systemMetric") 
SystemMetric systemMetric,
     this.producerMetric = producerMetric;
   }
 
-  public Map<String, Number> toMap() {
-    Map<String, Number> metrics = new HashMap<>();
+  public Map<String, Double> toMap() {
+    Map<String, Double> metrics = new HashMap<>();
     metrics.putAll(systemMetric.toMap());
     metrics.putAll(consumerMetric.toMap());
     metrics.putAll(producerMetric.toMap());
diff --git 
a/metrics/metrics-common/src/main/java/org/apache/servicecomb/metrics/common/MetricsPublisher.java
 
b/metrics/metrics-common/src/main/java/org/apache/servicecomb/metrics/common/MetricsPublisher.java
index 029ddb383..dbbec144d 100644
--- 
a/metrics/metrics-common/src/main/java/org/apache/servicecomb/metrics/common/MetricsPublisher.java
+++ 
b/metrics/metrics-common/src/main/java/org/apache/servicecomb/metrics/common/MetricsPublisher.java
@@ -18,6 +18,7 @@
 package org.apache.servicecomb.metrics.common;
 
 import java.util.List;
+import java.util.Map;
 
 public interface MetricsPublisher {
   /**  What's the WindowTime ?
@@ -29,13 +30,13 @@
    Max & Min -> the max value or min value in a centain time
    Average -> average value, the simplest algorithm is f = sum / count
    Rate -> like TPS,algorithm is f = sum / second
-  
+
    Will be return "servicecomb.metrics.window_time" setting in 
microservice.yaml
    */
   List<Long> getAppliedWindowTime();
 
   //same as getRegistryMetric({first setting windowTime})
-  RegistryMetric metrics();
+  Map<String, Double> metrics();
 
   /**
    * windowTime usage example:
@@ -53,7 +54,7 @@
    *                               getRegistryMetric(2000) will return max=400 
min=100 total=1000
    *
    * @param windowTime getAppliedWindowTime() item
-   * @return RegistryMetric
+   * @return Map<String   ,   Double>
    */
-  RegistryMetric metricsWithWindowTime(long windowTime);
+  Map<String, Double> metricsWithWindowTime(long windowTime);
 }
diff --git 
a/metrics/metrics-common/src/main/java/org/apache/servicecomb/metrics/common/ProducerInvocationMetric.java
 
b/metrics/metrics-common/src/main/java/org/apache/servicecomb/metrics/common/ProducerInvocationMetric.java
index eb8c49883..98a897a22 100644
--- 
a/metrics/metrics-common/src/main/java/org/apache/servicecomb/metrics/common/ProducerInvocationMetric.java
+++ 
b/metrics/metrics-common/src/main/java/org/apache/servicecomb/metrics/common/ProducerInvocationMetric.java
@@ -77,9 +77,9 @@ public ProducerInvocationMetric 
merge(ProducerInvocationMetric metric) {
         producerCall.merge(metric.getProducerCall()));
   }
 
-  public Map<String, Number> toMap() {
-    Map<String, Number> metrics = new HashMap<>();
-    metrics.put(getPrefix() + ".waitInQueue.count", getWaitInQueue());
+  public Map<String, Double> toMap() {
+    Map<String, Double> metrics = new HashMap<>();
+    metrics.put(getPrefix() + ".waitInQueue.count", (double) getWaitInQueue());
     metrics.putAll(lifeTimeInQueue.toMap());
     metrics.putAll(executionTime.toMap());
     metrics.putAll(producerLatency.toMap());
diff --git 
a/metrics/metrics-common/src/main/java/org/apache/servicecomb/metrics/common/RegistryMetric.java
 
b/metrics/metrics-common/src/main/java/org/apache/servicecomb/metrics/common/RegistryMetric.java
index c03ad8f93..a8ed44104 100644
--- 
a/metrics/metrics-common/src/main/java/org/apache/servicecomb/metrics/common/RegistryMetric.java
+++ 
b/metrics/metrics-common/src/main/java/org/apache/servicecomb/metrics/common/RegistryMetric.java
@@ -29,8 +29,6 @@
 
   private final Map<String, ProducerInvocationMetric> producerMetrics;
 
-  private final Map<String, Double> customMetrics;
-
   public InstanceMetric getInstanceMetric() {
     return instanceMetric;
   }
@@ -43,27 +41,19 @@ public InstanceMetric getInstanceMetric() {
     return producerMetrics;
   }
 
-  public Map<String, Double> getCustomMetrics() {
-    return customMetrics;
-  }
-
   public RegistryMetric(@JsonProperty("instanceMetric") InstanceMetric 
instanceMetric,
       @JsonProperty("consumerMetrics") Map<String, ConsumerInvocationMetric> 
consumerMetrics,
-      @JsonProperty("producerMetrics") Map<String, ProducerInvocationMetric> 
producerMetrics,
-      @JsonProperty("customMetrics") Map<String, Double> customMetrics) {
+      @JsonProperty("producerMetrics") Map<String, ProducerInvocationMetric> 
producerMetrics) {
     this.consumerMetrics = consumerMetrics;
     this.producerMetrics = producerMetrics;
     this.instanceMetric = instanceMetric;
-    this.customMetrics = customMetrics;
   }
 
   public RegistryMetric(SystemMetric systemMetric,
       Map<String, ConsumerInvocationMetric> consumerMetrics,
-      Map<String, ProducerInvocationMetric> producerMetrics,
-      Map<String, Double> customMetrics) {
+      Map<String, ProducerInvocationMetric> producerMetrics) {
     this.consumerMetrics = consumerMetrics;
     this.producerMetrics = producerMetrics;
-    this.customMetrics = customMetrics;
 
     ConsumerInvocationMetric instanceConsumerInvocationMetric = new 
ConsumerInvocationMetric("instance",
         MetricsConst.INSTANCE_CONSUMER_PREFIX,
@@ -88,8 +78,8 @@ public RegistryMetric(SystemMetric systemMetric,
         instanceConsumerInvocationMetric, instanceProducerInvocationMetric);
   }
 
-  public Map<String, Number> toMap() {
-    Map<String, Number> metrics = new HashMap<>(instanceMetric.toMap());
+  public Map<String, Double> toMap() {
+    Map<String, Double> metrics = new HashMap<>(instanceMetric.toMap());
     for (ConsumerInvocationMetric metric : consumerMetrics.values()) {
       metrics.putAll(metric.toMap());
     }
diff --git 
a/metrics/metrics-common/src/main/java/org/apache/servicecomb/metrics/common/SystemMetric.java
 
b/metrics/metrics-common/src/main/java/org/apache/servicecomb/metrics/common/SystemMetric.java
index 001518d92..fa6dca580 100644
--- 
a/metrics/metrics-common/src/main/java/org/apache/servicecomb/metrics/common/SystemMetric.java
+++ 
b/metrics/metrics-common/src/main/java/org/apache/servicecomb/metrics/common/SystemMetric.java
@@ -101,19 +101,19 @@ public SystemMetric(@JsonProperty("cpuLoad") double 
cpuLoad,
     this.nonHeapUsed = nonHeapUsed;
   }
 
-  public Map<String, Number> toMap() {
+  public Map<String, Double> toMap() {
     String prefix = "servicecomb.instance.system";
-    Map<String, Number> metrics = new HashMap<>();
+    Map<String, Double> metrics = new HashMap<>();
     metrics.put(prefix + ".cpu.load", cpuLoad);
-    metrics.put(prefix + ".cpu.runningThreads", cpuRunningThreads);
-    metrics.put(prefix + ".heap.init", heapInit);
-    metrics.put(prefix + ".heap.max", heapMax);
-    metrics.put(prefix + ".heap.commit", heapCommit);
-    metrics.put(prefix + ".heap.used", heapUsed);
-    metrics.put(prefix + ".nonHeap.init", nonHeapInit);
-    metrics.put(prefix + ".nonHeap.max", nonHeapMax);
-    metrics.put(prefix + ".nonHeap.commit", nonHeapCommit);
-    metrics.put(prefix + ".nonHeap.used", nonHeapUsed);
+    metrics.put(prefix + ".cpu.runningThreads", (double) cpuRunningThreads);
+    metrics.put(prefix + ".heap.init", (double) heapInit);
+    metrics.put(prefix + ".heap.max", (double) heapMax);
+    metrics.put(prefix + ".heap.commit", (double) heapCommit);
+    metrics.put(prefix + ".heap.used", (double) heapUsed);
+    metrics.put(prefix + ".nonHeap.init", (double) nonHeapInit);
+    metrics.put(prefix + ".nonHeap.max", (double) nonHeapMax);
+    metrics.put(prefix + ".nonHeap.commit", (double) nonHeapCommit);
+    metrics.put(prefix + ".nonHeap.used", (double) nonHeapUsed);
     return metrics;
   }
 }
diff --git 
a/metrics/metrics-common/src/main/java/org/apache/servicecomb/metrics/common/TimerMetric.java
 
b/metrics/metrics-common/src/main/java/org/apache/servicecomb/metrics/common/TimerMetric.java
index 01f3b70f3..e364914d4 100644
--- 
a/metrics/metrics-common/src/main/java/org/apache/servicecomb/metrics/common/TimerMetric.java
+++ 
b/metrics/metrics-common/src/main/java/org/apache/servicecomb/metrics/common/TimerMetric.java
@@ -87,13 +87,13 @@ private long getMax(long value1, long value2) {
     return value2 > value1 ? value2 : value1;
   }
 
-  public Map<String, Number> toMap() {
-    Map<String, Number> metrics = new HashMap<>();
-    metrics.put(prefix + ".total", total);
-    metrics.put(prefix + ".count", count);
+  public Map<String, Double> toMap() {
+    Map<String, Double> metrics = new HashMap<>();
+    metrics.put(prefix + ".total", (double) total);
+    metrics.put(prefix + ".count", (double) count);
     metrics.put(prefix + ".average", average);
-    metrics.put(prefix + ".max", max);
-    metrics.put(prefix + ".min", min);
+    metrics.put(prefix + ".max", (double) max);
+    metrics.put(prefix + ".min", (double) min);
     return metrics;
   }
 }
diff --git 
a/metrics/metrics-core/src/main/java/org/apache/servicecomb/metrics/core/custom/CounterService.java
 
b/metrics/metrics-core/src/main/java/org/apache/servicecomb/metrics/core/custom/CounterService.java
deleted file mode 100644
index a67993f83..000000000
--- 
a/metrics/metrics-core/src/main/java/org/apache/servicecomb/metrics/core/custom/CounterService.java
+++ /dev/null
@@ -1,31 +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.custom;
-
-/**
- CounterService is simple service for manage basic counter,Window 
Time-unrelated,always get latest value
- */
-public interface CounterService {
-  void increment(String name);
-
-  void increment(String name, long value);
-
-  void decrement(String name);
-
-  void reset(String name);
-}
diff --git 
a/metrics/metrics-core/src/main/java/org/apache/servicecomb/metrics/core/custom/DefaultCounterService.java
 
b/metrics/metrics-core/src/main/java/org/apache/servicecomb/metrics/core/custom/DefaultCounterService.java
deleted file mode 100644
index a41319c6f..000000000
--- 
a/metrics/metrics-core/src/main/java/org/apache/servicecomb/metrics/core/custom/DefaultCounterService.java
+++ /dev/null
@@ -1,71 +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.custom;
-
-import java.util.HashMap;
-import java.util.Map;
-import java.util.Map.Entry;
-
-import org.apache.servicecomb.foundation.common.concurrent.ConcurrentHashMapEx;
-import org.springframework.stereotype.Component;
-
-import com.netflix.servo.monitor.BasicCounter;
-import com.netflix.servo.monitor.MonitorConfig;
-
-@Component
-public class DefaultCounterService implements CounterService {
-
-  private final Map<String, BasicCounter> counters;
-
-  public DefaultCounterService() {
-    this.counters = new ConcurrentHashMapEx<>();
-  }
-
-  @Override
-  public void increment(String name) {
-    getCounter(name).increment();
-  }
-
-  @Override
-  public void increment(String name, long value) {
-    getCounter(name).increment(value);
-  }
-
-  @Override
-  public void decrement(String name) {
-    getCounter(name).increment(-1);
-  }
-
-  @Override
-  public void reset(String name) {
-    counters.remove(name);
-    this.increment(name, 0);
-  }
-
-  private BasicCounter getCounter(String name) {
-    return counters.computeIfAbsent(name, n -> new 
BasicCounter(MonitorConfig.builder(n).build()));
-  }
-
-  public Map<String, Double> toMetrics() {
-    Map<String, Double> metrics = new HashMap<>();
-    for (Entry<String, BasicCounter> counter : counters.entrySet()) {
-      metrics.put(counter.getKey(), 
counter.getValue().getValue().doubleValue());
-    }
-    return metrics;
-  }
-}
diff --git 
a/metrics/metrics-core/src/main/java/org/apache/servicecomb/metrics/core/custom/DefaultGaugeService.java
 
b/metrics/metrics-core/src/main/java/org/apache/servicecomb/metrics/core/custom/DefaultGaugeService.java
deleted file mode 100644
index 4789ae5ee..000000000
--- 
a/metrics/metrics-core/src/main/java/org/apache/servicecomb/metrics/core/custom/DefaultGaugeService.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.servicecomb.metrics.core.custom;
-
-import java.util.HashMap;
-import java.util.Map;
-
-import org.apache.servicecomb.foundation.common.concurrent.ConcurrentHashMapEx;
-import org.springframework.stereotype.Component;
-
-@Component
-public class DefaultGaugeService implements GaugeService {
-
-  private final Map<String, Double> gauges;
-
-  public DefaultGaugeService() {
-    this.gauges = new ConcurrentHashMapEx<>();
-  }
-
-  @Override
-  public void update(String name, double value) {
-    this.gauges.put(name, value);
-  }
-
-  public Map<String, Double> toMetrics() {
-    return new HashMap<>(gauges);
-  }
-}
diff --git 
a/metrics/metrics-core/src/main/java/org/apache/servicecomb/metrics/core/custom/DefaultWindowCounterService.java
 
b/metrics/metrics-core/src/main/java/org/apache/servicecomb/metrics/core/custom/DefaultWindowCounterService.java
deleted file mode 100644
index 6f53ae645..000000000
--- 
a/metrics/metrics-core/src/main/java/org/apache/servicecomb/metrics/core/custom/DefaultWindowCounterService.java
+++ /dev/null
@@ -1,49 +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.custom;
-
-import java.util.HashMap;
-import java.util.Map;
-import java.util.Map.Entry;
-
-import org.apache.servicecomb.foundation.common.concurrent.ConcurrentHashMapEx;
-import org.springframework.stereotype.Component;
-
-@Component
-public class DefaultWindowCounterService implements WindowCounterService {
-
-  private final Map<String, WindowCounter> counters;
-
-  public DefaultWindowCounterService() {
-    this.counters = new ConcurrentHashMapEx<>();
-  }
-
-  @Override
-  public void record(String name, long value) {
-    WindowCounter counter = counters.computeIfAbsent(name, WindowCounter::new);
-    counter.update(value);
-  }
-
-  public Map<String, Double> toMetrics(int windowTimeIndex) {
-    Map<String, Double> metrics = new HashMap<>();
-    for (Entry<String, WindowCounter> counter : counters.entrySet()) {
-      metrics.putAll(counter.getValue().toMetric(windowTimeIndex));
-    }
-    return metrics;
-  }
-}
diff --git 
a/metrics/metrics-core/src/main/java/org/apache/servicecomb/metrics/core/custom/GaugeService.java
 
b/metrics/metrics-core/src/main/java/org/apache/servicecomb/metrics/core/custom/GaugeService.java
deleted file mode 100644
index a69ca4327..000000000
--- 
a/metrics/metrics-core/src/main/java/org/apache/servicecomb/metrics/core/custom/GaugeService.java
+++ /dev/null
@@ -1,25 +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.custom;
-
-/**
- GaugeService is simple service for manage basic gauge,Window 
Time-unrelated,always get latest value
- */
-public interface GaugeService {
-  void update(String name, double value);
-}
diff --git 
a/metrics/metrics-core/src/main/java/org/apache/servicecomb/metrics/core/custom/WindowCounter.java
 
b/metrics/metrics-core/src/main/java/org/apache/servicecomb/metrics/core/custom/WindowCounter.java
deleted file mode 100644
index 9684f20c1..000000000
--- 
a/metrics/metrics-core/src/main/java/org/apache/servicecomb/metrics/core/custom/WindowCounter.java
+++ /dev/null
@@ -1,76 +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.custom;
-
-import java.util.HashMap;
-import java.util.Map;
-
-import com.netflix.servo.monitor.MaxGauge;
-import com.netflix.servo.monitor.MinGauge;
-import com.netflix.servo.monitor.MonitorConfig;
-import com.netflix.servo.monitor.StepCounter;
-
-public class WindowCounter {
-  private final String name;
-
-  private final StepCounter total;
-
-  private final StepCounter count;
-
-  private final MinGauge min;
-
-  private final MaxGauge max;
-
-  public WindowCounter(String name) {
-    this.name = name;
-    total = new StepCounter(MonitorConfig.builder(name).build());
-    count = new StepCounter(MonitorConfig.builder(name).build());
-    min = new MinGauge(MonitorConfig.builder(name).build());
-    max = new MaxGauge(MonitorConfig.builder(name).build());
-  }
-
-  public void update(long value) {
-    if (value > 0) {
-      total.increment(value);
-      count.increment();
-      max.update(value);
-      min.update(value);
-    }
-  }
-
-  public Map<String, Double> toMetric(int windowTimeIndex) {
-    Map<String, Double> metrics = new HashMap<>();
-    metrics.put(name + ".total", 
this.adjustValue(total.getCount(windowTimeIndex)));
-    metrics.put(name + ".count", 
this.adjustValue(count.getCount(windowTimeIndex)));
-    metrics.put(name + ".max", 
this.adjustValue(max.getValue(windowTimeIndex)));
-    metrics.put(name + ".min", 
this.adjustValue(min.getValue(windowTimeIndex)));
-    double value = count.getCount(windowTimeIndex) == 0 ? 0 :
-        (double) this.total.getCount(windowTimeIndex) / (double) 
this.count.getCount(windowTimeIndex);
-    metrics.put(name + ".average", value);
-    metrics.put(name + ".rate", 
this.adjustValue(total.getValue(windowTimeIndex).doubleValue()));
-    metrics.put(name + ".tps", 
this.adjustValue(count.getValue(windowTimeIndex).doubleValue()));
-    return metrics;
-  }
-
-  //for time-related monitor type, if stop poll value over one window time,
-  //the value may return -1 because servo can't known precise value of 
previous step
-  //so must change to return 0
-  private double adjustValue(double value) {
-    return value < 0 ? 0 : value;
-  }
-}
diff --git 
a/metrics/metrics-core/src/main/java/org/apache/servicecomb/metrics/core/custom/WindowCounterService.java
 
b/metrics/metrics-core/src/main/java/org/apache/servicecomb/metrics/core/custom/WindowCounterService.java
deleted file mode 100644
index 26ba380c6..000000000
--- 
a/metrics/metrics-core/src/main/java/org/apache/servicecomb/metrics/core/custom/WindowCounterService.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.custom;
-
-/**
- WindowCounterService is complex service for manage Window Time-related Step 
Counter,
- It will output total,count,tps,rate,average,max and min
- examples:
- if record four time in one window,and window time = 2000 (2 seconds), like :
- record("Order Amount",100)
- record("Order Amount",200)
- record("Order Amount",300)
- record("Order Amount",400)
-
- Output metrics include:
- Order Amount.total = 1000
- Order Amount.count = 4
- Order Amount.tps = 2           count / time(second)
- Order Amount.rate = 500        total / time(second
- Order Amount.average = 250     total / count
- Order Amount.max = 400
- Order Amount.min = 100
- */
-public interface WindowCounterService {
-  void record(String name, long value);
-}
diff --git 
a/metrics/metrics-core/src/main/java/org/apache/servicecomb/metrics/core/event/DefaultEventListenerManager.java
 
b/metrics/metrics-core/src/main/java/org/apache/servicecomb/metrics/core/event/DefaultEventListenerManager.java
index 6dc6df4f4..0ba4412e9 100644
--- 
a/metrics/metrics-core/src/main/java/org/apache/servicecomb/metrics/core/event/DefaultEventListenerManager.java
+++ 
b/metrics/metrics-core/src/main/java/org/apache/servicecomb/metrics/core/event/DefaultEventListenerManager.java
@@ -17,8 +17,7 @@
 
 package org.apache.servicecomb.metrics.core.event;
 
-import org.apache.servicecomb.foundation.common.event.EventListener;
-import org.apache.servicecomb.foundation.common.utils.EventUtils;
+import org.apache.servicecomb.foundation.common.event.EventManager;
 import org.apache.servicecomb.metrics.common.MetricsDimension;
 import org.apache.servicecomb.metrics.core.MetricsConfig;
 import 
org.apache.servicecomb.metrics.core.event.dimension.StatusConvertorFactory;
@@ -29,7 +28,7 @@
 import com.netflix.config.DynamicPropertyFactory;
 
 @Component
-public class DefaultEventListenerManager implements EventListenerManager {
+public class DefaultEventListenerManager {
 
   @Autowired
   public DefaultEventListenerManager(RegistryMonitor registryMonitor, 
StatusConvertorFactory convertorFactory) {
@@ -40,14 +39,9 @@ public DefaultEventListenerManager(RegistryMonitor 
registryMonitor, StatusConver
 
   public DefaultEventListenerManager(RegistryMonitor registryMonitor, 
StatusConvertorFactory convertorFactory,
       String outputLevel) {
-    this.registerEventListener(new 
InvocationStartedEventListener(registryMonitor));
-    this.registerEventListener(new 
InvocationStartProcessingEventListener(registryMonitor));
-    this.registerEventListener(
-        new InvocationFinishedEventListener(registryMonitor, 
convertorFactory.getConvertor(outputLevel)));
-  }
-
-  @Override
-  public void registerEventListener(EventListener listener) {
-    EventUtils.registerEventListener(listener);
+    EventManager.register(new InvocationStartedEventListener(registryMonitor));
+    EventManager.register(new 
InvocationStartProcessingEventListener(registryMonitor));
+    EventManager
+        .register(new InvocationFinishedEventListener(registryMonitor, 
convertorFactory.getConvertor(outputLevel)));
   }
 }
diff --git 
a/metrics/metrics-core/src/main/java/org/apache/servicecomb/metrics/core/event/EventListenerManager.java
 
b/metrics/metrics-core/src/main/java/org/apache/servicecomb/metrics/core/event/EventListenerManager.java
deleted file mode 100644
index a381b47d3..000000000
--- 
a/metrics/metrics-core/src/main/java/org/apache/servicecomb/metrics/core/event/EventListenerManager.java
+++ /dev/null
@@ -1,24 +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.foundation.common.event.EventListener;
-
-public interface EventListenerManager {
-  void registerEventListener(EventListener listener);
-}
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
index 5b886b6f0..878e8b7b2 100644
--- 
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
@@ -18,8 +18,6 @@
 package org.apache.servicecomb.metrics.core.event;
 
 import org.apache.servicecomb.core.metrics.InvocationFinishedEvent;
-import org.apache.servicecomb.foundation.common.event.Event;
-import org.apache.servicecomb.foundation.common.event.EventListener;
 import org.apache.servicecomb.metrics.common.MetricsDimension;
 import org.apache.servicecomb.metrics.core.event.dimension.StatusConvertor;
 import org.apache.servicecomb.metrics.core.monitor.ConsumerInvocationMonitor;
@@ -27,7 +25,9 @@
 import org.apache.servicecomb.metrics.core.monitor.RegistryMonitor;
 import org.apache.servicecomb.swagger.invocation.InvocationType;
 
-public class InvocationFinishedEventListener implements EventListener {
+import com.google.common.eventbus.Subscribe;
+
+public class InvocationFinishedEventListener {
   private final RegistryMonitor registryMonitor;
 
   private final StatusConvertor convertor;
@@ -37,14 +37,8 @@ public InvocationFinishedEventListener(RegistryMonitor 
registryMonitor, StatusCo
     this.convertor = convertor;
   }
 
-  @Override
-  public Class<? extends Event> getConcernedEvent() {
-    return InvocationFinishedEvent.class;
-  }
-
-  @Override
-  public void process(Event data) {
-    InvocationFinishedEvent event = (InvocationFinishedEvent) data;
+  @Subscribe
+  public void process(InvocationFinishedEvent event) {
     String statusDimensionValue = convertor.convert(event.isSuccess(), 
event.getStatusCode());
     if (InvocationType.PRODUCER.equals(event.getInvocationType())) {
       ProducerInvocationMonitor monitor = 
registryMonitor.getProducerInvocationMonitor(event.getOperationName());
diff --git 
a/metrics/metrics-core/src/main/java/org/apache/servicecomb/metrics/core/event/InvocationStartProcessingEventListener.java
 
b/metrics/metrics-core/src/main/java/org/apache/servicecomb/metrics/core/event/InvocationStartProcessingEventListener.java
index 3d83b2c0d..f96d1e047 100644
--- 
a/metrics/metrics-core/src/main/java/org/apache/servicecomb/metrics/core/event/InvocationStartProcessingEventListener.java
+++ 
b/metrics/metrics-core/src/main/java/org/apache/servicecomb/metrics/core/event/InvocationStartProcessingEventListener.java
@@ -18,13 +18,13 @@
 package org.apache.servicecomb.metrics.core.event;
 
 import org.apache.servicecomb.core.metrics.InvocationStartProcessingEvent;
-import org.apache.servicecomb.foundation.common.event.Event;
-import org.apache.servicecomb.foundation.common.event.EventListener;
 import org.apache.servicecomb.metrics.core.monitor.ProducerInvocationMonitor;
 import org.apache.servicecomb.metrics.core.monitor.RegistryMonitor;
 import org.apache.servicecomb.swagger.invocation.InvocationType;
 
-public class InvocationStartProcessingEventListener implements EventListener {
+import com.google.common.eventbus.Subscribe;
+
+public class InvocationStartProcessingEventListener {
 
   private final RegistryMonitor registryMonitor;
 
@@ -32,14 +32,8 @@ public 
InvocationStartProcessingEventListener(RegistryMonitor registryMonitor) {
     this.registryMonitor = registryMonitor;
   }
 
-  @Override
-  public Class<? extends Event> getConcernedEvent() {
-    return InvocationStartProcessingEvent.class;
-  }
-
-  @Override
-  public void process(Event data) {
-    InvocationStartProcessingEvent event = (InvocationStartProcessingEvent) 
data;
+  @Subscribe
+  public void process(InvocationStartProcessingEvent event) {
     if (InvocationType.PRODUCER.equals(event.getInvocationType())) {
       ProducerInvocationMonitor monitor = 
registryMonitor.getProducerInvocationMonitor(event.getOperationName());
       monitor.getWaitInQueue().increment(-1);
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
index c13d17327..5539f1580 100644
--- 
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
@@ -18,15 +18,15 @@
 package org.apache.servicecomb.metrics.core.event;
 
 import org.apache.servicecomb.core.metrics.InvocationStartedEvent;
-import org.apache.servicecomb.foundation.common.event.Event;
-import org.apache.servicecomb.foundation.common.event.EventListener;
 import org.apache.servicecomb.metrics.common.MetricsDimension;
 import org.apache.servicecomb.metrics.core.monitor.ConsumerInvocationMonitor;
 import org.apache.servicecomb.metrics.core.monitor.ProducerInvocationMonitor;
 import org.apache.servicecomb.metrics.core.monitor.RegistryMonitor;
 import org.apache.servicecomb.swagger.invocation.InvocationType;
 
-public class InvocationStartedEventListener implements EventListener {
+import com.google.common.eventbus.Subscribe;
+
+public class InvocationStartedEventListener {
 
   private final RegistryMonitor registryMonitor;
 
@@ -34,14 +34,8 @@ public InvocationStartedEventListener(RegistryMonitor 
registryMonitor) {
     this.registryMonitor = registryMonitor;
   }
 
-  @Override
-  public Class<? extends Event> getConcernedEvent() {
-    return InvocationStartedEvent.class;
-  }
-
-  @Override
-  public void process(Event data) {
-    InvocationStartedEvent event = (InvocationStartedEvent) data;
+  @Subscribe
+  public void process(InvocationStartedEvent event) {
     if (InvocationType.PRODUCER.equals(event.getInvocationType())) {
       ProducerInvocationMonitor monitor = 
registryMonitor.getProducerInvocationMonitor(event.getOperationName());
       monitor.getWaitInQueue().increment();
diff --git 
a/metrics/metrics-core/src/main/java/org/apache/servicecomb/metrics/core/monitor/RegistryMonitor.java
 
b/metrics/metrics-core/src/main/java/org/apache/servicecomb/metrics/core/monitor/RegistryMonitor.java
index 982e11be2..78be2827e 100644
--- 
a/metrics/metrics-core/src/main/java/org/apache/servicecomb/metrics/core/monitor/RegistryMonitor.java
+++ 
b/metrics/metrics-core/src/main/java/org/apache/servicecomb/metrics/core/monitor/RegistryMonitor.java
@@ -24,9 +24,6 @@
 import org.apache.servicecomb.metrics.common.ConsumerInvocationMetric;
 import org.apache.servicecomb.metrics.common.ProducerInvocationMetric;
 import org.apache.servicecomb.metrics.common.RegistryMetric;
-import org.apache.servicecomb.metrics.core.custom.DefaultCounterService;
-import org.apache.servicecomb.metrics.core.custom.DefaultGaugeService;
-import org.apache.servicecomb.metrics.core.custom.DefaultWindowCounterService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Component;
 
@@ -39,20 +36,9 @@
 
   private final Map<String, ProducerInvocationMonitor> 
producerInvocationMonitors;
 
-  private final DefaultCounterService counterService;
-
-  private final DefaultGaugeService gaugeService;
-
-  private final DefaultWindowCounterService windowCounterService;
-
   @Autowired
-  public RegistryMonitor(SystemMonitor systemMonitor,
-      DefaultCounterService counterService, DefaultGaugeService gaugeService,
-      DefaultWindowCounterService windowCounterService) {
+  public RegistryMonitor(SystemMonitor systemMonitor) {
     this.systemMonitor = systemMonitor;
-    this.counterService = counterService;
-    this.gaugeService = gaugeService;
-    this.windowCounterService = windowCounterService;
     this.consumerInvocationMonitors = new ConcurrentHashMapEx<>();
     this.producerInvocationMonitors = new ConcurrentHashMapEx<>();
   }
@@ -75,11 +61,6 @@ public RegistryMetric toRegistryMetric(int windowTimeIndex) {
       producerInvocationMetrics.put(monitor.getOperationName(), 
monitor.toMetric(windowTimeIndex));
     }
 
-    Map<String, Double> customMetrics = new 
HashMap<>(counterService.toMetrics());
-    customMetrics.putAll(gaugeService.toMetrics());
-    customMetrics.putAll(windowCounterService.toMetrics(windowTimeIndex));
-
-    return new RegistryMetric(systemMonitor.toMetric(), 
consumerInvocationMetrics, producerInvocationMetrics,
-        customMetrics);
+    return new RegistryMetric(systemMonitor.toMetric(), 
consumerInvocationMetrics, producerInvocationMetrics);
   }
 }
diff --git 
a/metrics/metrics-core/src/main/java/org/apache/servicecomb/metrics/core/publish/DefaultMetricsPublisher.java
 
b/metrics/metrics-core/src/main/java/org/apache/servicecomb/metrics/core/publish/DefaultMetricsPublisher.java
index fc7e39781..502ca4c27 100644
--- 
a/metrics/metrics-core/src/main/java/org/apache/servicecomb/metrics/core/publish/DefaultMetricsPublisher.java
+++ 
b/metrics/metrics-core/src/main/java/org/apache/servicecomb/metrics/core/publish/DefaultMetricsPublisher.java
@@ -18,9 +18,9 @@
 package org.apache.servicecomb.metrics.core.publish;
 
 import java.util.List;
+import java.util.Map;
 
 import org.apache.servicecomb.metrics.common.MetricsPublisher;
-import org.apache.servicecomb.metrics.common.RegistryMetric;
 import org.apache.servicecomb.provider.rest.common.RestSchema;
 import org.springframework.web.bind.annotation.CrossOrigin;
 import org.springframework.web.bind.annotation.PathVariable;
@@ -50,8 +50,8 @@ public DefaultMetricsPublisher(DataSource dataSource) {
   @RequestMapping(path = "/", method = RequestMethod.GET)
   @CrossOrigin
   @Override
-  public RegistryMetric metrics() {
-    return dataSource.getRegistryMetric();
+  public Map<String, Double> metrics() {
+    return dataSource.getRegistryMetric().toMap();
   }
 
   @ApiResponses({
@@ -60,7 +60,7 @@ public RegistryMetric metrics() {
   @RequestMapping(path = "/{windowTime}", method = RequestMethod.GET)
   @CrossOrigin
   @Override
-  public RegistryMetric metricsWithWindowTime(@PathVariable(name = 
"windowTime") long windowTime) {
-    return dataSource.getRegistryMetric(windowTime);
+  public Map<String, Double> metricsWithWindowTime(@PathVariable(name = 
"windowTime") long windowTime) {
+    return dataSource.getRegistryMetric(windowTime).toMap();
   }
 }
diff --git 
a/metrics/metrics-core/src/test/java/org/apache/servicecomb/metrics/core/TestCustomMetrics.java
 
b/metrics/metrics-core/src/test/java/org/apache/servicecomb/metrics/core/TestCustomMetrics.java
deleted file mode 100644
index b0ac7e19f..000000000
--- 
a/metrics/metrics-core/src/test/java/org/apache/servicecomb/metrics/core/TestCustomMetrics.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.metrics.core;
-
-import org.apache.servicecomb.metrics.common.RegistryMetric;
-import org.apache.servicecomb.metrics.core.custom.DefaultCounterService;
-import org.apache.servicecomb.metrics.core.custom.DefaultGaugeService;
-import org.apache.servicecomb.metrics.core.custom.DefaultWindowCounterService;
-import org.apache.servicecomb.metrics.core.monitor.DefaultSystemMonitor;
-import org.apache.servicecomb.metrics.core.monitor.RegistryMonitor;
-import org.apache.servicecomb.metrics.core.monitor.SystemMonitor;
-import org.apache.servicecomb.metrics.core.publish.DefaultDataSource;
-import org.junit.Assert;
-import org.junit.Test;
-
-public class TestCustomMetrics {
-
-  @Test
-  public void testCustom() throws InterruptedException {
-    SystemMonitor systemMonitor = new DefaultSystemMonitor();
-    DefaultCounterService counterService = new DefaultCounterService();
-    DefaultGaugeService gaugeService = new DefaultGaugeService();
-    DefaultWindowCounterService windowCounterService = new 
DefaultWindowCounterService();
-
-    RegistryMonitor registryMonitor = new RegistryMonitor(systemMonitor, 
counterService, gaugeService,
-        windowCounterService);
-    DefaultDataSource dataSource = new DefaultDataSource(registryMonitor, 
"1000,2000,3000");
-
-    counterService.increment("C1");
-    counterService.increment("C1");
-    counterService.decrement("C1");
-
-    counterService.increment("C2", 99);
-    counterService.reset("C2");
-
-    counterService.increment("C3", 20);
-
-    gaugeService.update("G1", 100);
-    gaugeService.update("G1", 200);
-    gaugeService.update("G2", 150);
-
-    windowCounterService.record("W1", 100);
-    windowCounterService.record("W1", 200);
-    windowCounterService.record("W1", 300);
-    windowCounterService.record("W1", 400);
-
-    //sim lease one window time
-    Thread.sleep(1000);
-
-    RegistryMetric metric = dataSource.getRegistryMetric(1000);
-
-    Assert.assertEquals(1, metric.getCustomMetrics().get("C1").intValue());
-    Assert.assertEquals(0, metric.getCustomMetrics().get("C2").intValue());
-    Assert.assertEquals(20, metric.getCustomMetrics().get("C3").intValue());
-    Assert.assertEquals(200, metric.getCustomMetrics().get("G1").intValue());
-    Assert.assertEquals(150, metric.getCustomMetrics().get("G2").intValue());
-
-    Assert.assertEquals(1000, metric.getCustomMetrics().get("W1.total"), 0);
-    Assert.assertEquals(4, metric.getCustomMetrics().get("W1.count"), 0);
-    Assert.assertEquals(4, metric.getCustomMetrics().get("W1.tps"), 0);
-    Assert.assertEquals(1000, metric.getCustomMetrics().get("W1.rate"), 0);
-    Assert.assertEquals(250, metric.getCustomMetrics().get("W1.average"), 0);
-    Assert.assertEquals(100, metric.getCustomMetrics().get("W1.min"), 0);
-    Assert.assertEquals(400, metric.getCustomMetrics().get("W1.max"), 0);
-  }
-}
diff --git 
a/metrics/metrics-core/src/test/java/org/apache/servicecomb/metrics/core/TestEventAndRunner.java
 
b/metrics/metrics-core/src/test/java/org/apache/servicecomb/metrics/core/TestEventAndRunner.java
index db400d191..67fecb72d 100644
--- 
a/metrics/metrics-core/src/test/java/org/apache/servicecomb/metrics/core/TestEventAndRunner.java
+++ 
b/metrics/metrics-core/src/test/java/org/apache/servicecomb/metrics/core/TestEventAndRunner.java
@@ -32,12 +32,9 @@
 import org.apache.servicecomb.core.metrics.InvocationFinishedEvent;
 import org.apache.servicecomb.core.metrics.InvocationStartProcessingEvent;
 import org.apache.servicecomb.core.metrics.InvocationStartedEvent;
-import org.apache.servicecomb.foundation.common.utils.EventUtils;
+import org.apache.servicecomb.foundation.common.event.EventManager;
 import org.apache.servicecomb.metrics.common.MetricsDimension;
 import org.apache.servicecomb.metrics.common.RegistryMetric;
-import org.apache.servicecomb.metrics.core.custom.DefaultCounterService;
-import org.apache.servicecomb.metrics.core.custom.DefaultGaugeService;
-import org.apache.servicecomb.metrics.core.custom.DefaultWindowCounterService;
 import org.apache.servicecomb.metrics.core.event.DefaultEventListenerManager;
 import 
org.apache.servicecomb.metrics.core.event.dimension.StatusConvertorFactory;
 import org.apache.servicecomb.metrics.core.monitor.DefaultSystemMonitor;
@@ -71,8 +68,7 @@ public void test() throws InterruptedException {
     when(nonHeap.getUsed()).thenReturn(800L);
 
     DefaultSystemMonitor systemMonitor = new 
DefaultSystemMonitor(systemMXBean, threadMXBean, memoryMXBean);
-    RegistryMonitor monitor = new RegistryMonitor(systemMonitor, new 
DefaultCounterService(), new DefaultGaugeService(),
-        new DefaultWindowCounterService());
+    RegistryMonitor monitor = new RegistryMonitor(systemMonitor);
     DefaultDataSource dataSource = new DefaultDataSource(monitor, 
"1000,2000,3000");
 
     List<Long> intervals = dataSource.getAppliedWindowTime();
@@ -84,45 +80,42 @@ public void test() throws InterruptedException {
 
     //fun1 is a PRODUCER invocation call 2 time and all is completed
     //two time success
-    EventUtils.triggerEvent(new InvocationStartedEvent("fun1", 
InvocationType.PRODUCER, System.nanoTime()));
-    EventUtils.triggerEvent(
+    EventManager.post(new InvocationStartedEvent("fun1", 
InvocationType.PRODUCER, System.nanoTime()));
+    EventManager.post(
         new InvocationStartProcessingEvent("fun1", InvocationType.PRODUCER,
             TimeUnit.MILLISECONDS.toNanos(100)));
-    EventUtils
-        .triggerEvent(new InvocationFinishedEvent("fun1", 
InvocationType.PRODUCER,
-            TimeUnit.MILLISECONDS.toNanos(200), 
TimeUnit.MILLISECONDS.toNanos(300), 200, true));
+    EventManager.post(new InvocationFinishedEvent("fun1", 
InvocationType.PRODUCER,
+        TimeUnit.MILLISECONDS.toNanos(200), 
TimeUnit.MILLISECONDS.toNanos(300), 200, true));
 
-    EventUtils.triggerEvent(new InvocationStartedEvent("fun1", 
InvocationType.PRODUCER, System.nanoTime()));
-    EventUtils.triggerEvent(
+    EventManager.post(new InvocationStartedEvent("fun1", 
InvocationType.PRODUCER, System.nanoTime()));
+    EventManager.post(
         new InvocationStartProcessingEvent("fun1", InvocationType.PRODUCER,
             TimeUnit.MILLISECONDS.toNanos(300)));
-    EventUtils
-        .triggerEvent(new InvocationFinishedEvent("fun1", 
InvocationType.PRODUCER,
-            TimeUnit.MILLISECONDS.toNanos(400), 
TimeUnit.MILLISECONDS.toNanos(700), 500, false));
+    EventManager.post(new InvocationFinishedEvent("fun1", 
InvocationType.PRODUCER,
+        TimeUnit.MILLISECONDS.toNanos(400), 
TimeUnit.MILLISECONDS.toNanos(700), 500, false));
 
     
//==========================================================================
 
     //fun3 is a PRODUCER invocation call uncompleted
-    EventUtils.triggerEvent(new InvocationStartedEvent("fun3", 
InvocationType.PRODUCER, System.nanoTime()));
-    EventUtils.triggerEvent(
+    EventManager.post(new InvocationStartedEvent("fun3", 
InvocationType.PRODUCER, System.nanoTime()));
+    EventManager.post(
         new InvocationStartProcessingEvent("fun3", InvocationType.PRODUCER,
             TimeUnit.MILLISECONDS.toNanos(500)));
 
     
//==========================================================================
 
     //fun4 is a PRODUCER call only started and no processing start and finished
-    EventUtils.triggerEvent(new InvocationStartedEvent("fun4", 
InvocationType.PRODUCER, System.nanoTime()));
+    EventManager.post(new InvocationStartedEvent("fun4", 
InvocationType.PRODUCER, System.nanoTime()));
 
     
//==========================================================================
 
     //fun2 is a CONSUMER invocation call once and completed
-    EventUtils.triggerEvent(new InvocationStartedEvent("fun2", 
InvocationType.CONSUMER, System.nanoTime()));
-    EventUtils.triggerEvent(
+    EventManager.post(new InvocationStartedEvent("fun2", 
InvocationType.CONSUMER, System.nanoTime()));
+    EventManager.post(
         new InvocationStartProcessingEvent("fun2", InvocationType.CONSUMER,
             TimeUnit.MILLISECONDS.toNanos(100)));
-    EventUtils
-        .triggerEvent(new InvocationFinishedEvent("fun2", 
InvocationType.CONSUMER,
-            TimeUnit.MILLISECONDS.toNanos(200), 
TimeUnit.MILLISECONDS.toNanos(300), 200, true));
+    EventManager.post(new InvocationFinishedEvent("fun2", 
InvocationType.CONSUMER,
+        TimeUnit.MILLISECONDS.toNanos(200), 
TimeUnit.MILLISECONDS.toNanos(300), 200, true));
 
     
//==========================================================================
 
@@ -310,7 +303,7 @@ public void test() throws InterruptedException {
         .getTotalValue(MetricsDimension.DIMENSION_STATUS, 
MetricsDimension.DIMENSION_STATUS_SUCCESS_FAILED_FAILED)
         .getValue(), 0);
 
-    Map<String, Number> metrics = model.toMap();
+    Map<String, Double> metrics = model.toMap();
     Assert.assertEquals(108, metrics.size());
 
     Assert.assertEquals(1.0, 
model.getInstanceMetric().getSystemMetric().getCpuLoad(), 0);
diff --git 
a/metrics/metrics-core/src/test/java/org/apache/servicecomb/metrics/core/TestPublisher.java
 
b/metrics/metrics-core/src/test/java/org/apache/servicecomb/metrics/core/TestPublisher.java
index 8650fc5e6..68bbe6dd8 100644
--- 
a/metrics/metrics-core/src/test/java/org/apache/servicecomb/metrics/core/TestPublisher.java
+++ 
b/metrics/metrics-core/src/test/java/org/apache/servicecomb/metrics/core/TestPublisher.java
@@ -23,10 +23,6 @@
 import java.util.List;
 import java.util.Map;
 
-import org.apache.servicecomb.metrics.common.RegistryMetric;
-import org.apache.servicecomb.metrics.core.custom.DefaultCounterService;
-import org.apache.servicecomb.metrics.core.custom.DefaultGaugeService;
-import org.apache.servicecomb.metrics.core.custom.DefaultWindowCounterService;
 import org.apache.servicecomb.metrics.core.monitor.DefaultSystemMonitor;
 import org.apache.servicecomb.metrics.core.monitor.RegistryMonitor;
 import org.apache.servicecomb.metrics.core.monitor.SystemMonitor;
@@ -40,17 +36,14 @@
   @Test
   public void test() {
     SystemMonitor systemMonitor = new DefaultSystemMonitor();
-    RegistryMonitor registryMonitor = new RegistryMonitor(systemMonitor, new 
DefaultCounterService(),
-        new DefaultGaugeService(), new DefaultWindowCounterService());
+    RegistryMonitor registryMonitor = new RegistryMonitor(systemMonitor);
     DefaultDataSource dataSource = new DefaultDataSource(registryMonitor, 
"1000,2000,3000,3000,2000,1000");
     DefaultMetricsPublisher publisher = new 
DefaultMetricsPublisher(dataSource);
 
-    RegistryMetric registryMetric = publisher.metrics();
-    Map<String, Number> metricsMap = registryMetric.toMap();
+    Map<String, Double> metricsMap = publisher.metrics();
     Assert.assertEquals(31, metricsMap.size());
 
-    registryMetric = publisher.metricsWithWindowTime(1000);
-    metricsMap = registryMetric.toMap();
+    metricsMap = publisher.metricsWithWindowTime(1000);
     Assert.assertEquals(31, metricsMap.size());
 
     List<Long> appliedWindowTime = publisher.getAppliedWindowTime();
diff --git 
a/metrics/metrics-core/src/test/java/org/apache/servicecomb/metrics/core/TestStatusDimension.java
 
b/metrics/metrics-core/src/test/java/org/apache/servicecomb/metrics/core/TestStatusDimension.java
index 844aa0476..b7424209e 100644
--- 
a/metrics/metrics-core/src/test/java/org/apache/servicecomb/metrics/core/TestStatusDimension.java
+++ 
b/metrics/metrics-core/src/test/java/org/apache/servicecomb/metrics/core/TestStatusDimension.java
@@ -22,12 +22,9 @@
 import org.apache.servicecomb.core.metrics.InvocationFinishedEvent;
 import org.apache.servicecomb.core.metrics.InvocationStartProcessingEvent;
 import org.apache.servicecomb.core.metrics.InvocationStartedEvent;
-import org.apache.servicecomb.foundation.common.utils.EventUtils;
+import org.apache.servicecomb.foundation.common.event.EventManager;
 import org.apache.servicecomb.metrics.common.MetricsDimension;
 import org.apache.servicecomb.metrics.common.RegistryMetric;
-import org.apache.servicecomb.metrics.core.custom.DefaultCounterService;
-import org.apache.servicecomb.metrics.core.custom.DefaultGaugeService;
-import org.apache.servicecomb.metrics.core.custom.DefaultWindowCounterService;
 import org.apache.servicecomb.metrics.core.event.DefaultEventListenerManager;
 import 
org.apache.servicecomb.metrics.core.event.dimension.StatusConvertorFactory;
 import org.apache.servicecomb.metrics.core.monitor.DefaultSystemMonitor;
@@ -100,60 +97,53 @@ public void testCodeDimension() throws 
InterruptedException {
   private RegistryMetric prepare(String outputLevel) throws 
InterruptedException {
     DefaultSystemMonitor systemMonitor = new DefaultSystemMonitor();
 
-    RegistryMonitor monitor = new RegistryMonitor(systemMonitor, new 
DefaultCounterService(), new DefaultGaugeService(),
-        new DefaultWindowCounterService());
+    RegistryMonitor monitor = new RegistryMonitor(systemMonitor);
     DefaultDataSource dataSource = new DefaultDataSource(monitor, 
"1000,2000,3000");
 
     new DefaultEventListenerManager(monitor, new StatusConvertorFactory(), 
outputLevel);
 
-    EventUtils.triggerEvent(new InvocationStartedEvent("fun1", 
InvocationType.PRODUCER, System.nanoTime()));
-    EventUtils.triggerEvent(
+    EventManager.post(new InvocationStartedEvent("fun1", 
InvocationType.PRODUCER, System.nanoTime()));
+    EventManager.post(
         new InvocationStartProcessingEvent("fun1", InvocationType.PRODUCER,
             TimeUnit.MILLISECONDS.toNanos(100)));
-    EventUtils
-        .triggerEvent(new InvocationFinishedEvent("fun1", 
InvocationType.PRODUCER,
-            TimeUnit.MILLISECONDS.toNanos(200), 
TimeUnit.MILLISECONDS.toNanos(300), 222, true));
+    EventManager.post(new InvocationFinishedEvent("fun1", 
InvocationType.PRODUCER,
+        TimeUnit.MILLISECONDS.toNanos(200), 
TimeUnit.MILLISECONDS.toNanos(300), 222, true));
 
-    EventUtils.triggerEvent(new InvocationStartedEvent("fun1", 
InvocationType.PRODUCER, System.nanoTime()));
-    EventUtils.triggerEvent(
+    EventManager.post(new InvocationStartedEvent("fun1", 
InvocationType.PRODUCER, System.nanoTime()));
+    EventManager.post(
         new InvocationStartProcessingEvent("fun1", InvocationType.PRODUCER,
             TimeUnit.MILLISECONDS.toNanos(100)));
-    EventUtils
-        .triggerEvent(new InvocationFinishedEvent("fun1", 
InvocationType.PRODUCER,
-            TimeUnit.MILLISECONDS.toNanos(200), 
TimeUnit.MILLISECONDS.toNanos(300), 333, false));
+    EventManager.post(new InvocationFinishedEvent("fun1", 
InvocationType.PRODUCER,
+        TimeUnit.MILLISECONDS.toNanos(200), 
TimeUnit.MILLISECONDS.toNanos(300), 333, false));
 
-    EventUtils.triggerEvent(new InvocationStartedEvent("fun1", 
InvocationType.PRODUCER, System.nanoTime()));
-    EventUtils.triggerEvent(
+    EventManager.post(new InvocationStartedEvent("fun1", 
InvocationType.PRODUCER, System.nanoTime()));
+    EventManager.post(
         new InvocationStartProcessingEvent("fun1", InvocationType.PRODUCER,
             TimeUnit.MILLISECONDS.toNanos(100)));
-    EventUtils
-        .triggerEvent(new InvocationFinishedEvent("fun1", 
InvocationType.PRODUCER,
-            TimeUnit.MILLISECONDS.toNanos(200), 
TimeUnit.MILLISECONDS.toNanos(300), 444, false));
+    EventManager.post(new InvocationFinishedEvent("fun1", 
InvocationType.PRODUCER,
+        TimeUnit.MILLISECONDS.toNanos(200), 
TimeUnit.MILLISECONDS.toNanos(300), 444, false));
 
-    EventUtils.triggerEvent(new InvocationStartedEvent("fun1", 
InvocationType.PRODUCER, System.nanoTime()));
-    EventUtils.triggerEvent(
+    EventManager.post(new InvocationStartedEvent("fun1", 
InvocationType.PRODUCER, System.nanoTime()));
+    EventManager.post(
         new InvocationStartProcessingEvent("fun1", InvocationType.PRODUCER,
             TimeUnit.MILLISECONDS.toNanos(100)));
-    EventUtils
-        .triggerEvent(new InvocationFinishedEvent("fun1", 
InvocationType.PRODUCER,
-            TimeUnit.MILLISECONDS.toNanos(200), 
TimeUnit.MILLISECONDS.toNanos(300), 555, false));
+    EventManager.post(new InvocationFinishedEvent("fun1", 
InvocationType.PRODUCER,
+        TimeUnit.MILLISECONDS.toNanos(200), 
TimeUnit.MILLISECONDS.toNanos(300), 555, false));
 
-    EventUtils.triggerEvent(new InvocationStartedEvent("fun1", 
InvocationType.PRODUCER, System.nanoTime()));
-    EventUtils.triggerEvent(
+    EventManager.post(new InvocationStartedEvent("fun1", 
InvocationType.PRODUCER, System.nanoTime()));
+    EventManager.post(
         new InvocationStartProcessingEvent("fun1", InvocationType.PRODUCER,
             TimeUnit.MILLISECONDS.toNanos(100)));
-    EventUtils
-        .triggerEvent(new InvocationFinishedEvent("fun1", 
InvocationType.PRODUCER,
-            TimeUnit.MILLISECONDS.toNanos(200), 
TimeUnit.MILLISECONDS.toNanos(300), 666, false));
+    EventManager.post(new InvocationFinishedEvent("fun1", 
InvocationType.PRODUCER,
+        TimeUnit.MILLISECONDS.toNanos(200), 
TimeUnit.MILLISECONDS.toNanos(300), 666, false));
 
     //fun2 is a CONSUMER invocation call once and completed
-    EventUtils.triggerEvent(new InvocationStartedEvent("fun2", 
InvocationType.CONSUMER, System.nanoTime()));
-    EventUtils.triggerEvent(
+    EventManager.post(new InvocationStartedEvent("fun2", 
InvocationType.CONSUMER, System.nanoTime()));
+    EventManager.post(
         new InvocationStartProcessingEvent("fun2", InvocationType.CONSUMER,
             TimeUnit.MILLISECONDS.toNanos(100)));
-    EventUtils
-        .triggerEvent(new InvocationFinishedEvent("fun2", 
InvocationType.CONSUMER,
-            TimeUnit.MILLISECONDS.toNanos(200), 
TimeUnit.MILLISECONDS.toNanos(300), 200, true));
+    EventManager.post(new InvocationFinishedEvent("fun2", 
InvocationType.CONSUMER,
+        TimeUnit.MILLISECONDS.toNanos(200), 
TimeUnit.MILLISECONDS.toNanos(300), 200, true));
 
     //sim lease one window time
     Thread.sleep(1000);
diff --git 
a/metrics/metrics-integration/metrics-prometheus/src/main/java/org/apache/servicecomb/metrics/prometheus/MetricsCollector.java
 
b/metrics/metrics-integration/metrics-prometheus/src/main/java/org/apache/servicecomb/metrics/prometheus/MetricsCollector.java
index 52bab8e11..27063b124 100644
--- 
a/metrics/metrics-integration/metrics-prometheus/src/main/java/org/apache/servicecomb/metrics/prometheus/MetricsCollector.java
+++ 
b/metrics/metrics-integration/metrics-prometheus/src/main/java/org/apache/servicecomb/metrics/prometheus/MetricsCollector.java
@@ -88,22 +88,9 @@ public MetricsCollector(DataSource dataSource) {
           .add(new MetricFamilySamples("Producer Side", Type.UNTYPED, 
"Producer Side Metrics", producerSamples));
     }
 
-    if (registryMetric.getCustomMetrics().size() != 0) {
-      familySamples.add(getFamilySamples("User Custom", 
registryMetric.getCustomMetrics()));
-    }
-
     return familySamples;
   }
 
-  private <T extends Number> MetricFamilySamples getFamilySamples(String name, 
Map<String, T> metrics) {
-    List<Sample> samples = metrics.entrySet()
-        .stream()
-        .map((entry) -> new Sample(entry.getKey().replace(".", "_"),
-            new ArrayList<>(), new ArrayList<>(), 
entry.getValue().doubleValue()))
-        .collect(Collectors.toList());
-    return new MetricFamilySamples(name, Type.UNTYPED, name + " Metrics", 
samples);
-  }
-
   private List<Sample> convertConsumerMetric(ConsumerInvocationMetric metric) {
     return convertMetricValues(metric.getConsumerLatency().toMap());
   }
@@ -119,10 +106,10 @@ public MetricsCollector(DataSource dataSource) {
     return samples;
   }
 
-  private List<Sample> convertMetricValues(Map<String, Number> metrics) {
+  private List<Sample> convertMetricValues(Map<String, Double> metrics) {
     return metrics.entrySet().stream().map((entry) ->
         new Sample(formatMetricName(entry.getKey()), new ArrayList<>(), new 
ArrayList<>(),
-            entry.getValue().doubleValue())).collect(Collectors.toList());
+            entry.getValue())).collect(Collectors.toList());
   }
 
   private List<Sample> convertCallMetric(CallMetric metric) {
diff --git a/samples/custom-business-metrics/pom.xml 
b/samples/custom-business-metrics/pom.xml
deleted file mode 100644
index 90b60da89..000000000
--- a/samples/custom-business-metrics/pom.xml
+++ /dev/null
@@ -1,56 +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.
-  -->
-
-<project xmlns="http://maven.apache.org/POM/4.0.0";
-  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
-  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 
http://maven.apache.org/xsd/maven-4.0.0.xsd";>
-  <parent>
-    <artifactId>samples</artifactId>
-    <groupId>org.apache.servicecomb.samples</groupId>
-    <version>0.6.0-SNAPSHOT</version>
-  </parent>
-  <modelVersion>4.0.0</modelVersion>
-
-  <artifactId>custom-business-metrics</artifactId>
-  <name>Java Chassis::Samples::Custom Business Metrics</name>
-
-
-  <dependencies>
-    <dependency>
-      <groupId>org.springframework.boot</groupId>
-      <artifactId>spring-boot-starter</artifactId>
-    </dependency>
-
-    <dependency>
-      <groupId>org.apache.servicecomb</groupId>
-      <artifactId>spring-boot-starter-provider</artifactId>
-    </dependency>
-
-    <dependency>
-      <groupId>org.hibernate</groupId>
-      <artifactId>hibernate-validator</artifactId>
-    </dependency>
-
-    <dependency>
-      <groupId>org.apache.servicecomb</groupId>
-      <artifactId>metrics-core</artifactId>
-    </dependency>
-  </dependencies>
-
-
-</project>
\ No newline at end of file
diff --git 
a/samples/custom-business-metrics/src/main/java/org/apache/servicecomb/samples/metrics/custom/CustomMetricsApplication.java
 
b/samples/custom-business-metrics/src/main/java/org/apache/servicecomb/samples/metrics/custom/CustomMetricsApplication.java
deleted file mode 100644
index 3826c99a1..000000000
--- 
a/samples/custom-business-metrics/src/main/java/org/apache/servicecomb/samples/metrics/custom/CustomMetricsApplication.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.samples.metrics.custom;
-
-import org.apache.servicecomb.springboot.starter.provider.EnableServiceComb;
-import org.springframework.boot.SpringApplication;
-import org.springframework.boot.autoconfigure.SpringBootApplication;
-
-@SpringBootApplication
-@EnableServiceComb
-public class CustomMetricsApplication {
-  public static void main(String[] args) {
-    SpringApplication.run(CustomMetricsApplication.class, args);
-  }
-}
diff --git 
a/samples/custom-business-metrics/src/main/java/org/apache/servicecomb/samples/metrics/custom/ShopDemoService.java
 
b/samples/custom-business-metrics/src/main/java/org/apache/servicecomb/samples/metrics/custom/ShopDemoService.java
deleted file mode 100644
index 6e5faecd3..000000000
--- 
a/samples/custom-business-metrics/src/main/java/org/apache/servicecomb/samples/metrics/custom/ShopDemoService.java
+++ /dev/null
@@ -1,94 +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.samples.metrics.custom;
-
-import java.math.BigDecimal;
-import java.math.RoundingMode;
-
-import org.apache.servicecomb.metrics.core.custom.CounterService;
-import org.apache.servicecomb.metrics.core.custom.GaugeService;
-import org.apache.servicecomb.metrics.core.custom.WindowCounterService;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Component;
-
-@Component
-public class ShopDemoService {
-
-  private final CounterService counterService;
-
-  private final GaugeService gaugeService;
-
-  private final WindowCounterService windowCounterService;
-
-  //autowire metrics service
-  @Autowired
-  public ShopDemoService(CounterService counterService, GaugeService 
gaugeService,
-      WindowCounterService windowCounterService) {
-    this.counterService = counterService;
-    this.gaugeService = gaugeService;
-    this.windowCounterService = windowCounterService;
-
-    login(null,null);
-  }
-
-  public void login(String name, String password) {
-    counterService.increment("Active User");
-  }
-
-  public void logout(String session) {
-    counterService.decrement("Active User");
-  }
-
-  public void order(double amount) throws InterruptedException {
-    long start = System.currentTimeMillis();
-    //sim  do order process
-    Thread.sleep(100);
-
-    //sim record order process time
-    windowCounterService.record("Order Latency", System.currentTimeMillis() - 
start);
-
-    //plus one
-    windowCounterService.record("Order Count", 1);
-
-    //only support long,please do unit convert ,$99.00 dollar -> $9900 cent, 
$59.99 dollar -> $5999 cent
-    windowCounterService.record("Order Amount", (long) round(amount * 100, 0));
-  }
-
-  public void discount(double value) {
-    //make a discount to Levis Jeans
-
-    //record current Levis Jeans Discount
-    gaugeService.update("Levis Jeans Discount", value);
-  }
-
-  private double round(double value, int places) {
-    if (!Double.isNaN(value)) {
-      BigDecimal decimal = new BigDecimal(value);
-      return decimal.setScale(places, RoundingMode.HALF_UP).doubleValue();
-    }
-    return 0;
-  }
-
-  /*  Output of RegistryMetric.customMetrics :
-   *  Active User
-   *  Order Latency (total,count,tps,rate,average,max,min)
-   *  Order Count (total,count,tps,rate,average,max,min)
-   *  Order Amount (total,count,tps,rate,average,max,min)
-   *  Levis Jeans Discount
-   */
-}
diff --git 
a/samples/custom-business-metrics/src/main/resources/microservice.yaml 
b/samples/custom-business-metrics/src/main/resources/microservice.yaml
deleted file mode 100644
index c1c9226ec..000000000
--- a/samples/custom-business-metrics/src/main/resources/microservice.yaml
+++ /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.
-## ---------------------------------------------------------------------------
-
-# all interconnected microservices must belong to an application wth the same 
ID
-APPLICATION_ID: metrics
-service_description:
-# name of the declaring microservice
-  name: metricsCustom
-  version: 0.0.1
-cse:
-  service:
-    registry:
-      address: http://127.0.0.1:30100
-  rest:
-    address: 0.0.0.0:7777
\ No newline at end of file
diff --git 
a/samples/metrics-write-file-sample/metrics-write-file/src/main/java/org/apache/servicecomb/samples/mwf/SimpleFileContentConvertor.java
 
b/samples/metrics-write-file-sample/metrics-write-file/src/main/java/org/apache/servicecomb/samples/mwf/SimpleFileContentConvertor.java
index 839fe0397..997b9d8af 100644
--- 
a/samples/metrics-write-file-sample/metrics-write-file/src/main/java/org/apache/servicecomb/samples/mwf/SimpleFileContentConvertor.java
+++ 
b/samples/metrics-write-file-sample/metrics-write-file/src/main/java/org/apache/servicecomb/samples/mwf/SimpleFileContentConvertor.java
@@ -43,10 +43,10 @@ public SimpleFileContentConvertor() {
   @Override
   public Map<String, String> convert(RegistryMetric registryMetric) {
     Map<String, String> pickedMetrics = new HashMap<>();
-    for (Entry<String, Number> metric : registryMetric.toMap().entrySet()) {
+    for (Entry<String, Double> metric : registryMetric.toMap().entrySet()) {
       pickedMetrics.put(metric.getKey(),
           String.format(doubleStringFormatter,
-              round(metric.getValue().doubleValue(), doubleRoundPlaces)));
+              round(metric.getValue(), doubleRoundPlaces)));
     }
     return pickedMetrics;
   }
diff --git 
a/samples/metrics-write-file-sample/metrics-write-file/src/test/java/org/apache/servicecomb/samples/mwf/TestWriteFile.java
 
b/samples/metrics-write-file-sample/metrics-write-file/src/test/java/org/apache/servicecomb/samples/mwf/TestWriteFile.java
index 8571ae770..67f4b4416 100644
--- 
a/samples/metrics-write-file-sample/metrics-write-file/src/test/java/org/apache/servicecomb/samples/mwf/TestWriteFile.java
+++ 
b/samples/metrics-write-file-sample/metrics-write-file/src/test/java/org/apache/servicecomb/samples/mwf/TestWriteFile.java
@@ -156,8 +156,7 @@ public Features getFeatures() {
             new CallMetric("B2", Collections.singletonList(new 
LongMetricValue("B2", 100L, new HashMap<>())),
                 Collections.singletonList(new DoubleMetricValue("B2", 
888.66666, new HashMap<>())))));
 
-    RegistryMetric metric = new RegistryMetric(systemMetric, 
consumerInvocationMetricMap, new HashMap<>(),
-        new HashMap<>());
+    RegistryMetric metric = new RegistryMetric(systemMetric, 
consumerInvocationMetricMap, new HashMap<>());
 
     DataSource dataSource = Mockito.mock(DataSource.class);
     Mockito.when(dataSource.getRegistryMetric()).thenReturn(metric);
diff --git a/samples/pom.xml b/samples/pom.xml
index 2c60a7ced..0590c43cf 100644
--- a/samples/pom.xml
+++ b/samples/pom.xml
@@ -37,7 +37,6 @@
     <module>metrics-write-file-sample</module>
     <module>metrics-extend-healthcheck</module>
     <module>config-apollo-sample</module>
-    <module>custom-business-metrics</module>
   </modules>
 
   <dependencyManagement>
diff --git 
a/transports/transport-highway/src/main/java/org/apache/servicecomb/transport/highway/HighwayServerInvoke.java
 
b/transports/transport-highway/src/main/java/org/apache/servicecomb/transport/highway/HighwayServerInvoke.java
index 843c0fe45..d6e0b2a0a 100644
--- 
a/transports/transport-highway/src/main/java/org/apache/servicecomb/transport/highway/HighwayServerInvoke.java
+++ 
b/transports/transport-highway/src/main/java/org/apache/servicecomb/transport/highway/HighwayServerInvoke.java
@@ -30,7 +30,7 @@
 import org.apache.servicecomb.core.definition.OperationMeta;
 import org.apache.servicecomb.core.definition.SchemaMeta;
 import org.apache.servicecomb.core.metrics.InvocationStartedEvent;
-import org.apache.servicecomb.foundation.common.utils.EventUtils;
+import org.apache.servicecomb.foundation.common.event.EventManager;
 import org.apache.servicecomb.foundation.vertx.tcp.TcpConnection;
 import org.apache.servicecomb.swagger.invocation.InvocationType;
 import org.apache.servicecomb.swagger.invocation.Response;
@@ -164,7 +164,7 @@ private void sendResponse(Map<String, String> context, 
Response response) {
   public void execute() {
     InvocationStartedEvent startedEvent = new 
InvocationStartedEvent(operationMeta.getMicroserviceQualifiedName(),
         InvocationType.PRODUCER, System.nanoTime());
-    EventUtils.triggerEvent(startedEvent);
+    EventManager.post(startedEvent);
     operationMeta.getExecutor().execute(() -> runInExecutor(startedEvent));
   }
 }


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to