[jira] [Commented] (SCB-445) delete old metrics mechanism

2018-04-11 Thread ASF GitHub Bot (JIRA)

[ 
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 

[jira] [Commented] (SCB-445) delete old metrics mechanism

2018-04-10 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/SCB-445?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16432285#comment-16432285
 ] 

ASF GitHub Bot commented on SCB-445:


wujimin opened a new pull request #643: [SCB-445] Delete old metrics mechanism
URL: https://github.com/apache/incubator-servicecomb-java-chassis/pull/643
 
 
   
![image](https://user-images.githubusercontent.com/16874843/38560809-132e6182-3d09-11e8-81d5-b8a7a6e667fd.png)
   


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


> delete old metrics mechanism
> 
>
> Key: SCB-445
> URL: https://issues.apache.org/jira/browse/SCB-445
> Project: Apache ServiceComb
>  Issue Type: Sub-task
>  Components: Java-Chassis
>Reporter: wujimin
>Assignee: wujimin
>Priority: Major
> Fix For: java-chassis-1.0.0-m2
>
>




--
This message was sent by Atlassian JIRA
(v7.6.3#76005)