[
https://issues.apache.org/jira/browse/SCB-445?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16434766#comment-16434766
]
ASF GitHub Bot commented on SCB-445:
wujimin closed pull request #643: [SCB-445] Delete old metrics mechanism
URL: https://github.com/apache/incubator-servicecomb-java-chassis/pull/643
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/core/pom.xml b/core/pom.xml
index 2b593a3ab..4c67a610d 100644
--- a/core/pom.xml
+++ b/core/pom.xml
@@ -36,10 +36,6 @@
org.apache.servicecomb
swagger-invocation-core
-
- org.apache.servicecomb
- foundation-metrics
-
io.zipkin.brave
brave
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 369f07142..b3ba2811a 100644
--- a/core/src/main/java/org/apache/servicecomb/core/Invocation.java
+++ b/core/src/main/java/org/apache/servicecomb/core/Invocation.java
@@ -26,10 +26,7 @@
import org.apache.servicecomb.core.definition.SchemaMeta;
import org.apache.servicecomb.core.event.InvocationFinishEvent;
import org.apache.servicecomb.core.event.InvocationStartEvent;
-import org.apache.servicecomb.core.metrics.InvocationStartExecutionEvent;
-import org.apache.servicecomb.core.metrics.InvocationStartedEvent;
import org.apache.servicecomb.core.provider.consumer.ReferenceConfig;
-import org.apache.servicecomb.foundation.common.event.EventBus;
import org.apache.servicecomb.foundation.common.event.EventManager;
import org.apache.servicecomb.swagger.invocation.AsyncResponse;
import org.apache.servicecomb.swagger.invocation.InvocationType;
@@ -195,41 +192,14 @@ public String getMicroserviceQualifiedName() {
public void onStart() {
this.startTime = System.nanoTime();
EventManager.post(new InvocationStartEvent(this));
-
-// old logic, need to be deleted
-EventBus.getInstance().triggerEvent(new
InvocationStartedEvent(getMicroserviceQualifiedName(),
-invocationType, startTime));
}
public void onStartExecute() {
this.startExecutionTime = System.nanoTime();
-
-// old logic, need to be deleted
-triggerStartExecutionEvent();
- }
-
- private void triggerStartExecutionEvent() {
-if (InvocationType.PRODUCER.equals(invocationType)) {
- this.startExecutionTime = System.nanoTime();
- EventBus.getInstance()
- .triggerEvent(new
InvocationStartExecutionEvent(operationMeta.getMicroserviceQualifiedName()));
-}
}
public void onFinish(Response response) {
EventManager.post(new InvocationFinishEvent(this, response));
-
-// old logic, need to be deleted
-triggerFinishedEvent(response.getStatusCode());
- }
-
- private void triggerFinishedEvent(int statusCode) {
-long finishedTime = System.nanoTime();
-EventBus.getInstance()
-.triggerEvent(new
org.apache.servicecomb.core.metrics.InvocationFinishedEvent(
-operationMeta.getMicroserviceQualifiedName(), this.invocationType,
-startExecutionTime - startTime, finishedTime - startExecutionTime,
-finishedTime - startTime, statusCode));
}
public boolean isSync() {
diff --git
a/core/src/main/java/org/apache/servicecomb/core/metrics/InvocationFinishedEvent.java
b/core/src/main/java/org/apache/servicecomb/core/metrics/InvocationFinishedEvent.java
deleted file mode 100644
index e0a10d1c9..0
---
a/core/src/main/java/org/apache/servicecomb/core/metrics/InvocationFinishedEvent.java
+++ /dev/null
@@ -1,68 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.servicecomb.core.metrics;
-
-import org.apache.servicecomb.swagger.invocation.InvocationType;
-
-public class InvocationFinishedEvent {
- private final String operationName;
-
- private final InvocationType invocationType;
-
- private final long inQueueNanoTime;
-
- private final long