[jira] [Commented] (SCB-327) Update metrics publish data module

2018-02-25 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on SCB-327:


liubao68 commented on a change in pull request #555: [SCB-327] Update metrics 
publish data module (Re-organized)
URL: 
https://github.com/apache/incubator-servicecomb-java-chassis/pull/555#discussion_r170481739
 
 

 ##
 File path: 
metrics/metrics-core/src/main/java/org/apache/servicecomb/metrics/core/publish/HealthCheckerPublisher.java
 ##
 @@ -0,0 +1,49 @@
+/*
+ * 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.publish;
+
+import java.util.Map;
+
+import org.apache.servicecomb.foundation.metrics.health.HealthCheckResult;
+import org.apache.servicecomb.foundation.metrics.health.HealthCheckerManager;
+import org.apache.servicecomb.provider.rest.common.RestSchema;
+import org.springframework.web.bind.annotation.CrossOrigin;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
+
+@RestSchema(schemaId = "healthEndpoint")
+@RequestMapping(path = "/health")
+public class HealthCheckerPublisher {
+  @RequestMapping(path = "/", method = RequestMethod.GET)
+  @CrossOrigin
 
 Review comment:
   This annotation may not work


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


> Update metrics publish data module
> --
>
> Key: SCB-327
> URL: https://issues.apache.org/jira/browse/SCB-327
> Project: Apache ServiceComb
>  Issue Type: Sub-task
>  Components: Java-Chassis
>Affects Versions: java-chassis-1.0.0-m1
>Reporter: yangyongzheng
>Assignee: yangyongzheng
>Priority: Major
> Fix For: java-chassis-1.0.0-m1
>
>
> Change data publish from RegistryMetric model to map
>  adjust metrics publish format to spring cloud netflix style



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


[jira] [Commented] (SCB-327) Update metrics publish data module

2018-02-24 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on SCB-327:


coveralls commented on issue #555: [SCB-327] Update metrics publish data module 
(Re-organized)
URL: 
https://github.com/apache/incubator-servicecomb-java-chassis/pull/555#issuecomment-364824526
 
 
   
   [![Coverage 
Status](https://coveralls.io/builds/15684092/badge)](https://coveralls.io/builds/15684092)
   
   Coverage increased (+0.08%) to 87.208% when pulling 
**f7f3843a2e7e1fec7e8e7f38e1dd839b51a0b810 on zhengyangyong:SCB-327-2** into 
**b0f8224f78d3071fceb2d6df3eb8cd98df86a238 on apache:master**.
   


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


> Update metrics publish data module
> --
>
> Key: SCB-327
> URL: https://issues.apache.org/jira/browse/SCB-327
> Project: Apache ServiceComb
>  Issue Type: Sub-task
>  Components: Java-Chassis
>Affects Versions: java-chassis-1.0.0-m1
>Reporter: yangyongzheng
>Assignee: yangyongzheng
>Priority: Major
> Fix For: java-chassis-1.0.0-m1
>
>
> Change data publish from RegistryMetric model to map
>  adjust metrics publish format to spring cloud netflix style



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


[jira] [Commented] (SCB-327) Update metrics publish data module

2018-02-24 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on SCB-327:


zhengyangyong commented on a change in pull request #555: [SCB-327] Update 
metrics publish data module (Re-organized)
URL: 
https://github.com/apache/incubator-servicecomb-java-chassis/pull/555#discussion_r170439612
 
 

 ##
 File path: 
metrics/metrics-core/src/test/java/org/apache/servicecomb/metrics/core/TestHealthCheckerPublisher.java
 ##
 @@ -30,8 +30,7 @@
 
   @Test
   public void test() {
-HealthCheckerManager manager = new HealthCheckerManager();
-manager.register(new HealthChecker() {
+HealthCheckerManager.getInstance().register(new HealthChecker() {
 
 Review comment:
zero,one and two HealthChecker check logic had added in 
TestHealthCheckerManager


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


> Update metrics publish data module
> --
>
> Key: SCB-327
> URL: https://issues.apache.org/jira/browse/SCB-327
> Project: Apache ServiceComb
>  Issue Type: Sub-task
>  Components: Java-Chassis
>Affects Versions: java-chassis-1.0.0-m1
>Reporter: yangyongzheng
>Assignee: yangyongzheng
>Priority: Major
> Fix For: java-chassis-1.0.0-m1
>
>
> Change data publish from RegistryMetric model to map
>  adjust metrics publish format to spring cloud netflix style



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


[jira] [Commented] (SCB-327) Update metrics publish data module

2018-02-24 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on SCB-327:


zhengyangyong commented on a change in pull request #555: [SCB-327] Update 
metrics publish data module (Re-organized)
URL: 
https://github.com/apache/incubator-servicecomb-java-chassis/pull/555#discussion_r170439576
 
 

 ##
 File path: 
metrics/metrics-core/src/main/java/org/apache/servicecomb/metrics/core/publish/HealthCheckerPublisher.java
 ##
 @@ -66,6 +47,6 @@ public boolean checkHealth() {
   @RequestMapping(path = "/detail", method = RequestMethod.GET)
 
 Review comment:
   finnal path is /health/details


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


> Update metrics publish data module
> --
>
> Key: SCB-327
> URL: https://issues.apache.org/jira/browse/SCB-327
> Project: Apache ServiceComb
>  Issue Type: Sub-task
>  Components: Java-Chassis
>Affects Versions: java-chassis-1.0.0-m1
>Reporter: yangyongzheng
>Assignee: yangyongzheng
>Priority: Major
> Fix For: java-chassis-1.0.0-m1
>
>
> Change data publish from RegistryMetric model to map
>  adjust metrics publish format to spring cloud netflix style



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


[jira] [Commented] (SCB-327) Update metrics publish data module

2018-02-24 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on SCB-327:


zhengyangyong commented on a change in pull request #555: [SCB-327] Update 
metrics publish data module (Re-organized)
URL: 
https://github.com/apache/incubator-servicecomb-java-chassis/pull/555#discussion_r170439515
 
 

 ##
 File path: 
metrics/metrics-core/src/main/java/org/apache/servicecomb/metrics/core/publish/HealthCheckerPublisher.java
 ##
 @@ -66,6 +47,6 @@ public boolean checkHealth() {
   @RequestMapping(path = "/detail", method = RequestMethod.GET)
 
 Review comment:
   change to details


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


> Update metrics publish data module
> --
>
> Key: SCB-327
> URL: https://issues.apache.org/jira/browse/SCB-327
> Project: Apache ServiceComb
>  Issue Type: Sub-task
>  Components: Java-Chassis
>Affects Versions: java-chassis-1.0.0-m1
>Reporter: yangyongzheng
>Assignee: yangyongzheng
>Priority: Major
> Fix For: java-chassis-1.0.0-m1
>
>
> Change data publish from RegistryMetric model to map
>  adjust metrics publish format to spring cloud netflix style



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


[jira] [Commented] (SCB-327) Update metrics publish data module

2018-02-24 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on SCB-327:


zhengyangyong commented on a change in pull request #555: [SCB-327] Update 
metrics publish data module (Re-organized)
URL: 
https://github.com/apache/incubator-servicecomb-java-chassis/pull/555#discussion_r170439517
 
 

 ##
 File path: 
metrics/metrics-core/src/test/java/org/apache/servicecomb/metrics/core/TestHealthCheckerPublisher.java
 ##
 @@ -30,8 +30,7 @@
 
   @Test
   public void test() {
-HealthCheckerManager manager = new HealthCheckerManager();
-manager.register(new HealthChecker() {
+HealthCheckerManager.getInstance().register(new HealthChecker() {
 
 Review comment:
   Done


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


> Update metrics publish data module
> --
>
> Key: SCB-327
> URL: https://issues.apache.org/jira/browse/SCB-327
> Project: Apache ServiceComb
>  Issue Type: Sub-task
>  Components: Java-Chassis
>Affects Versions: java-chassis-1.0.0-m1
>Reporter: yangyongzheng
>Assignee: yangyongzheng
>Priority: Major
> Fix For: java-chassis-1.0.0-m1
>
>
> Change data publish from RegistryMetric model to map
>  adjust metrics publish format to spring cloud netflix style



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


[jira] [Commented] (SCB-327) Update metrics publish data module

2018-02-24 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on SCB-327:


zhengyangyong commented on a change in pull request #555: [SCB-327] Update 
metrics publish data module (Re-organized)
URL: 
https://github.com/apache/incubator-servicecomb-java-chassis/pull/555#discussion_r170439521
 
 

 ##
 File path: 
foundations/foundation-metrics/src/test/java/org/apache/servicecomb/foundation/metrics/publish/TestMetricNode.java
 ##
 @@ -0,0 +1,65 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.servicecomb.foundation.metrics.publish;
+
+import java.util.HashMap;
+import java.util.Map;
+import java.util.concurrent.TimeUnit;
+
+import org.junit.Assert;
+import org.junit.Test;
+
+public class TestMetricNode {
+  @Test
+  public void test() {
 
 Review comment:
   OK


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


> Update metrics publish data module
> --
>
> Key: SCB-327
> URL: https://issues.apache.org/jira/browse/SCB-327
> Project: Apache ServiceComb
>  Issue Type: Sub-task
>  Components: Java-Chassis
>Affects Versions: java-chassis-1.0.0-m1
>Reporter: yangyongzheng
>Assignee: yangyongzheng
>Priority: Major
> Fix For: java-chassis-1.0.0-m1
>
>
> Change data publish from RegistryMetric model to map
>  adjust metrics publish format to spring cloud netflix style



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


[jira] [Commented] (SCB-327) Update metrics publish data module

2018-02-24 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on SCB-327:


WillemJiang commented on a change in pull request #555: [SCB-327] Update 
metrics publish data module (Re-organized)
URL: 
https://github.com/apache/incubator-servicecomb-java-chassis/pull/555#discussion_r170422863
 
 

 ##
 File path: 
metrics/metrics-core/src/test/java/org/apache/servicecomb/metrics/core/TestHealthCheckerPublisher.java
 ##
 @@ -30,8 +30,7 @@
 
   @Test
   public void test() {
-HealthCheckerManager manager = new HealthCheckerManager();
-manager.register(new HealthChecker() {
+HealthCheckerManager.getInstance().register(new HealthChecker() {
 
 Review comment:
   Here you just check one HealthChecker. The test should test at least 
zero,one and two HealthChecker. 


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


> Update metrics publish data module
> --
>
> Key: SCB-327
> URL: https://issues.apache.org/jira/browse/SCB-327
> Project: Apache ServiceComb
>  Issue Type: Sub-task
>  Components: Java-Chassis
>Affects Versions: java-chassis-1.0.0-m1
>Reporter: yangyongzheng
>Assignee: yangyongzheng
>Priority: Major
> Fix For: java-chassis-1.0.0-m1
>
>
> Change data publish from RegistryMetric model to map
>  adjust metrics publish format to spring cloud netflix style



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


[jira] [Commented] (SCB-327) Update metrics publish data module

2018-02-24 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on SCB-327:


WillemJiang commented on a change in pull request #555: [SCB-327] Update 
metrics publish data module (Re-organized)
URL: 
https://github.com/apache/incubator-servicecomb-java-chassis/pull/555#discussion_r170422785
 
 

 ##
 File path: 
metrics/metrics-core/src/main/java/org/apache/servicecomb/metrics/core/publish/HealthCheckerPublisher.java
 ##
 @@ -66,6 +47,6 @@ public boolean checkHealth() {
   @RequestMapping(path = "/detail", method = RequestMethod.GET)
 
 Review comment:
   The path name need to updated.


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


> Update metrics publish data module
> --
>
> Key: SCB-327
> URL: https://issues.apache.org/jira/browse/SCB-327
> Project: Apache ServiceComb
>  Issue Type: Sub-task
>  Components: Java-Chassis
>Affects Versions: java-chassis-1.0.0-m1
>Reporter: yangyongzheng
>Assignee: yangyongzheng
>Priority: Major
> Fix For: java-chassis-1.0.0-m1
>
>
> Change data publish from RegistryMetric model to map
>  adjust metrics publish format to spring cloud netflix style



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


[jira] [Commented] (SCB-327) Update metrics publish data module

2018-02-24 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on SCB-327:


WillemJiang commented on a change in pull request #555: [SCB-327] Update 
metrics publish data module (Re-organized)
URL: 
https://github.com/apache/incubator-servicecomb-java-chassis/pull/555#discussion_r170422650
 
 

 ##
 File path: 
foundations/foundation-metrics/src/test/java/org/apache/servicecomb/foundation/metrics/publish/TestMetricNode.java
 ##
 @@ -0,0 +1,65 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.servicecomb.foundation.metrics.publish;
+
+import java.util.HashMap;
+import java.util.Map;
+import java.util.concurrent.TimeUnit;
+
+import org.junit.Assert;
+import org.junit.Test;
+
+public class TestMetricNode {
+  @Test
+  public void test() {
 
 Review comment:
   You need to separate the test methods, please take 
https://github.com/apache/incubator-servicecomb-saga/blob/master/alpha/alpha-core/src/test/java/org/apache/servicecomb/saga/alpha/core/CompositeOmegaCallbackTest.java
 as an example.


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


> Update metrics publish data module
> --
>
> Key: SCB-327
> URL: https://issues.apache.org/jira/browse/SCB-327
> Project: Apache ServiceComb
>  Issue Type: Sub-task
>  Components: Java-Chassis
>Affects Versions: java-chassis-1.0.0-m1
>Reporter: yangyongzheng
>Assignee: yangyongzheng
>Priority: Major
> Fix For: java-chassis-1.0.0-m1
>
>
> Change data publish from RegistryMetric model to map
>  adjust metrics publish format to spring cloud netflix style



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


[jira] [Commented] (SCB-327) Update metrics publish data module

2018-02-24 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on SCB-327:


coveralls commented on issue #555: [SCB-327] Update metrics publish data module 
(Re-organized)
URL: 
https://github.com/apache/incubator-servicecomb-java-chassis/pull/555#issuecomment-364824526
 
 
   
   [![Coverage 
Status](https://coveralls.io/builds/15679133/badge)](https://coveralls.io/builds/15679133)
   
   Coverage increased (+0.04%) to 87.173% when pulling 
**7f85ba574e25dab6a6057c068ad58f7807194ec0 on zhengyangyong:SCB-327-2** into 
**b0f8224f78d3071fceb2d6df3eb8cd98df86a238 on apache:master**.
   


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


> Update metrics publish data module
> --
>
> Key: SCB-327
> URL: https://issues.apache.org/jira/browse/SCB-327
> Project: Apache ServiceComb
>  Issue Type: Sub-task
>  Components: Java-Chassis
>Affects Versions: java-chassis-1.0.0-m1
>Reporter: yangyongzheng
>Assignee: yangyongzheng
>Priority: Major
> Fix For: java-chassis-1.0.0-m1
>
>
> Change data publish from RegistryMetric model to map
>  adjust metrics publish format to spring cloud netflix style



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


[jira] [Commented] (SCB-327) Update metrics publish data module

2018-02-24 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on SCB-327:


coveralls commented on issue #555: [SCB-327] Update metrics publish data module 
(Re-organized)
URL: 
https://github.com/apache/incubator-servicecomb-java-chassis/pull/555#issuecomment-364824526
 
 
   
   [![Coverage 
Status](https://coveralls.io/builds/15678180/badge)](https://coveralls.io/builds/15678180)
   
   Coverage increased (+0.02%) to 87.155% when pulling 
**db0755c4f3e01bc8eb5f8e672e1beac1393beb7e on zhengyangyong:SCB-327-2** into 
**b0f8224f78d3071fceb2d6df3eb8cd98df86a238 on apache:master**.
   


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


> Update metrics publish data module
> --
>
> Key: SCB-327
> URL: https://issues.apache.org/jira/browse/SCB-327
> Project: Apache ServiceComb
>  Issue Type: Sub-task
>  Components: Java-Chassis
>Affects Versions: java-chassis-1.0.0-m1
>Reporter: yangyongzheng
>Assignee: yangyongzheng
>Priority: Major
> Fix For: java-chassis-1.0.0-m1
>
>
> Change data publish from RegistryMetric model to map
>  adjust metrics publish format to spring cloud netflix style



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


[jira] [Commented] (SCB-327) Update metrics publish data module

2018-02-24 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on SCB-327:


zhengyangyong commented on a change in pull request #555: [SCB-327] Update 
metrics publish data module (Re-organized)
URL: 
https://github.com/apache/incubator-servicecomb-java-chassis/pull/555#discussion_r170415566
 
 

 ##
 File path: 
metrics/metrics-core/src/main/java/org/apache/servicecomb/metrics/core/publish/HealthCheckerPublisher.java
 ##
 @@ -60,16 +53,19 @@ private void init(HealthCheckerManager manager) {
 
   @RequestMapping(path = "/", method = RequestMethod.GET)
   @CrossOrigin
-  public Map health() {
-return manager.check();
+  public boolean checkHealth() {
+Map results = manager.check();
+for (HealthCheckResult result : results.values()) {
+  if (!result.isHealthy()) {
+return false;
+  }
+}
+return true;
   }
 
-  @ApiResponses({
-  @ApiResponse(code = 400, response = String.class, message = "illegal 
request content"),
-  })
-  @RequestMapping(path = "/{name}", method = RequestMethod.GET)
+  @RequestMapping(path = "/detail", method = RequestMethod.GET)
   @CrossOrigin
-  public HealthCheckResult healthWithName(@PathVariable(name = "name") String 
name) {
-return manager.check(name);
+  public Map checkHealthDetail() {
 
 Review comment:
   Fixed


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


> Update metrics publish data module
> --
>
> Key: SCB-327
> URL: https://issues.apache.org/jira/browse/SCB-327
> Project: Apache ServiceComb
>  Issue Type: Sub-task
>  Components: Java-Chassis
>Affects Versions: java-chassis-1.0.0-m1
>Reporter: yangyongzheng
>Assignee: yangyongzheng
>Priority: Major
> Fix For: java-chassis-1.0.0-m1
>
>
> Change data publish from RegistryMetric model to map
>  adjust metrics publish format to spring cloud netflix style



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


[jira] [Commented] (SCB-327) Update metrics publish data module

2018-02-24 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on SCB-327:


zhengyangyong commented on a change in pull request #555: [SCB-327] Update 
metrics publish data module (Re-organized)
URL: 
https://github.com/apache/incubator-servicecomb-java-chassis/pull/555#discussion_r170415562
 
 

 ##
 File path: 
metrics/metrics-core/src/main/java/org/apache/servicecomb/metrics/core/MonitorManager.java
 ##
 @@ -0,0 +1,181 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.servicecomb.metrics.core;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Map.Entry;
+import java.util.SortedMap;
+import java.util.TreeMap;
+import java.util.concurrent.Callable;
+
+import org.apache.servicecomb.foundation.common.concurrent.ConcurrentHashMapEx;
+import org.apache.servicecomb.foundation.metrics.MetricsConst;
+
+import com.netflix.config.DynamicPropertyFactory;
+import com.netflix.servo.BasicMonitorRegistry;
+import com.netflix.servo.MonitorRegistry;
+import com.netflix.servo.monitor.BasicCounter;
+import com.netflix.servo.monitor.BasicGauge;
+import com.netflix.servo.monitor.BasicTimer;
+import com.netflix.servo.monitor.Counter;
+import com.netflix.servo.monitor.Gauge;
+import com.netflix.servo.monitor.MaxGauge;
+import com.netflix.servo.monitor.Monitor;
+import com.netflix.servo.monitor.MonitorConfig;
+import com.netflix.servo.monitor.MonitorConfig.Builder;
+import com.netflix.servo.monitor.StepCounter;
+import com.netflix.servo.monitor.Timer;
+import com.netflix.servo.tag.Tag;
+import com.netflix.servo.tag.TagList;
+
+public class MonitorManager {
+
+  private final Map counters;
+
+  private final Map maxGauges;
+
+  private final Map gauges;
+
+  private final Map timers;
+
+  private final MonitorRegistry basicMonitorRegistry;
+
+  private static final MonitorManager INSTANCE = new MonitorManager();
+
+  public static MonitorManager getInstance() {
+return INSTANCE;
+  }
+
+  private MonitorManager() {
+this.counters = new ConcurrentHashMapEx<>();
+this.maxGauges = new ConcurrentHashMapEx<>();
+this.gauges = new ConcurrentHashMapEx<>();
+this.timers = new ConcurrentHashMapEx<>();
+this.basicMonitorRegistry = new BasicMonitorRegistry();
+setupWindowTime();
+registerSystemMetrics();
+  }
+
+  private void setupWindowTime() {
+int time = 
DynamicPropertyFactory.getInstance().getIntProperty(MetricsConfig.METRICS_WINDOW_TIME,
 5000).get();
+System.getProperties().setProperty("servo.pollers", time > 0 ? 
String.valueOf(time) : "5000");
+  }
+
+  public Counter getCounter(boolean isStepCounter, String name, String... 
tags) {
 
 Review comment:
   separate into two method named getCounter and getStepCounter 


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


> Update metrics publish data module
> --
>
> Key: SCB-327
> URL: https://issues.apache.org/jira/browse/SCB-327
> Project: Apache ServiceComb
>  Issue Type: Sub-task
>  Components: Java-Chassis
>Affects Versions: java-chassis-1.0.0-m1
>Reporter: yangyongzheng
>Assignee: yangyongzheng
>Priority: Major
> Fix For: java-chassis-1.0.0-m1
>
>
> Change data publish from RegistryMetric model to map
>  adjust metrics publish format to spring cloud netflix style



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


[jira] [Commented] (SCB-327) Update metrics publish data module

2018-02-24 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on SCB-327:


zhengyangyong commented on a change in pull request #555: [SCB-327] Update 
metrics publish data module (Re-organized)
URL: 
https://github.com/apache/incubator-servicecomb-java-chassis/pull/555#discussion_r170415520
 
 

 ##
 File path: 
foundations/foundation-metrics/src/test/java/org/apache/servicecomb/foundation/metrics/publish/TestMetricNode.java
 ##
 @@ -0,0 +1,65 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.servicecomb.foundation.metrics.publish;
+
+import java.util.HashMap;
+import java.util.Map;
+import java.util.concurrent.TimeUnit;
+
+import org.junit.Assert;
+import org.junit.Test;
+
+public class TestMetricNode {
+  @Test
+  public void test() {
 
 Review comment:
   Ok ,add comments for explain check reason


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


> Update metrics publish data module
> --
>
> Key: SCB-327
> URL: https://issues.apache.org/jira/browse/SCB-327
> Project: Apache ServiceComb
>  Issue Type: Sub-task
>  Components: Java-Chassis
>Affects Versions: java-chassis-1.0.0-m1
>Reporter: yangyongzheng
>Assignee: yangyongzheng
>Priority: Major
> Fix For: java-chassis-1.0.0-m1
>
>
> Change data publish from RegistryMetric model to map
>  adjust metrics publish format to spring cloud netflix style



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


[jira] [Commented] (SCB-327) Update metrics publish data module

2018-02-24 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on SCB-327:


zhengyangyong commented on a change in pull request #555: [SCB-327] Update 
metrics publish data module (Re-organized)
URL: 
https://github.com/apache/incubator-servicecomb-java-chassis/pull/555#discussion_r170415503
 
 

 ##
 File path: 
demo/perf/src/main/java/org/apache/servicecomb/demo/perf/PerfMetricsFilePublisher.java
 ##
 @@ -75,51 +70,57 @@ private void collectVertxMetrics(MetricsLoader loader, 
StringBuilder sb) {
   }
 
   private void collectMetrics(MetricsLoader loader, StringBuilder sb) {
-MetricNode treeNode = loader
-.getMetricTree(MetricsConst.SERVICECOMB_INVOCATION, 
MetricsConst.TAG_ROLE, MetricsConst.TAG_OPERATION,
-MetricsConst.TAG_STATUS);
+MetricNode treeNode;
+try {
+  treeNode = loader
+  .getMetricTree(MetricsConst.SERVICECOMB_INVOCATION, 
MetricsConst.TAG_ROLE, MetricsConst.TAG_OPERATION,
+  MetricsConst.TAG_STATUS);
+}
+//before receive any request,there are no 
MetricsConst.SERVICECOMB_INVOCATION,so getMetricTree will throw 
ServiceCombException
+catch (ServiceCombException ignored) {
+  return;
 
 Review comment:
   add a containsId method and no need throw exception any more


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


> Update metrics publish data module
> --
>
> Key: SCB-327
> URL: https://issues.apache.org/jira/browse/SCB-327
> Project: Apache ServiceComb
>  Issue Type: Sub-task
>  Components: Java-Chassis
>Affects Versions: java-chassis-1.0.0-m1
>Reporter: yangyongzheng
>Assignee: yangyongzheng
>Priority: Major
> Fix For: java-chassis-1.0.0-m1
>
>
> Change data publish from RegistryMetric model to map
>  adjust metrics publish format to spring cloud netflix style



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


[jira] [Commented] (SCB-327) Update metrics publish data module

2018-02-23 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on SCB-327:


WillemJiang commented on a change in pull request #555: [SCB-327] Update 
metrics publish data module (Re-organized)
URL: 
https://github.com/apache/incubator-servicecomb-java-chassis/pull/555#discussion_r170412777
 
 

 ##
 File path: 
metrics/metrics-core/src/main/java/org/apache/servicecomb/metrics/core/publish/HealthCheckerPublisher.java
 ##
 @@ -60,16 +53,19 @@ private void init(HealthCheckerManager manager) {
 
   @RequestMapping(path = "/", method = RequestMethod.GET)
   @CrossOrigin
-  public Map health() {
-return manager.check();
+  public boolean checkHealth() {
+Map results = manager.check();
+for (HealthCheckResult result : results.values()) {
+  if (!result.isHealthy()) {
+return false;
+  }
+}
+return true;
   }
 
-  @ApiResponses({
-  @ApiResponse(code = 400, response = String.class, message = "illegal 
request content"),
-  })
-  @RequestMapping(path = "/{name}", method = RequestMethod.GET)
+  @RequestMapping(path = "/detail", method = RequestMethod.GET)
   @CrossOrigin
-  public HealthCheckResult healthWithName(@PathVariable(name = "name") String 
name) {
-return manager.check(name);
+  public Map checkHealthDetail() {
 
 Review comment:
   Details


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


> Update metrics publish data module
> --
>
> Key: SCB-327
> URL: https://issues.apache.org/jira/browse/SCB-327
> Project: Apache ServiceComb
>  Issue Type: Sub-task
>  Components: Java-Chassis
>Affects Versions: java-chassis-1.0.0-m1
>Reporter: yangyongzheng
>Assignee: yangyongzheng
>Priority: Major
> Fix For: java-chassis-1.0.0-m1
>
>
> Change data publish from RegistryMetric model to map
>  adjust metrics publish format to spring cloud netflix style



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


[jira] [Commented] (SCB-327) Update metrics publish data module

2018-02-23 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on SCB-327:


WillemJiang commented on a change in pull request #555: [SCB-327] Update 
metrics publish data module (Re-organized)
URL: 
https://github.com/apache/incubator-servicecomb-java-chassis/pull/555#discussion_r170412685
 
 

 ##
 File path: 
metrics/metrics-core/src/main/java/org/apache/servicecomb/metrics/core/MonitorManager.java
 ##
 @@ -0,0 +1,181 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.servicecomb.metrics.core;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Map.Entry;
+import java.util.SortedMap;
+import java.util.TreeMap;
+import java.util.concurrent.Callable;
+
+import org.apache.servicecomb.foundation.common.concurrent.ConcurrentHashMapEx;
+import org.apache.servicecomb.foundation.metrics.MetricsConst;
+
+import com.netflix.config.DynamicPropertyFactory;
+import com.netflix.servo.BasicMonitorRegistry;
+import com.netflix.servo.MonitorRegistry;
+import com.netflix.servo.monitor.BasicCounter;
+import com.netflix.servo.monitor.BasicGauge;
+import com.netflix.servo.monitor.BasicTimer;
+import com.netflix.servo.monitor.Counter;
+import com.netflix.servo.monitor.Gauge;
+import com.netflix.servo.monitor.MaxGauge;
+import com.netflix.servo.monitor.Monitor;
+import com.netflix.servo.monitor.MonitorConfig;
+import com.netflix.servo.monitor.MonitorConfig.Builder;
+import com.netflix.servo.monitor.StepCounter;
+import com.netflix.servo.monitor.Timer;
+import com.netflix.servo.tag.Tag;
+import com.netflix.servo.tag.TagList;
+
+public class MonitorManager {
+
+  private final Map counters;
+
+  private final Map maxGauges;
+
+  private final Map gauges;
+
+  private final Map timers;
+
+  private final MonitorRegistry basicMonitorRegistry;
+
+  private static final MonitorManager INSTANCE = new MonitorManager();
+
+  public static MonitorManager getInstance() {
+return INSTANCE;
+  }
+
+  private MonitorManager() {
+this.counters = new ConcurrentHashMapEx<>();
+this.maxGauges = new ConcurrentHashMapEx<>();
+this.gauges = new ConcurrentHashMapEx<>();
+this.timers = new ConcurrentHashMapEx<>();
+this.basicMonitorRegistry = new BasicMonitorRegistry();
+setupWindowTime();
+registerSystemMetrics();
+  }
+
+  private void setupWindowTime() {
+int time = 
DynamicPropertyFactory.getInstance().getIntProperty(MetricsConfig.METRICS_WINDOW_TIME,
 5000).get();
+System.getProperties().setProperty("servo.pollers", time > 0 ? 
String.valueOf(time) : "5000");
+  }
+
+  public Counter getCounter(boolean isStepCounter, String name, String... 
tags) {
 
 Review comment:
   This method exposes the counter detail which is not right way.


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


> Update metrics publish data module
> --
>
> Key: SCB-327
> URL: https://issues.apache.org/jira/browse/SCB-327
> Project: Apache ServiceComb
>  Issue Type: Sub-task
>  Components: Java-Chassis
>Affects Versions: java-chassis-1.0.0-m1
>Reporter: yangyongzheng
>Assignee: yangyongzheng
>Priority: Major
> Fix For: java-chassis-1.0.0-m1
>
>
> Change data publish from RegistryMetric model to map
>  adjust metrics publish format to spring cloud netflix style



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


[jira] [Commented] (SCB-327) Update metrics publish data module

2018-02-23 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on SCB-327:


WillemJiang commented on a change in pull request #555: [SCB-327] Update 
metrics publish data module (Re-organized)
URL: 
https://github.com/apache/incubator-servicecomb-java-chassis/pull/555#discussion_r170412622
 
 

 ##
 File path: 
foundations/foundation-metrics/src/test/java/org/apache/servicecomb/foundation/metrics/publish/TestMetricNode.java
 ##
 @@ -0,0 +1,65 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.servicecomb.foundation.metrics.publish;
+
+import java.util.HashMap;
+import java.util.Map;
+import java.util.concurrent.TimeUnit;
+
+import org.junit.Assert;
+import org.junit.Test;
+
+public class TestMetricNode {
+  @Test
+  public void test() {
 
 Review comment:
   The unit test method is not generic one, it should has some meaning which 
can help us to find out the key reason of failed test.


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


> Update metrics publish data module
> --
>
> Key: SCB-327
> URL: https://issues.apache.org/jira/browse/SCB-327
> Project: Apache ServiceComb
>  Issue Type: Sub-task
>  Components: Java-Chassis
>Affects Versions: java-chassis-1.0.0-m1
>Reporter: yangyongzheng
>Assignee: yangyongzheng
>Priority: Major
> Fix For: java-chassis-1.0.0-m1
>
>
> Change data publish from RegistryMetric model to map
>  adjust metrics publish format to spring cloud netflix style



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


[jira] [Commented] (SCB-327) Update metrics publish data module

2018-02-23 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on SCB-327:


WillemJiang commented on a change in pull request #555: [SCB-327] Update 
metrics publish data module (Re-organized)
URL: 
https://github.com/apache/incubator-servicecomb-java-chassis/pull/555#discussion_r170404621
 
 

 ##
 File path: 
demo/perf/src/main/java/org/apache/servicecomb/demo/perf/PerfMetricsFilePublisher.java
 ##
 @@ -75,51 +70,57 @@ private void collectVertxMetrics(MetricsLoader loader, 
StringBuilder sb) {
   }
 
   private void collectMetrics(MetricsLoader loader, StringBuilder sb) {
-MetricNode treeNode = loader
-.getMetricTree(MetricsConst.SERVICECOMB_INVOCATION, 
MetricsConst.TAG_ROLE, MetricsConst.TAG_OPERATION,
-MetricsConst.TAG_STATUS);
+MetricNode treeNode;
+try {
+  treeNode = loader
+  .getMetricTree(MetricsConst.SERVICECOMB_INVOCATION, 
MetricsConst.TAG_ROLE, MetricsConst.TAG_OPERATION,
+  MetricsConst.TAG_STATUS);
+}
+//before receive any request,there are no 
MetricsConst.SERVICECOMB_INVOCATION,so getMetricTree will throw 
ServiceCombException
+catch (ServiceCombException ignored) {
+  return;
 
 Review comment:
   We need to log the exception for trace the issue


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


> Update metrics publish data module
> --
>
> Key: SCB-327
> URL: https://issues.apache.org/jira/browse/SCB-327
> Project: Apache ServiceComb
>  Issue Type: Sub-task
>  Components: Java-Chassis
>Affects Versions: java-chassis-1.0.0-m1
>Reporter: yangyongzheng
>Assignee: yangyongzheng
>Priority: Major
> Fix For: java-chassis-1.0.0-m1
>
>
> Change data publish from RegistryMetric model to map
>  adjust metrics publish format to spring cloud netflix style



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


[jira] [Commented] (SCB-327) Update metrics publish data module

2018-02-23 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on SCB-327:


WillemJiang commented on a change in pull request #555: [SCB-327] Update 
metrics publish data module (Re-organized)
URL: 
https://github.com/apache/incubator-servicecomb-java-chassis/pull/555#discussion_r170404504
 
 

 ##
 File path: 
demo/demo-springmvc/springmvc-client/src/main/java/org/apache/servicecomb/demo/springmvc/client/SpringmvcClient.java
 ##
 @@ -87,10 +87,10 @@ public static void run() {
   Map metrics = restTemplate.getForObject(prefix + 
"/metrics", Map.class);
 
   TestMgr
-  .check(true, metrics.get("jvm(statistic=gauge,name=heapUsed)") != 0);
+  .check(true, metrics.get("jvm(name=heapUsed,statistic=gauge)") != 0);
   TestMgr.check(true, metrics.size() > 0);
   TestMgr.check(true, metrics.get(
-  
"servicecomb.invocation(operation=springmvc.codeFirst.saySomething,role=producer,stage=whole,statistic=count,status=200)")
+  
"servicecomb.invocation(operation=springmvc.codeFirst.saySomething,role=PRODUCER,stage=total,statistic=count,status=200)")
 
 Review comment:
   the PRODUCER is upper case, but other tags are lower case.


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


> Update metrics publish data module
> --
>
> Key: SCB-327
> URL: https://issues.apache.org/jira/browse/SCB-327
> Project: Apache ServiceComb
>  Issue Type: Sub-task
>  Components: Java-Chassis
>Affects Versions: java-chassis-1.0.0-m1
>Reporter: yangyongzheng
>Assignee: yangyongzheng
>Priority: Major
> Fix For: java-chassis-1.0.0-m1
>
>
> Change data publish from RegistryMetric model to map
>  adjust metrics publish format to spring cloud netflix style



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


[jira] [Commented] (SCB-327) Update metrics publish data module

2018-02-23 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on SCB-327:


WillemJiang commented on a change in pull request #555: [SCB-327] Update 
metrics publish data module (Re-organized)
URL: 
https://github.com/apache/incubator-servicecomb-java-chassis/pull/555#discussion_r170404398
 
 

 ##
 File path: core/src/main/java/org/apache/servicecomb/core/Invocation.java
 ##
 @@ -185,18 +185,18 @@ public String getMicroserviceQualifiedName() {
 return operationMeta.getMicroserviceQualifiedName();
   }
 
-  public void triggerStartProcessingEvent() {
-this.startProcessingTime = System.nanoTime();
-EventUtils.triggerEvent(new InvocationStartProcessingEvent(
-operationMeta.getMicroserviceQualifiedName(), this.invocationType));
+  public void triggerStartExecutionEvent() {
+if (InvocationType.PRODUCER.equals(invocationType)) {
+  this.startExecutionTime = System.nanoTime();
+  EventUtils.triggerEvent(new 
InvocationStartExecutionEvent(operationMeta.getMicroserviceQualifiedName()));
 
 Review comment:
   This EventUtils is more like a singleton.


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


> Update metrics publish data module
> --
>
> Key: SCB-327
> URL: https://issues.apache.org/jira/browse/SCB-327
> Project: Apache ServiceComb
>  Issue Type: Sub-task
>  Components: Java-Chassis
>Affects Versions: java-chassis-1.0.0-m1
>Reporter: yangyongzheng
>Assignee: yangyongzheng
>Priority: Major
> Fix For: java-chassis-1.0.0-m1
>
>
> Change data publish from RegistryMetric model to map
>  adjust metrics publish format to spring cloud netflix style



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


[jira] [Commented] (SCB-327) Update metrics publish data module

2018-02-23 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on SCB-327:


coveralls commented on issue #555: [SCB-327] Update metrics publish data module 
(Re-organized)
URL: 
https://github.com/apache/incubator-servicecomb-java-chassis/pull/555#issuecomment-364824526
 
 
   
   [![Coverage 
Status](https://coveralls.io/builds/15664758/badge)](https://coveralls.io/builds/15664758)
   
   Coverage increased (+0.02%) to 87.187% when pulling 
**ede2c86e1efce71011d8aa567f53fd318ef36106 on zhengyangyong:SCB-327-2** into 
**bfa3ebee00cd13d21645834a5b0c753ad61d2b40 on apache:master**.
   


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


> Update metrics publish data module
> --
>
> Key: SCB-327
> URL: https://issues.apache.org/jira/browse/SCB-327
> Project: Apache ServiceComb
>  Issue Type: Sub-task
>  Components: Java-Chassis
>Affects Versions: java-chassis-1.0.0-m1
>Reporter: yangyongzheng
>Assignee: yangyongzheng
>Priority: Major
> Fix For: java-chassis-1.0.0-m1
>
>
> Change data publish from RegistryMetric model to map
>  adjust metrics publish format to spring cloud netflix style



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


[jira] [Commented] (SCB-327) Update metrics publish data module

2018-02-22 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on SCB-327:


coveralls commented on issue #555: [SCB-327] Update metrics publish data module 
(Re-organized)
URL: 
https://github.com/apache/incubator-servicecomb-java-chassis/pull/555#issuecomment-364824526
 
 
   
   [![Coverage 
Status](https://coveralls.io/builds/15660687/badge)](https://coveralls.io/builds/15660687)
   
   Coverage increased (+0.03%) to 87.182% when pulling 
**195b5c26d3977b92f4a6f5d8b6131e2abceb862c on zhengyangyong:SCB-327-2** into 
**76d4c3d9d35c2e21f3d66f17b67f00fc33b2fff5 on apache:master**.
   


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


> Update metrics publish data module
> --
>
> Key: SCB-327
> URL: https://issues.apache.org/jira/browse/SCB-327
> Project: Apache ServiceComb
>  Issue Type: Sub-task
>  Components: Java-Chassis
>Affects Versions: java-chassis-1.0.0-m1
>Reporter: yangyongzheng
>Assignee: yangyongzheng
>Priority: Major
> Fix For: java-chassis-1.0.0-m1
>
>
> Change data publish from RegistryMetric model to map
>  adjust metrics publish format to spring cloud netflix style



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


[jira] [Commented] (SCB-327) Update metrics publish data module

2018-02-22 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on SCB-327:


WillemJiang commented on a change in pull request #555: [SCB-327] Update 
metrics publish data module (Re-organized)
URL: 
https://github.com/apache/incubator-servicecomb-java-chassis/pull/555#discussion_r169881157
 
 

 ##
 File path: 
common/common-rest/src/main/java/org/apache/servicecomb/common/rest/AbstractRestInvocation.java
 ##
 @@ -114,8 +113,8 @@ public String getContext(String key) {
   protected void scheduleInvocation() {
 OperationMeta operationMeta = restOperationMeta.getOperationMeta();
 
-InvocationStartedEvent startedEvent = new 
InvocationStartedEvent(operationMeta.getMicroserviceQualifiedName(),
-InvocationType.PRODUCER, System.nanoTime());
+ProducerInvocationStartedEvent startedEvent = new 
ProducerInvocationStartedEvent(
 
 Review comment:
   Why do you introduce the ProducerInvocationStartedEvent? 


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


> Update metrics publish data module
> --
>
> Key: SCB-327
> URL: https://issues.apache.org/jira/browse/SCB-327
> Project: Apache ServiceComb
>  Issue Type: Sub-task
>  Components: Java-Chassis
>Affects Versions: java-chassis-1.0.0-m1
>Reporter: yangyongzheng
>Assignee: yangyongzheng
>Priority: Major
> Fix For: java-chassis-1.0.0-m1
>
>
> Change data publish from RegistryMetric model to map
>  adjust metrics publish format to spring cloud netflix style



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


[jira] [Commented] (SCB-327) Update metrics publish data module

2018-02-22 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on SCB-327:


WillemJiang commented on a change in pull request #555: [SCB-327] Update 
metrics publish data module (Re-organized)
URL: 
https://github.com/apache/incubator-servicecomb-java-chassis/pull/555#discussion_r169887598
 
 

 ##
 File path: 
foundations/foundation-metrics/src/main/java/org/apache/servicecomb/foundation/metrics/publish/MetricsLoader.java
 ##
 @@ -40,7 +42,7 @@ public MetricNode getMetricTree(String id, String... 
groupTagKeys) {
 if (metrics.containsKey(id)) {
   return new MetricNode(metrics.get(id), groupTagKeys);
 }
-return null;
+throw new ServiceCombException("no such id");
 
 Review comment:
   Please keep the id in the exception for the developer to find out the failed 
reason.


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


> Update metrics publish data module
> --
>
> Key: SCB-327
> URL: https://issues.apache.org/jira/browse/SCB-327
> Project: Apache ServiceComb
>  Issue Type: Sub-task
>  Components: Java-Chassis
>Affects Versions: java-chassis-1.0.0-m1
>Reporter: yangyongzheng
>Assignee: yangyongzheng
>Priority: Major
> Fix For: java-chassis-1.0.0-m1
>
>
> Change data publish from RegistryMetric model to map
>  adjust metrics publish format to spring cloud netflix style



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


[jira] [Commented] (SCB-327) Update metrics publish data module

2018-02-22 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on SCB-327:


WillemJiang commented on a change in pull request #555: [SCB-327] Update 
metrics publish data module (Re-organized)
URL: 
https://github.com/apache/incubator-servicecomb-java-chassis/pull/555#discussion_r169888260
 
 

 ##
 File path: 
metrics/metrics-core/src/main/java/org/apache/servicecomb/metrics/core/event/servo/AbstractInvocationEventListener.java
 ##
 @@ -0,0 +1,35 @@
+/*
+ * 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.servo;
 
 Review comment:
   Listener is application level code, it should not bind to the servo 
implementation. 


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


> Update metrics publish data module
> --
>
> Key: SCB-327
> URL: https://issues.apache.org/jira/browse/SCB-327
> Project: Apache ServiceComb
>  Issue Type: Sub-task
>  Components: Java-Chassis
>Affects Versions: java-chassis-1.0.0-m1
>Reporter: yangyongzheng
>Assignee: yangyongzheng
>Priority: Major
> Fix For: java-chassis-1.0.0-m1
>
>
> Change data publish from RegistryMetric model to map
>  adjust metrics publish format to spring cloud netflix style



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


[jira] [Commented] (SCB-327) Update metrics publish data module

2018-02-22 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on SCB-327:


WillemJiang commented on a change in pull request #555: [SCB-327] Update 
metrics publish data module (Re-organized)
URL: 
https://github.com/apache/incubator-servicecomb-java-chassis/pull/555#discussion_r169885809
 
 

 ##
 File path: 
demo/perf/src/main/java/org/apache/servicecomb/demo/perf/PerfMetricsFilePublisher.java
 ##
 @@ -75,54 +76,56 @@ private void collectVertxMetrics(MetricsLoader loader, 
StringBuilder sb) {
   }
 
   private void collectMetrics(MetricsLoader loader, StringBuilder sb) {
-MetricNode treeNode = loader
-.getMetricTree(MetricsConst.SERVICECOMB_INVOCATION, 
MetricsConst.TAG_ROLE, MetricsConst.TAG_OPERATION,
-MetricsConst.TAG_STATUS);
-
-if (treeNode != null && treeNode.getChildren().size() != 0) {
-  MetricNode consumerNode = 
treeNode.getChildren().get(MetricsConst.ROLE_CONSUMER);
-  if (consumerNode != null) {
-sb.append("consumer:\n");
-sb.append("  tps latency(ms) status  operation\n");
-for (Entry operationNode : 
consumerNode.getChildren().entrySet()) {
-  for (Entry statusNode : 
operationNode.getValue().getChildren().entrySet()) {
-sb.append(String.format("  %-7.0f %-11.3f %-9s %s\n",
-statusNode.getValue()
-
.getFirstMatchMetricValue(Lists.newArrayList(MetricsConst.TAG_STAGE, 
MetricsConst.TAG_STATISTIC),
-Lists.newArrayList(MetricsConst.STAGE_WHOLE, "tps")),
-statusNode.getValue()
-
.getFirstMatchMetricValue(Lists.newArrayList(MetricsConst.TAG_STAGE, 
MetricsConst.TAG_STATISTIC),
-Lists.newArrayList(MetricsConst.STAGE_WHOLE, 
"latency")),
-statusNode.getKey(),
-operationNode.getKey()));
+try {
+  MetricNode treeNode = loader
+  .getMetricTree(MetricsConst.SERVICECOMB_INVOCATION, 
MetricsConst.TAG_ROLE, MetricsConst.TAG_OPERATION,
+  MetricsConst.TAG_STATUS);
+
+  if (treeNode != null && treeNode.getChildren().size() != 0) {
+MetricNode consumerNode = 
treeNode.getChildren().get(String.valueOf(InvocationType.CONSUMER));
+if (consumerNode != null) {
+  sb.append("consumer:\n");
+  sb.append("  tps latency(ms) status  operation\n");
+  for (Entry operationNode : 
consumerNode.getChildren().entrySet()) {
+for (Entry statusNode : 
operationNode.getValue().getChildren().entrySet()) {
+  sb.append(String.format("  %-7.0f %-11.3f %-9s %s\n",
+  statusNode.getValue()
+  .getFirstMatchMetricValue(MetricsConst.TAG_STAGE, 
MetricsConst.STAGE_TOTAL,
+  MetricsConst.TAG_STATISTIC, "tps"),
+  statusNode.getValue()
+  .getFirstMatchMetricValue(TimeUnit.MILLISECONDS, 
MetricsConst.TAG_STAGE, MetricsConst.STAGE_TOTAL,
+  MetricsConst.TAG_STATISTIC, "latency"),
+  statusNode.getKey(), operationNode.getKey()));
+}
   }
 }
-  }
 
-  MetricNode producerNode = 
treeNode.getChildren().get(MetricsConst.ROLE_PRODUCER);
-  if (producerNode != null) {
-sb.append("producer:\n");
-sb.append("  tps latency(ms) queue(ms) execute(ms) status  
operation\n");
-for (Entry operationNode : 
producerNode.getChildren().entrySet()) {
-  for (Entry statusNode : 
operationNode.getValue().getChildren().entrySet()) {
-sb.append(String.format("  %-7.0f %-11.3f %-9.3f %-11.3f %-7s 
%s\n",
-statusNode.getValue()
-
.getFirstMatchMetricValue(Lists.newArrayList(MetricsConst.TAG_STAGE, 
MetricsConst.TAG_STATISTIC),
-Lists.newArrayList(MetricsConst.STAGE_WHOLE, "tps")),
-statusNode.getValue()
-
.getFirstMatchMetricValue(Lists.newArrayList(MetricsConst.TAG_STAGE, 
MetricsConst.TAG_STATISTIC),
-Lists.newArrayList(MetricsConst.STAGE_WHOLE, 
"latency")),
-statusNode.getValue()
-
.getFirstMatchMetricValue(Lists.newArrayList(MetricsConst.TAG_STAGE, 
MetricsConst.TAG_STATISTIC),
-Lists.newArrayList(MetricsConst.STAGE_QUEUE, 
"latency")),
-statusNode.getValue()
-
.getFirstMatchMetricValue(Lists.newArrayList(MetricsConst.TAG_STAGE, 
MetricsConst.TAG_STATISTIC),
-Lists.newArrayList(MetricsConst.STAGE_EXECUTION, 
"latency")),
-statusNode.getKey(),
-

[jira] [Commented] (SCB-327) Update metrics publish data module

2018-02-21 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on SCB-327:


coveralls commented on issue #555: [SCB-327] Update metrics publish data module 
(Re-organized)
URL: 
https://github.com/apache/incubator-servicecomb-java-chassis/pull/555#issuecomment-364824526
 
 
   
   [![Coverage 
Status](https://coveralls.io/builds/15640632/badge)](https://coveralls.io/builds/15640632)
   
   Coverage decreased (-0.07%) to 87.167% when pulling 
**ec11b9e1052f794d576559723ecf9b1c17c118db on zhengyangyong:SCB-327-2** into 
**9720cfc5c9f7ea2e7902a821ef031203ddfd8808 on apache:master**.
   


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


> Update metrics publish data module
> --
>
> Key: SCB-327
> URL: https://issues.apache.org/jira/browse/SCB-327
> Project: Apache ServiceComb
>  Issue Type: Sub-task
>  Components: Java-Chassis
>Affects Versions: java-chassis-1.0.0-m1
>Reporter: yangyongzheng
>Assignee: yangyongzheng
>Priority: Major
> Fix For: java-chassis-1.0.0-m1
>
>
> Change data publish from RegistryMetric model to map
>  adjust metrics publish format to spring cloud netflix style



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


[jira] [Commented] (SCB-327) Update metrics publish data module

2018-02-21 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on SCB-327:


coveralls commented on issue #555: [SCB-327] Update metrics publish data module 
(Re-organized)
URL: 
https://github.com/apache/incubator-servicecomb-java-chassis/pull/555#issuecomment-364824526
 
 
   
   [![Coverage 
Status](https://coveralls.io/builds/15622274/badge)](https://coveralls.io/builds/15622274)
   
   Coverage decreased (-0.08%) to 87.159% when pulling 
**e94345425be2ed65b33bdd7da2c7c54e02c2014d on zhengyangyong:SCB-327-2** into 
**9720cfc5c9f7ea2e7902a821ef031203ddfd8808 on apache:master**.
   


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


> Update metrics publish data module
> --
>
> Key: SCB-327
> URL: https://issues.apache.org/jira/browse/SCB-327
> Project: Apache ServiceComb
>  Issue Type: Sub-task
>  Components: Java-Chassis
>Affects Versions: java-chassis-1.0.0-m1
>Reporter: yangyongzheng
>Assignee: yangyongzheng
>Priority: Major
> Fix For: java-chassis-1.0.0-m1
>
>
> Change data publish from RegistryMetric model to map
>  adjust metrics publish format to spring cloud netflix style



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


[jira] [Commented] (SCB-327) Update metrics publish data module

2018-02-20 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on SCB-327:


coveralls commented on issue #555: [SCB-327] Update metrics publish data module 
(Re-organized)
URL: 
https://github.com/apache/incubator-servicecomb-java-chassis/pull/555#issuecomment-364824526
 
 
   
   [![Coverage 
Status](https://coveralls.io/builds/15621814/badge)](https://coveralls.io/builds/15621814)
   
   Coverage decreased (-0.1%) to 87.136% when pulling 
**a0e95bc043306a4454b56f33897a5f27ee2c01d1 on zhengyangyong:SCB-327-2** into 
**9720cfc5c9f7ea2e7902a821ef031203ddfd8808 on apache:master**.
   


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


> Update metrics publish data module
> --
>
> Key: SCB-327
> URL: https://issues.apache.org/jira/browse/SCB-327
> Project: Apache ServiceComb
>  Issue Type: Sub-task
>  Components: Java-Chassis
>Affects Versions: java-chassis-1.0.0-m1
>Reporter: yangyongzheng
>Assignee: yangyongzheng
>Priority: Major
> Fix For: java-chassis-1.0.0-m1
>
>
> Change data publish from RegistryMetric model to map
>  adjust metrics publish format to spring cloud netflix style



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


[jira] [Commented] (SCB-327) Update metrics publish data module

2018-02-20 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on SCB-327:


zhengyangyong commented on a change in pull request #555: [SCB-327] Update 
metrics publish data module (Re-organized)
URL: 
https://github.com/apache/incubator-servicecomb-java-chassis/pull/555#discussion_r169550053
 
 

 ##
 File path: 
metrics/metrics-core/src/main/java/org/apache/servicecomb/metrics/core/monitor/RegistryMonitor.java
 ##
 @@ -51,16 +48,14 @@ public ProducerInvocationMonitor 
getProducerInvocationMonitor(String operationNa
 return producerInvocationMonitors.computeIfAbsent(operationName, i -> new 
ProducerInvocationMonitor(operationName));
   }
 
-  public RegistryMetric toRegistryMetric(int windowTimeIndex) {
-Map consumerInvocationMetrics = new 
HashMap<>();
+  public Map measure(int windowTimeIndex, boolean 
calculateLatency) {
+Map measurements = new HashMap<>(systemMonitor.measure());
 
 Review comment:
   Done


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


> Update metrics publish data module
> --
>
> Key: SCB-327
> URL: https://issues.apache.org/jira/browse/SCB-327
> Project: Apache ServiceComb
>  Issue Type: Sub-task
>  Components: Java-Chassis
>Affects Versions: java-chassis-1.0.0-m1
>Reporter: yangyongzheng
>Assignee: yangyongzheng
>Priority: Major
> Fix For: java-chassis-1.0.0-m1
>
>
> Change data publish from RegistryMetric model to map
>  adjust metrics publish format to spring cloud netflix style



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


[jira] [Commented] (SCB-327) Update metrics publish data module

2018-02-20 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on SCB-327:


zhengyangyong commented on a change in pull request #555: [SCB-327] Update 
metrics publish data module (Re-organized)
URL: 
https://github.com/apache/incubator-servicecomb-java-chassis/pull/555#discussion_r169550013
 
 

 ##
 File path: 
metrics/metrics-core/src/main/java/org/apache/servicecomb/metrics/core/monitor/ConsumerInvocationMonitor.java
 ##
 @@ -17,11 +17,12 @@
 
 package org.apache.servicecomb.metrics.core.monitor;
 
+import java.util.HashMap;
+import java.util.Map;
 
-import org.apache.servicecomb.metrics.common.ConsumerInvocationMetric;
-import org.apache.servicecomb.metrics.common.MetricsConst;
+import org.apache.servicecomb.foundation.metrics.MetricsConst;
 
-public class ConsumerInvocationMonitor extends InvocationMonitor {
+public class ConsumerInvocationMonitor {
 
 Review comment:
   I had use DefaultMonitorRegistry as monitor container replace it;
   In order to update monitor,I had add a group of basic wrapped monitor 
extends from AbstractMonitor;
   Measure metrics will direct from 
DefaultMonitorRegistry.getInstance().getRegisteredMonitors() then getValue()


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


> Update metrics publish data module
> --
>
> Key: SCB-327
> URL: https://issues.apache.org/jira/browse/SCB-327
> Project: Apache ServiceComb
>  Issue Type: Sub-task
>  Components: Java-Chassis
>Affects Versions: java-chassis-1.0.0-m1
>Reporter: yangyongzheng
>Assignee: yangyongzheng
>Priority: Major
> Fix For: java-chassis-1.0.0-m1
>
>
> Change data publish from RegistryMetric model to map
>  adjust metrics publish format to spring cloud netflix style



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


[jira] [Commented] (SCB-327) Update metrics publish data module

2018-02-20 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on SCB-327:


zhengyangyong commented on a change in pull request #555: [SCB-327] Update 
metrics publish data module (Re-organized)
URL: 
https://github.com/apache/incubator-servicecomb-java-chassis/pull/555#discussion_r169549214
 
 

 ##
 File path: 
metrics/metrics-core/src/main/java/org/apache/servicecomb/metrics/core/event/InvocationStartProcessingEventListener.java
 ##
 @@ -43,7 +43,6 @@ public void process(Event data) {
 if (InvocationType.PRODUCER.equals(event.getInvocationType())) {
   ProducerInvocationMonitor monitor = 
registryMonitor.getProducerInvocationMonitor(event.getOperationName());
   monitor.getWaitInQueue().increment(-1);
-  monitor.getLifeTimeInQueue().update(event.getInQueueNanoTime());
 
 Review comment:
   queue stage latency had move from this event to finish event


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


> Update metrics publish data module
> --
>
> Key: SCB-327
> URL: https://issues.apache.org/jira/browse/SCB-327
> Project: Apache ServiceComb
>  Issue Type: Sub-task
>  Components: Java-Chassis
>Affects Versions: java-chassis-1.0.0-m1
>Reporter: yangyongzheng
>Assignee: yangyongzheng
>Priority: Major
> Fix For: java-chassis-1.0.0-m1
>
>
> Change data publish from RegistryMetric model to map
>  adjust metrics publish format to spring cloud netflix style



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


[jira] [Commented] (SCB-327) Update metrics publish data module

2018-02-20 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on SCB-327:


zhengyangyong commented on a change in pull request #555: [SCB-327] Update 
metrics publish data module (Re-organized)
URL: 
https://github.com/apache/incubator-servicecomb-java-chassis/pull/555#discussion_r169549115
 
 

 ##
 File path: 
foundations/foundation-metrics/src/main/java/org/apache/servicecomb/foundation/metrics/publish/MetricNode.java
 ##
 @@ -0,0 +1,108 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.servicecomb.foundation.metrics.publish;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Map.Entry;
+
+import org.apache.servicecomb.foundation.metrics.MetricsConst;
+
+public class MetricNode {
 
 Review comment:
   Added


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


> Update metrics publish data module
> --
>
> Key: SCB-327
> URL: https://issues.apache.org/jira/browse/SCB-327
> Project: Apache ServiceComb
>  Issue Type: Sub-task
>  Components: Java-Chassis
>Affects Versions: java-chassis-1.0.0-m1
>Reporter: yangyongzheng
>Assignee: yangyongzheng
>Priority: Major
> Fix For: java-chassis-1.0.0-m1
>
>
> Change data publish from RegistryMetric model to map
>  adjust metrics publish format to spring cloud netflix style



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


[jira] [Commented] (SCB-327) Update metrics publish data module

2018-02-20 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on SCB-327:


zhengyangyong commented on a change in pull request #555: [SCB-327] Update 
metrics publish data module (Re-organized)
URL: 
https://github.com/apache/incubator-servicecomb-java-chassis/pull/555#discussion_r169549090
 
 

 ##
 File path: 
foundations/foundation-metrics/src/main/java/org/apache/servicecomb/foundation/metrics/publish/DefaultHealthCheckExtraData.java
 ##
 @@ -15,7 +15,7 @@
  * limitations under the License.
  */
 
-package org.apache.servicecomb.metrics.common;
+package org.apache.servicecomb.foundation.metrics.publish;
 
 public class DefaultHealthCheckExtraData {
 
 Review comment:
   Had removed


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


> Update metrics publish data module
> --
>
> Key: SCB-327
> URL: https://issues.apache.org/jira/browse/SCB-327
> Project: Apache ServiceComb
>  Issue Type: Sub-task
>  Components: Java-Chassis
>Affects Versions: java-chassis-1.0.0-m1
>Reporter: yangyongzheng
>Assignee: yangyongzheng
>Priority: Major
> Fix For: java-chassis-1.0.0-m1
>
>
> Change data publish from RegistryMetric model to map
>  adjust metrics publish format to spring cloud netflix style



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


[jira] [Commented] (SCB-327) Update metrics publish data module

2018-02-20 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on SCB-327:


zhengyangyong commented on a change in pull request #555: [SCB-327] Update 
metrics publish data module (Re-organized)
URL: 
https://github.com/apache/incubator-servicecomb-java-chassis/pull/555#discussion_r169549069
 
 

 ##
 File path: 
foundations/foundation-metrics/src/main/java/org/apache/servicecomb/foundation/metrics/publish/DefaultHealthCheckExtraData.java
 ##
 @@ -15,7 +15,7 @@
  * limitations under the License.
  */
 
-package org.apache.servicecomb.metrics.common;
+package org.apache.servicecomb.foundation.metrics.publish;
 
 public class DefaultHealthCheckExtraData {
 
 Review comment:
   We may no need provider this default health check because :
   1.make some  confusion
   2.Service Center had same function


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


> Update metrics publish data module
> --
>
> Key: SCB-327
> URL: https://issues.apache.org/jira/browse/SCB-327
> Project: Apache ServiceComb
>  Issue Type: Sub-task
>  Components: Java-Chassis
>Affects Versions: java-chassis-1.0.0-m1
>Reporter: yangyongzheng
>Assignee: yangyongzheng
>Priority: Major
> Fix For: java-chassis-1.0.0-m1
>
>
> Change data publish from RegistryMetric model to map
>  adjust metrics publish format to spring cloud netflix style



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


[jira] [Commented] (SCB-327) Update metrics publish data module

2018-02-20 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on SCB-327:


zhengyangyong commented on a change in pull request #555: [SCB-327] Update 
metrics publish data module (Re-organized)
URL: 
https://github.com/apache/incubator-servicecomb-java-chassis/pull/555#discussion_r169549129
 
 

 ##
 File path: 
foundations/foundation-metrics/src/main/java/org/apache/servicecomb/foundation/metrics/publish/MetricsLoader.java
 ##
 @@ -0,0 +1,56 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.servicecomb.foundation.metrics.publish;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Map.Entry;
+
+//load origin metrics value and publish tree
+public class MetricsLoader {
+
+  private final Map metrics;
+
+  public MetricsLoader(Map metrics) {
+this.metrics = new HashMap<>();
+for (Entry entry : metrics.entrySet()) {
+  Metric metric = new Metric(entry.getKey(), entry.getValue());
+  this.metrics.computeIfAbsent(metric.getName(), m -> new 
ArrayList<>()).add(metric);
+}
+  }
+
+  public MetricNode getMetricTree(String id, String... groupTagKeys) {
+if (metrics.containsKey(id)) {
+  return new MetricNode(metrics.get(id), groupTagKeys);
+}
+return null;
 
 Review comment:
   Done


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


> Update metrics publish data module
> --
>
> Key: SCB-327
> URL: https://issues.apache.org/jira/browse/SCB-327
> Project: Apache ServiceComb
>  Issue Type: Sub-task
>  Components: Java-Chassis
>Affects Versions: java-chassis-1.0.0-m1
>Reporter: yangyongzheng
>Assignee: yangyongzheng
>Priority: Major
> Fix For: java-chassis-1.0.0-m1
>
>
> Change data publish from RegistryMetric model to map
>  adjust metrics publish format to spring cloud netflix style



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


[jira] [Commented] (SCB-327) Update metrics publish data module

2018-02-20 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on SCB-327:


zhengyangyong commented on a change in pull request #555: [SCB-327] Update 
metrics publish data module (Re-organized)
URL: 
https://github.com/apache/incubator-servicecomb-java-chassis/pull/555#discussion_r169548717
 
 

 ##
 File path: core/src/main/java/org/apache/servicecomb/core/Invocation.java
 ##
 @@ -188,15 +188,16 @@ public String getMicroserviceQualifiedName() {
   public void triggerStartProcessingEvent() {
 this.startProcessingTime = System.nanoTime();
 EventUtils.triggerEvent(new InvocationStartProcessingEvent(
-operationMeta.getMicroserviceQualifiedName(), this.invocationType, 
startProcessingTime - startTime));
+operationMeta.getMicroserviceQualifiedName(), this.invocationType));
   }
 
-  public void triggerFinishedEvent(int statusCode, boolean success) {
+  public void triggerFinishedEvent(int statusCode) {
 long finishedTime = System.nanoTime();
 EventUtils
-.triggerEvent(new 
InvocationFinishedEvent(operationMeta.getMicroserviceQualifiedName(),
-this.invocationType, finishedTime - startProcessingTime,
-finishedTime - startTime, statusCode, success));
+.triggerEvent(new 
InvocationFinishedEvent(operationMeta.getMicroserviceQualifiedName(), 
this.invocationType,
+startProcessingTime - startTime,
 
 Review comment:
   On producer side , startTime is when invocation received,startProcessingTime 
is when invocation fetch from queue and start execute;


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


> Update metrics publish data module
> --
>
> Key: SCB-327
> URL: https://issues.apache.org/jira/browse/SCB-327
> Project: Apache ServiceComb
>  Issue Type: Sub-task
>  Components: Java-Chassis
>Affects Versions: java-chassis-1.0.0-m1
>Reporter: yangyongzheng
>Assignee: yangyongzheng
>Priority: Major
> Fix For: java-chassis-1.0.0-m1
>
>
> Change data publish from RegistryMetric model to map
>  adjust metrics publish format to spring cloud netflix style



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


[jira] [Commented] (SCB-327) Update metrics publish data module

2018-02-13 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on SCB-327:


WillemJiang commented on a change in pull request #555: [SCB-327] Update 
metrics publish data module (Re-organized)
URL: 
https://github.com/apache/incubator-servicecomb-java-chassis/pull/555#discussion_r168063945
 
 

 ##
 File path: 
metrics/metrics-core/src/main/java/org/apache/servicecomb/metrics/core/monitor/RegistryMonitor.java
 ##
 @@ -51,16 +48,14 @@ public ProducerInvocationMonitor 
getProducerInvocationMonitor(String operationNa
 return producerInvocationMonitors.computeIfAbsent(operationName, i -> new 
ProducerInvocationMonitor(operationName));
   }
 
-  public RegistryMetric toRegistryMetric(int windowTimeIndex) {
-Map consumerInvocationMetrics = new 
HashMap<>();
+  public Map measure(int windowTimeIndex, boolean 
calculateLatency) {
+Map measurements = new HashMap<>(systemMonitor.measure());
 
 Review comment:
   If we want measure the invocation monitor, we don't need to know if it 
consumerInvocationMonitor or producerInvocationMonitor.


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


> Update metrics publish data module
> --
>
> Key: SCB-327
> URL: https://issues.apache.org/jira/browse/SCB-327
> Project: Apache ServiceComb
>  Issue Type: Sub-task
>  Components: Java-Chassis
>Affects Versions: java-chassis-1.0.0-m1
>Reporter: yangyongzheng
>Assignee: yangyongzheng
>Priority: Major
> Fix For: java-chassis-1.0.0-m1
>
>
> Change data publish from RegistryMetric model to map
>  adjust metrics publish format to spring cloud netflix style



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


[jira] [Commented] (SCB-327) Update metrics publish data module

2018-02-13 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on SCB-327:


WillemJiang commented on a change in pull request #555: [SCB-327] Update 
metrics publish data module (Re-organized)
URL: 
https://github.com/apache/incubator-servicecomb-java-chassis/pull/555#discussion_r168062197
 
 

 ##
 File path: 
metrics/metrics-core/src/main/java/org/apache/servicecomb/metrics/core/event/InvocationStartProcessingEventListener.java
 ##
 @@ -43,7 +43,6 @@ public void process(Event data) {
 if (InvocationType.PRODUCER.equals(event.getInvocationType())) {
   ProducerInvocationMonitor monitor = 
registryMonitor.getProducerInvocationMonitor(event.getOperationName());
   monitor.getWaitInQueue().increment(-1);
-  monitor.getLifeTimeInQueue().update(event.getInQueueNanoTime());
 
 Review comment:
   Why did you remove this line?


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


> Update metrics publish data module
> --
>
> Key: SCB-327
> URL: https://issues.apache.org/jira/browse/SCB-327
> Project: Apache ServiceComb
>  Issue Type: Sub-task
>  Components: Java-Chassis
>Affects Versions: java-chassis-1.0.0-m1
>Reporter: yangyongzheng
>Assignee: yangyongzheng
>Priority: Major
> Fix For: java-chassis-1.0.0-m1
>
>
> Change data publish from RegistryMetric model to map
>  adjust metrics publish format to spring cloud netflix style



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


[jira] [Commented] (SCB-327) Update metrics publish data module

2018-02-13 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on SCB-327:


WillemJiang commented on a change in pull request #555: [SCB-327] Update 
metrics publish data module (Re-organized)
URL: 
https://github.com/apache/incubator-servicecomb-java-chassis/pull/555#discussion_r168060887
 
 

 ##
 File path: 
foundations/foundation-metrics/src/main/java/org/apache/servicecomb/foundation/metrics/publish/MetricsLoader.java
 ##
 @@ -0,0 +1,56 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.servicecomb.foundation.metrics.publish;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Map.Entry;
+
+//load origin metrics value and publish tree
+public class MetricsLoader {
+
+  private final Map metrics;
+
+  public MetricsLoader(Map metrics) {
+this.metrics = new HashMap<>();
+for (Entry entry : metrics.entrySet()) {
+  Metric metric = new Metric(entry.getKey(), entry.getValue());
+  this.metrics.computeIfAbsent(metric.getName(), m -> new 
ArrayList<>()).add(metric);
+}
+  }
+
+  public MetricNode getMetricTree(String id, String... groupTagKeys) {
+if (metrics.containsKey(id)) {
+  return new MetricNode(metrics.get(id), groupTagKeys);
+}
+return null;
 
 Review comment:
   I'm not a big fan of null, you can throw exception or using Option return 
the value.


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


> Update metrics publish data module
> --
>
> Key: SCB-327
> URL: https://issues.apache.org/jira/browse/SCB-327
> Project: Apache ServiceComb
>  Issue Type: Sub-task
>  Components: Java-Chassis
>Affects Versions: java-chassis-1.0.0-m1
>Reporter: yangyongzheng
>Assignee: yangyongzheng
>Priority: Major
> Fix For: java-chassis-1.0.0-m1
>
>
> Change data publish from RegistryMetric model to map
>  adjust metrics publish format to spring cloud netflix style



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


[jira] [Commented] (SCB-327) Update metrics publish data module

2018-02-13 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on SCB-327:


WillemJiang commented on a change in pull request #555: [SCB-327] Update 
metrics publish data module (Re-organized)
URL: 
https://github.com/apache/incubator-servicecomb-java-chassis/pull/555#discussion_r168060645
 
 

 ##
 File path: 
foundations/foundation-metrics/src/main/java/org/apache/servicecomb/foundation/metrics/publish/MetricNode.java
 ##
 @@ -0,0 +1,108 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.servicecomb.foundation.metrics.publish;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Map.Entry;
+
+import org.apache.servicecomb.foundation.metrics.MetricsConst;
+
+public class MetricNode {
 
 Review comment:
   Can you show me the unit test of MetricNode? 


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


> Update metrics publish data module
> --
>
> Key: SCB-327
> URL: https://issues.apache.org/jira/browse/SCB-327
> Project: Apache ServiceComb
>  Issue Type: Sub-task
>  Components: Java-Chassis
>Affects Versions: java-chassis-1.0.0-m1
>Reporter: yangyongzheng
>Assignee: yangyongzheng
>Priority: Major
> Fix For: java-chassis-1.0.0-m1
>
>
> Change data publish from RegistryMetric model to map
>  adjust metrics publish format to spring cloud netflix style



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


[jira] [Commented] (SCB-327) Update metrics publish data module

2018-02-13 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on SCB-327:


WillemJiang commented on a change in pull request #555: [SCB-327] Update 
metrics publish data module (Re-organized)
URL: 
https://github.com/apache/incubator-servicecomb-java-chassis/pull/555#discussion_r168059325
 
 

 ##
 File path: 
foundations/foundation-metrics/src/main/java/org/apache/servicecomb/foundation/metrics/publish/DefaultHealthCheckExtraData.java
 ##
 @@ -15,7 +15,7 @@
  * limitations under the License.
  */
 
-package org.apache.servicecomb.metrics.common;
+package org.apache.servicecomb.foundation.metrics.publish;
 
 public class DefaultHealthCheckExtraData {
 
 Review comment:
   What's the relationship between the DefaultHealthCheckExtraData and 
HealthCheckResult.extraData?
   We don't need to use the String to store result,  it's easy to use toString 
method to turn the instance of HealthCheckExtraData into a string.


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


> Update metrics publish data module
> --
>
> Key: SCB-327
> URL: https://issues.apache.org/jira/browse/SCB-327
> Project: Apache ServiceComb
>  Issue Type: Sub-task
>  Components: Java-Chassis
>Affects Versions: java-chassis-1.0.0-m1
>Reporter: yangyongzheng
>Assignee: yangyongzheng
>Priority: Major
> Fix For: java-chassis-1.0.0-m1
>
>
> Change data publish from RegistryMetric model to map
>  adjust metrics publish format to spring cloud netflix style



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


[jira] [Commented] (SCB-327) Update metrics publish data module

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

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

ASF GitHub Bot commented on SCB-327:


coveralls commented on issue #555: [SCB-327] Update metrics publish data module 
(Re-organized)
URL: 
https://github.com/apache/incubator-servicecomb-java-chassis/pull/555#issuecomment-364824526
 
 
   
   [![Coverage 
Status](https://coveralls.io/builds/15479256/badge)](https://coveralls.io/builds/15479256)
   
   Coverage increased (+0.09%) to 87.326% when pulling 
**feddcce8aa6b1817144c76a3863f8162d945c7d2 on zhengyangyong:SCB-327-2** into 
**9720cfc5c9f7ea2e7902a821ef031203ddfd8808 on apache:master**.
   


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


> Update metrics publish data module
> --
>
> Key: SCB-327
> URL: https://issues.apache.org/jira/browse/SCB-327
> Project: Apache ServiceComb
>  Issue Type: Sub-task
>  Components: Java-Chassis
>Affects Versions: java-chassis-1.0.0-m1
>Reporter: yangyongzheng
>Assignee: yangyongzheng
>Priority: Major
> Fix For: java-chassis-1.0.0-m1
>
>
> Change data publish from RegistryMetric model to map
>  adjust metrics publish format to spring cloud netflix style



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


[jira] [Commented] (SCB-327) Update metrics publish data module

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

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

ASF GitHub Bot commented on SCB-327:


zhengyangyong opened a new pull request #555: [SCB-327] Update metrics publish 
data module
URL: https://github.com/apache/incubator-servicecomb-java-chassis/pull/555
 
 
   Follow this checklist to help us incorporate your contribution quickly and 
easily:
   
- [ ] Make sure there is a [JIRA 
issue](https://issues.apache.org/jira/browse/SCB) filed for the change (usually 
before you start working on it).  Trivial changes like typos do not require a 
JIRA issue.  Your pull request should address just this issue, without pulling 
in other changes.
- [ ] Each commit in the pull request should have a meaningful subject line 
and body.
- [ ] Format the pull request title like `[SCB-XXX] Fixes bug in 
ApproximateQuantiles`, where you replace `SCB-XXX` with the appropriate JIRA 
issue.
- [ ] Write a pull request description that is detailed enough to 
understand what the pull request does, how, and why.
- [ ] Run `mvn clean install` to make sure basic checks pass. A more 
thorough check will be performed on your pull request automatically.
- [ ] If this contribution is large, please file an Apache [Individual 
Contributor License Agreement](https://www.apache.org/licenses/icla.pdf).
   
   ---
   Re-organize comment of PR : 
https://github.com/apache/incubator-servicecomb-java-chassis/pull/550
   adjust metrics publish format to spring cloud netflix style
   Before:
   servicecomb.instance.system.cpu.load
   servicecomb.instance.system.cpu.runningThreads
   servicecomb.instance.system.heap.init
   servicecomb.instance.system.heap.max
   servicecomb.instance.system.heap.commit
   servicecomb.instance.system.heap.used
   servicecomb.instance.system.nonHeap.init
   servicecomb.instance.system.nonHeap.max
   servicecomb.instance.system.nonHeap.commit
   servicecomb.instance.system.nonHeap.used
   servicecomb.instance  operationName.producer.waitInQueue.count
   servicecomb.instance  operationName.producer.lifeTimeInQueue.average
   servicecomb.instance  operationName.producer.lifeTimeInQueue.max
   servicecomb.instance  operationName.producer.lifeTimeInQueue.min
   servicecomb.instance  operationName.producer.executionTime.average
   servicecomb.instance  operationName.producer.executionTime.max
   servicecomb.instance  operationName.producer.executionTime.min
   servicecomb.instance  operationName.producer.producerLatency.average
   servicecomb.instance  operationName.producer.producerLatency.max
   servicecomb.instance  operationName.producer.producerLatency.min
   servicecomb.instance  operationName.producer.producerCall.total
   servicecomb.instance  operationName.producer.producerCall.tps
   servicecomb.instance  operationName.consumer.consumerLatency.average
   servicecomb.instance  operationName.consumer.consumerLatency.max
   servicecomb.instance  operationName.consumer.consumerLatency.min
   servicecomb.instance  operationName.consumer.consumerCall.total
   servicecomb.instance  operationName.consumer.consumerCall.tps
   
   Current:
   jvm(statistic=gauge,name={name})
   {name} include :
   **cpuLoad,cpuRunningThreads,heapInit,heapMax,heapCommit,
   heapUsed,nonHeapInit,nonHeapMax,nonHeapCommit,nonHeapUsed**
   
   
   
servicecomb.invocation(operation={operationName},role={role},stage={stage},statistic={statistic},status={status})
   
   | TagName   | TagValue  | 
   | :-- | :- |
   | operation | Operation Name |
   | role | consume,producer |
   | stage | queue,execution,whole |
   | statistic | tps,totalCount,count,totalTime,max,waitInQueue (can compute 
latency = totalTime/count) |
   | status | statusCode like 200, 404 ... etc|
   
   A output sample:
   ![tim 
20180206161636](https://user-images.githubusercontent.com/374335/35859674-fa02673a-0b7b-11e8-9219-4bf0ab3a1c8a.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


> Update metrics publish data module
> --
>
> Key: SCB-327
> URL: https://issues.apache.org/jira/browse/SCB-327
> Project: Apache ServiceComb
>  Issue Type: Sub-task
>  Components: Java-Chassis
>Affects Versions: java-chassis-1.0.0-m1
>Reporter: yangyongzheng
>Assignee: yangyongzheng
>Priority: Major
> Fix For: java-chassis-1.0.0-m1
>
>
> Change data publish from RegistryMetric model to map
>  adjust metrics publish format to spring cloud netflix style



--
This message was sent 

[jira] [Commented] (SCB-327) Update metrics publish data module

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

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

ASF GitHub Bot commented on SCB-327:


coveralls commented on issue #550: [SCB-327] Update metrics publish data module
URL: 
https://github.com/apache/incubator-servicecomb-java-chassis/pull/550#issuecomment-363366448
 
 
   
   [![Coverage 
Status](https://coveralls.io/builds/15478922/badge)](https://coveralls.io/builds/15478922)
   
   Coverage increased (+0.09%) to 87.326% when pulling 
**cc2ba5346a5154ac066a44aa56ef19d1f655bec9 on zhengyangyong:SCB-327** into 
**cfc66b9775bf1e17e5fa1387a23a1510c2b45383 on apache:master**.
   


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


> Update metrics publish data module
> --
>
> Key: SCB-327
> URL: https://issues.apache.org/jira/browse/SCB-327
> Project: Apache ServiceComb
>  Issue Type: Sub-task
>  Components: Java-Chassis
>Affects Versions: java-chassis-1.0.0-m1
>Reporter: yangyongzheng
>Assignee: yangyongzheng
>Priority: Major
> Fix For: java-chassis-1.0.0-m1
>
>
> Change data publish from RegistryMetric model to map
>  adjust metrics publish format to spring cloud netflix style



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


[jira] [Commented] (SCB-327) Update metrics publish data module

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

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

ASF GitHub Bot commented on SCB-327:


coveralls commented on issue #550: [SCB-327] Update metrics publish data module
URL: 
https://github.com/apache/incubator-servicecomb-java-chassis/pull/550#issuecomment-363366448
 
 
   
   [![Coverage 
Status](https://coveralls.io/builds/15478764/badge)](https://coveralls.io/builds/15478764)
   
   Coverage increased (+0.06%) to 87.303% when pulling 
**cc2ba5346a5154ac066a44aa56ef19d1f655bec9 on zhengyangyong:SCB-327** into 
**cfc66b9775bf1e17e5fa1387a23a1510c2b45383 on apache:master**.
   


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


> Update metrics publish data module
> --
>
> Key: SCB-327
> URL: https://issues.apache.org/jira/browse/SCB-327
> Project: Apache ServiceComb
>  Issue Type: Sub-task
>  Components: Java-Chassis
>Affects Versions: java-chassis-1.0.0-m1
>Reporter: yangyongzheng
>Assignee: yangyongzheng
>Priority: Major
> Fix For: java-chassis-1.0.0-m1
>
>
> Change data publish from RegistryMetric model to map
>  adjust metrics publish format to spring cloud netflix style



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


[jira] [Commented] (SCB-327) Update metrics publish data module

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

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

ASF GitHub Bot commented on SCB-327:


coveralls commented on issue #550: [SCB-327] Update metrics publish data module
URL: 
https://github.com/apache/incubator-servicecomb-java-chassis/pull/550#issuecomment-363366448
 
 
   
   [![Coverage 
Status](https://coveralls.io/builds/15472553/badge)](https://coveralls.io/builds/15472553)
   
   Coverage increased (+0.04%) to 87.276% when pulling 
**be659929f90cfbaa8a88901409e465123345fb7f on zhengyangyong:SCB-327** into 
**cfc66b9775bf1e17e5fa1387a23a1510c2b45383 on apache:master**.
   


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


> Update metrics publish data module
> --
>
> Key: SCB-327
> URL: https://issues.apache.org/jira/browse/SCB-327
> Project: Apache ServiceComb
>  Issue Type: Sub-task
>  Components: Java-Chassis
>Affects Versions: java-chassis-1.0.0-m1
>Reporter: yangyongzheng
>Assignee: yangyongzheng
>Priority: Major
> Fix For: java-chassis-1.0.0-m1
>
>
> Change data publish from RegistryMetric model to map
>  adjust metrics publish format to spring cloud netflix style



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


[jira] [Commented] (SCB-327) Update metrics publish data module

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

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

ASF GitHub Bot commented on SCB-327:


coveralls commented on issue #550: [SCB-327] Update metrics publish data module
URL: 
https://github.com/apache/incubator-servicecomb-java-chassis/pull/550#issuecomment-363366448
 
 
   
   [![Coverage 
Status](https://coveralls.io/builds/15472067/badge)](https://coveralls.io/builds/15472067)
   
   Coverage increased (+0.1%) to 87.353% when pulling 
**91acf69ce7e45ae9c29be4cb196298a26fb0320b on zhengyangyong:SCB-327** into 
**cfc66b9775bf1e17e5fa1387a23a1510c2b45383 on apache:master**.
   


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


> Update metrics publish data module
> --
>
> Key: SCB-327
> URL: https://issues.apache.org/jira/browse/SCB-327
> Project: Apache ServiceComb
>  Issue Type: Sub-task
>  Components: Java-Chassis
>Affects Versions: java-chassis-1.0.0-m1
>Reporter: yangyongzheng
>Assignee: yangyongzheng
>Priority: Major
> Fix For: java-chassis-1.0.0-m1
>
>
> Change data publish from RegistryMetric model to map
>  adjust metrics publish format to spring cloud netflix style



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


[jira] [Commented] (SCB-327) Update metrics publish data module

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

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

ASF GitHub Bot commented on SCB-327:


coveralls commented on issue #550: [SCB-327] Update metrics publish data module
URL: 
https://github.com/apache/incubator-servicecomb-java-chassis/pull/550#issuecomment-363366448
 
 
   
   [![Coverage 
Status](https://coveralls.io/builds/15471939/badge)](https://coveralls.io/builds/15471939)
   
   Coverage decreased (-0.07%) to 87.167% when pulling 
**785f6541914812ff369fb726427c0637e75a9c12 on zhengyangyong:SCB-327** into 
**cfc66b9775bf1e17e5fa1387a23a1510c2b45383 on apache:master**.
   


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


> Update metrics publish data module
> --
>
> Key: SCB-327
> URL: https://issues.apache.org/jira/browse/SCB-327
> Project: Apache ServiceComb
>  Issue Type: Sub-task
>  Components: Java-Chassis
>Affects Versions: java-chassis-1.0.0-m1
>Reporter: yangyongzheng
>Assignee: yangyongzheng
>Priority: Major
> Fix For: java-chassis-1.0.0-m1
>
>
> Change data publish from RegistryMetric model to map
>  adjust metrics publish format to spring cloud netflix style



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


[jira] [Commented] (SCB-327) Update metrics publish data module

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

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

ASF GitHub Bot commented on SCB-327:


coveralls commented on issue #550: [SCB-327] Update metrics publish data module
URL: 
https://github.com/apache/incubator-servicecomb-java-chassis/pull/550#issuecomment-363366448
 
 
   
   [![Coverage 
Status](https://coveralls.io/builds/15471744/badge)](https://coveralls.io/builds/15471744)
   
   Coverage decreased (-0.4%) to 86.79% when pulling 
**1026cae22a71e158403b17ae42236c3b9e6e226c on zhengyangyong:SCB-327** into 
**cfc66b9775bf1e17e5fa1387a23a1510c2b45383 on apache:master**.
   


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


> Update metrics publish data module
> --
>
> Key: SCB-327
> URL: https://issues.apache.org/jira/browse/SCB-327
> Project: Apache ServiceComb
>  Issue Type: Sub-task
>  Components: Java-Chassis
>Affects Versions: java-chassis-1.0.0-m1
>Reporter: yangyongzheng
>Assignee: yangyongzheng
>Priority: Major
> Fix For: java-chassis-1.0.0-m1
>
>
> Change data publish from RegistryMetric model to map
>  adjust metrics publish format to spring cloud netflix style



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


[jira] [Commented] (SCB-327) Update metrics publish data module

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

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

ASF GitHub Bot commented on SCB-327:


coveralls commented on issue #550: [SCB-327] Update metrics publish data module
URL: 
https://github.com/apache/incubator-servicecomb-java-chassis/pull/550#issuecomment-363366448
 
 
   
   [![Coverage 
Status](https://coveralls.io/builds/15471368/badge)](https://coveralls.io/builds/15471368)
   
   Coverage decreased (-0.5%) to 86.764% when pulling 
**977a4efffb1a40ad224b7e7c95ba9572366bffd6 on zhengyangyong:SCB-327** into 
**cfc66b9775bf1e17e5fa1387a23a1510c2b45383 on apache:master**.
   


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


> Update metrics publish data module
> --
>
> Key: SCB-327
> URL: https://issues.apache.org/jira/browse/SCB-327
> Project: Apache ServiceComb
>  Issue Type: Sub-task
>  Components: Java-Chassis
>Affects Versions: java-chassis-1.0.0-m1
>Reporter: yangyongzheng
>Assignee: yangyongzheng
>Priority: Major
> Fix For: java-chassis-1.0.0-m1
>
>
> Change data publish from RegistryMetric model to map
>  adjust metrics publish format to spring cloud netflix style



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


[jira] [Commented] (SCB-327) Update metrics publish data module

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

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

ASF GitHub Bot commented on SCB-327:


zhengyangyong commented on a change in pull request #550: [SCB-327] Update 
metrics publish data module
URL: 
https://github.com/apache/incubator-servicecomb-java-chassis/pull/550#discussion_r167418385
 
 

 ##
 File path: 
metrics/metrics-common/src/main/java/org/apache/servicecomb/metrics/common/MetricsPublisher.java
 ##
 @@ -17,43 +17,8 @@
 
 package org.apache.servicecomb.metrics.common;
 
-import java.util.List;
+import java.util.Map;
 
 Review comment:
   metrics-common had deleted and move all content into foundation-metrics


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


> Update metrics publish data module
> --
>
> Key: SCB-327
> URL: https://issues.apache.org/jira/browse/SCB-327
> Project: Apache ServiceComb
>  Issue Type: Sub-task
>  Components: Java-Chassis
>Affects Versions: java-chassis-1.0.0-m1
>Reporter: yangyongzheng
>Assignee: yangyongzheng
>Priority: Major
> Fix For: java-chassis-1.0.0-m1
>
>
> Change data publish from RegistryMetric model to map
>  adjust metrics publish format to spring cloud netflix style



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


[jira] [Commented] (SCB-327) Update metrics publish data module

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

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

ASF GitHub Bot commented on SCB-327:


zhengyangyong commented on a change in pull request #550: [SCB-327] Update 
metrics publish data module
URL: 
https://github.com/apache/incubator-servicecomb-java-chassis/pull/550#discussion_r167418366
 
 

 ##
 File path: 
metrics/metrics-common/src/main/java/org/apache/servicecomb/metrics/common/MetricsPublisher.java
 ##
 @@ -17,43 +17,8 @@
 
 package org.apache.servicecomb.metrics.common;
 
-import java.util.List;
+import java.util.Map;
 
 Review comment:
   Done


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


> Update metrics publish data module
> --
>
> Key: SCB-327
> URL: https://issues.apache.org/jira/browse/SCB-327
> Project: Apache ServiceComb
>  Issue Type: Sub-task
>  Components: Java-Chassis
>Affects Versions: java-chassis-1.0.0-m1
>Reporter: yangyongzheng
>Assignee: yangyongzheng
>Priority: Major
> Fix For: java-chassis-1.0.0-m1
>
>
> Change data publish from RegistryMetric model to map
>  adjust metrics publish format to spring cloud netflix style



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


[jira] [Commented] (SCB-327) Update metrics publish data module

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

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

ASF GitHub Bot commented on SCB-327:


zhengyangyong commented on a change in pull request #550: [SCB-327] Update 
metrics publish data module
URL: 
https://github.com/apache/incubator-servicecomb-java-chassis/pull/550#discussion_r167418364
 
 

 ##
 File path: 
metrics/metrics-common/src/main/java/org/apache/servicecomb/metrics/common/publish/Metric.java
 ##
 @@ -0,0 +1,66 @@
+/*
+ * 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.common.publish;
+
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+public class Metric {
 
 Review comment:
   we do not import spectator in current version;
   this class had parse metric output id into name and tag map,easy use for 
grouping


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


> Update metrics publish data module
> --
>
> Key: SCB-327
> URL: https://issues.apache.org/jira/browse/SCB-327
> Project: Apache ServiceComb
>  Issue Type: Sub-task
>  Components: Java-Chassis
>Affects Versions: java-chassis-1.0.0-m1
>Reporter: yangyongzheng
>Assignee: yangyongzheng
>Priority: Major
> Fix For: java-chassis-1.0.0-m1
>
>
> Change data publish from RegistryMetric model to map
>  adjust metrics publish format to spring cloud netflix style



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


[jira] [Commented] (SCB-327) Update metrics publish data module

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

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

ASF GitHub Bot commented on SCB-327:


zhengyangyong commented on a change in pull request #550: [SCB-327] Update 
metrics publish data module
URL: 
https://github.com/apache/incubator-servicecomb-java-chassis/pull/550#discussion_r167418368
 
 

 ##
 File path: 
metrics/metrics-common/src/main/java/org/apache/servicecomb/metrics/common/MetricsPublisher.java
 ##
 @@ -17,43 +17,8 @@
 
 package org.apache.servicecomb.metrics.common;
 
-import java.util.List;
+import java.util.Map;
 
 public interface MetricsPublisher {
-  /**  What's the WindowTime ?
-   We all know there are two major type of metric :
-   1.Time-unrelated,you can get the latest value any time immediately:
-   Counter -> increase or decrease
-   Guage -> set a certain one value
-   2.Time-related,only after a centain time pass you can compute the right 
value,"a centain time" called WindowTime
-   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 getAppliedWindowTime();
-
-  //same as getRegistryMetric({first setting windowTime})
-  RegistryMetric metrics();
-
-  /**
-   * windowTime usage example:
-   * if there is two window time set in "servicecomb.metrics.window_time" like 
1000,2000
-   * then windowTime = 1000 will return result of the setting 1000(1 second)
-   * windowTime = 2000 will return result of the setting 2000(2 second)
-   *
-   * there are three monitor of max,min,total
-   * 0--1--2--3--  <-time line (second)
-   *   100,200300,400  <-value record
-   *
-   * ↑ getRegistryMetric(1000) will return max=200 min=100 
total=300
-   *   getRegistryMetric(2000) will return max=0 min=0 total=0
-   * ↑ getRegistryMetric(1000) will return max=300 
min=400 total=700
-   *   getRegistryMetric(2000) will return max=400 
min=100 total=1000
-   *
-   * @param windowTime getAppliedWindowTime() item
-   * @return RegistryMetric
-   */
-  RegistryMetric metricsWithWindowTime(long windowTime);
+  Map metrics();
 
 Review comment:
   Done,deleted


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


> Update metrics publish data module
> --
>
> Key: SCB-327
> URL: https://issues.apache.org/jira/browse/SCB-327
> Project: Apache ServiceComb
>  Issue Type: Sub-task
>  Components: Java-Chassis
>Affects Versions: java-chassis-1.0.0-m1
>Reporter: yangyongzheng
>Assignee: yangyongzheng
>Priority: Major
> Fix For: java-chassis-1.0.0-m1
>
>
> Change data publish from RegistryMetric model to map
>  adjust metrics publish format to spring cloud netflix style



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


[jira] [Commented] (SCB-327) Update metrics publish data module

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

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

ASF GitHub Bot commented on SCB-327:


wujimin commented on a change in pull request #550: [SCB-327] Update metrics 
publish data module
URL: 
https://github.com/apache/incubator-servicecomb-java-chassis/pull/550#discussion_r167417012
 
 

 ##
 File path: 
metrics/metrics-common/src/main/java/org/apache/servicecomb/metrics/common/MetricsPublisher.java
 ##
 @@ -17,43 +17,8 @@
 
 package org.apache.servicecomb.metrics.common;
 
-import java.util.List;
+import java.util.Map;
 
 public interface MetricsPublisher {
-  /**  What's the WindowTime ?
-   We all know there are two major type of metric :
-   1.Time-unrelated,you can get the latest value any time immediately:
-   Counter -> increase or decrease
-   Guage -> set a certain one value
-   2.Time-related,only after a centain time pass you can compute the right 
value,"a centain time" called WindowTime
-   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 getAppliedWindowTime();
-
-  //same as getRegistryMetric({first setting windowTime})
-  RegistryMetric metrics();
-
-  /**
-   * windowTime usage example:
-   * if there is two window time set in "servicecomb.metrics.window_time" like 
1000,2000
-   * then windowTime = 1000 will return result of the setting 1000(1 second)
-   * windowTime = 2000 will return result of the setting 2000(2 second)
-   *
-   * there are three monitor of max,min,total
-   * 0--1--2--3--  <-time line (second)
-   *   100,200300,400  <-value record
-   *
-   * ↑ getRegistryMetric(1000) will return max=200 min=100 
total=300
-   *   getRegistryMetric(2000) will return max=0 min=0 total=0
-   * ↑ getRegistryMetric(1000) will return max=300 
min=400 total=700
-   *   getRegistryMetric(2000) will return max=400 
min=100 total=1000
-   *
-   * @param windowTime getAppliedWindowTime() item
-   * @return RegistryMetric
-   */
-  RegistryMetric metricsWithWindowTime(long windowTime);
+  Map metrics();
 
 Review comment:
   why we need this interface?


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


> Update metrics publish data module
> --
>
> Key: SCB-327
> URL: https://issues.apache.org/jira/browse/SCB-327
> Project: Apache ServiceComb
>  Issue Type: Sub-task
>  Components: Java-Chassis
>Affects Versions: java-chassis-1.0.0-m1
>Reporter: yangyongzheng
>Assignee: yangyongzheng
>Priority: Major
> Fix For: java-chassis-1.0.0-m1
>
>
> Change data publish from RegistryMetric model to map
>  adjust metrics publish format to spring cloud netflix style



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


[jira] [Commented] (SCB-327) Update metrics publish data module

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

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

ASF GitHub Bot commented on SCB-327:


wujimin commented on a change in pull request #550: [SCB-327] Update metrics 
publish data module
URL: 
https://github.com/apache/incubator-servicecomb-java-chassis/pull/550#discussion_r167416345
 
 

 ##
 File path: 
metrics/metrics-common/src/main/java/org/apache/servicecomb/metrics/common/MetricsPublisher.java
 ##
 @@ -17,43 +17,8 @@
 
 package org.apache.servicecomb.metrics.common;
 
-import java.util.List;
+import java.util.Map;
 
 Review comment:
   common move to foundation-metrics


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


> Update metrics publish data module
> --
>
> Key: SCB-327
> URL: https://issues.apache.org/jira/browse/SCB-327
> Project: Apache ServiceComb
>  Issue Type: Sub-task
>  Components: Java-Chassis
>Affects Versions: java-chassis-1.0.0-m1
>Reporter: yangyongzheng
>Assignee: yangyongzheng
>Priority: Major
> Fix For: java-chassis-1.0.0-m1
>
>
> Change data publish from RegistryMetric model to map
>  adjust metrics publish format to spring cloud netflix style



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


[jira] [Commented] (SCB-327) Update metrics publish data module

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

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

ASF GitHub Bot commented on SCB-327:


wujimin commented on a change in pull request #550: [SCB-327] Update metrics 
publish data module
URL: 
https://github.com/apache/incubator-servicecomb-java-chassis/pull/550#discussion_r167416308
 
 

 ##
 File path: 
metrics/metrics-common/src/main/java/org/apache/servicecomb/metrics/common/publish/Metric.java
 ##
 @@ -0,0 +1,66 @@
+/*
+ * 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.common.publish;
+
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+public class Metric {
 
 Review comment:
   why wrap another class?
   Metric just equals Measurement..


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


> Update metrics publish data module
> --
>
> Key: SCB-327
> URL: https://issues.apache.org/jira/browse/SCB-327
> Project: Apache ServiceComb
>  Issue Type: Sub-task
>  Components: Java-Chassis
>Affects Versions: java-chassis-1.0.0-m1
>Reporter: yangyongzheng
>Assignee: yangyongzheng
>Priority: Major
> Fix For: java-chassis-1.0.0-m1
>
>
> Change data publish from RegistryMetric model to map
>  adjust metrics publish format to spring cloud netflix style



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


[jira] [Commented] (SCB-327) Update metrics publish data module

2018-02-08 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on SCB-327:


coveralls commented on issue #550: [SCB-327] Update metrics publish data module
URL: 
https://github.com/apache/incubator-servicecomb-java-chassis/pull/550#issuecomment-363366448
 
 
   
   [![Coverage 
Status](https://coveralls.io/builds/15446953/badge)](https://coveralls.io/builds/15446953)
   
   Coverage decreased (-0.1%) to 87.101% when pulling 
**1c06e50ab2f94d12a8f1002abb669a4fc5a032c4 on zhengyangyong:SCB-327** into 
**05de3cfa3c4d65725ba86c37dc25ec8c1f8ddfe7 on apache:master**.
   


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


> Update metrics publish data module
> --
>
> Key: SCB-327
> URL: https://issues.apache.org/jira/browse/SCB-327
> Project: Apache ServiceComb
>  Issue Type: Sub-task
>  Components: Java-Chassis
>Affects Versions: java-chassis-1.0.0-m1
>Reporter: yangyongzheng
>Assignee: yangyongzheng
>Priority: Major
> Fix For: java-chassis-1.0.0-m1
>
>
> Change data publish from RegistryMetric model to map
>  adjust metrics publish format to spring cloud netflix style



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


[jira] [Commented] (SCB-327) Update metrics publish data module

2018-02-08 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on SCB-327:


zhengyangyong commented on a change in pull request #550: [SCB-327] Update 
metrics publish data module
URL: 
https://github.com/apache/incubator-servicecomb-java-chassis/pull/550#discussion_r167134620
 
 

 ##
 File path: 
metrics/metrics-core/src/main/java/org/apache/servicecomb/metrics/core/monitor/CallMonitor.java
 ##
 @@ -17,79 +17,76 @@
 
 package org.apache.servicecomb.metrics.core.monitor;
 
-import java.util.ArrayList;
-import java.util.List;
+import java.util.HashMap;
 import java.util.Map;
 
 import org.apache.servicecomb.foundation.common.concurrent.ConcurrentHashMapEx;
-import org.apache.servicecomb.metrics.common.CallMetric;
-import org.apache.servicecomb.metrics.common.DoubleMetricValue;
-import org.apache.servicecomb.metrics.common.LongMetricValue;
-import org.apache.servicecomb.metrics.common.MetricsDimension;
+import org.apache.servicecomb.metrics.common.MetricsConst;
 import org.apache.servicecomb.metrics.core.utils.MonitorUtils;
 
 import com.netflix.servo.monitor.BasicCounter;
 import com.netflix.servo.monitor.MonitorConfig;
 import com.netflix.servo.monitor.StepCounter;
+import com.netflix.servo.tag.Tags;
 
 public class CallMonitor {
-  private final String prefix;
+  private final Map statusCounters;
 
-  private final Map> dimensionCounters;
+  private final String operation;
 
-  public CallMonitor(String prefix) {
-this.prefix = prefix;
-this.dimensionCounters = new ConcurrentHashMapEx<>();
-this.dimensionCounters.put(MetricsDimension.DIMENSION_STATUS, new 
ConcurrentHashMapEx<>());
+  private final String stage;
+
+  private final String role;
+
+  public CallMonitor(String operation, String stage, String role) {
+this.operation = operation;
+this.stage = stage;
+this.role = role;
+
+this.statusCounters = new ConcurrentHashMapEx<>();
   }
 
-  public void increment(String dimensionKey, String... dimensionValues) {
-for (String dimensionValue : dimensionValues) {
-  DimensionCounter counter = dimensionCounters.get(dimensionKey)
-  .computeIfAbsent(dimensionValue, d -> new DimensionCounter(
-  new BasicCounter(MonitorConfig.builder(prefix + 
".total").withTag(dimensionKey, dimensionValue).build()),
-  new StepCounter(MonitorConfig.builder(prefix + 
".tps").withTag(dimensionKey, dimensionValue).build(;
-  counter.increment();
-}
+  public void increment(String statusCode) {
+StatusCounter counter = statusCounters
+.computeIfAbsent(statusCode, d -> new StatusCounter(operation, stage, 
role, statusCode));
+counter.increment();
   }
 
-  public CallMetric toMetric(int windowTimeIndex) {
-List totalValues = new ArrayList<>();
-List tpsValues = new ArrayList<>();
-for (Map dimensionCounter : 
dimensionCounters.values()) {
-  for (DimensionCounter counter : dimensionCounter.values()) {
-totalValues.add(new 
LongMetricValue(counter.getTotal().getValue(windowTimeIndex).longValue(),
-MonitorUtils.convertTags(counter.getTotal(;
-tpsValues.add(
-new 
DoubleMetricValue(MonitorUtils.adjustValue(counter.getTps().getValue(windowTimeIndex).doubleValue()),
-MonitorUtils.convertTags(counter.getTps(;
-  }
+  public Map measure(int windowTimeIndex) {
+Map metrics = new HashMap<>();
+for (StatusCounter counter : statusCounters.values()) {
+  metrics.putAll(counter.measure(windowTimeIndex));
 }
-
-return new CallMetric(this.prefix, totalValues, tpsValues);
+return metrics;
   }
 
-  class DimensionCounter {
-private final BasicCounter total;
+  class StatusCounter {
+private final BasicCounter totalCount;
 
 private final StepCounter tps;
 
-public BasicCounter getTotal() {
-  return total;
-}
-
-public StepCounter getTps() {
-  return tps;
-}
+public StatusCounter(String operation, String stage, String role, String 
statusCode) {
+  MonitorConfig config = 
MonitorConfig.builder(MetricsConst.SERVICECOMB_INVOCATION)
+  .withTag(MetricsConst.TAG_STATUS, 
statusCode).withTag(MetricsConst.TAG_OPERATION, operation)
+  .withTag(MetricsConst.TAG_STAGE, 
stage).withTag(MetricsConst.TAG_ROLE, role).build();
 
-public DimensionCounter(BasicCounter total, StepCounter tps) {
-  this.total = total;
-  this.tps = tps;
+  this.totalCount = new BasicCounter(
+  config.withAdditionalTag(Tags.newTag(MetricsConst.TAG_STATISTIC, 
"totalCount")));
+  this.tps = new 
StepCounter(config.withAdditionalTag(Tags.newTag(MetricsConst.TAG_STATISTIC, 
"tps")));
 }
 
 public void 

[jira] [Commented] (SCB-327) Update metrics publish data module

2018-02-08 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on SCB-327:


WillemJiang commented on a change in pull request #550: [SCB-327] Update 
metrics publish data module
URL: 
https://github.com/apache/incubator-servicecomb-java-chassis/pull/550#discussion_r167118327
 
 

 ##
 File path: 
metrics/metrics-core/src/main/java/org/apache/servicecomb/metrics/core/publish/DefaultDataSource.java
 ##
 @@ -67,32 +66,37 @@ public DefaultDataSource(RegistryMonitor registryMonitor, 
String pollingSettings
 throw new ServiceCombException("bad format 
servicecomb.metrics.window_time", e);
   }
 }
-String finalPollingSettings = Strings.join(",", 
parsePollingSettings.iterator());
-System.getProperties().setProperty("servo.pollers", finalPollingSettings);
-List appliedWindowTimes = getAppliedWindowTime();
-for (int i = 0; i < appliedWindowTimes.size(); i++) {
-  this.appliedWindowTimes.put(appliedWindowTimes.get(i), i);
+
+List sortedPollingSettings = 
Lists.newArrayList(parsePollingSettings);
+System.getProperties().setProperty("servo.pollers", Strings.join(",", 
sortedPollingSettings.iterator()));
 
 Review comment:
   It's not good way to set the system properties here (as it could be 
overridden anytime), can we setup the servo poller directly? 


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


> Update metrics publish data module
> --
>
> Key: SCB-327
> URL: https://issues.apache.org/jira/browse/SCB-327
> Project: Apache ServiceComb
>  Issue Type: Sub-task
>  Components: Java-Chassis
>Affects Versions: java-chassis-1.0.0-m1
>Reporter: yangyongzheng
>Assignee: yangyongzheng
>Priority: Major
> Fix For: java-chassis-1.0.0-m1
>
>
> Change data publish from RegistryMetric model to map
>  adjust metrics publish format to spring cloud netflix style



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


[jira] [Commented] (SCB-327) Update metrics publish data module

2018-02-08 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on SCB-327:


WillemJiang commented on a change in pull request #550: [SCB-327] Update 
metrics publish data module
URL: 
https://github.com/apache/incubator-servicecomb-java-chassis/pull/550#discussion_r167116882
 
 

 ##
 File path: 
metrics/metrics-core/src/main/java/org/apache/servicecomb/metrics/core/monitor/CallMonitor.java
 ##
 @@ -17,79 +17,76 @@
 
 package org.apache.servicecomb.metrics.core.monitor;
 
-import java.util.ArrayList;
-import java.util.List;
+import java.util.HashMap;
 import java.util.Map;
 
 import org.apache.servicecomb.foundation.common.concurrent.ConcurrentHashMapEx;
-import org.apache.servicecomb.metrics.common.CallMetric;
-import org.apache.servicecomb.metrics.common.DoubleMetricValue;
-import org.apache.servicecomb.metrics.common.LongMetricValue;
-import org.apache.servicecomb.metrics.common.MetricsDimension;
+import org.apache.servicecomb.metrics.common.MetricsConst;
 import org.apache.servicecomb.metrics.core.utils.MonitorUtils;
 
 import com.netflix.servo.monitor.BasicCounter;
 import com.netflix.servo.monitor.MonitorConfig;
 import com.netflix.servo.monitor.StepCounter;
+import com.netflix.servo.tag.Tags;
 
 public class CallMonitor {
-  private final String prefix;
+  private final Map statusCounters;
 
-  private final Map> dimensionCounters;
+  private final String operation;
 
-  public CallMonitor(String prefix) {
-this.prefix = prefix;
-this.dimensionCounters = new ConcurrentHashMapEx<>();
-this.dimensionCounters.put(MetricsDimension.DIMENSION_STATUS, new 
ConcurrentHashMapEx<>());
+  private final String stage;
+
+  private final String role;
+
+  public CallMonitor(String operation, String stage, String role) {
+this.operation = operation;
+this.stage = stage;
+this.role = role;
+
+this.statusCounters = new ConcurrentHashMapEx<>();
   }
 
-  public void increment(String dimensionKey, String... dimensionValues) {
-for (String dimensionValue : dimensionValues) {
-  DimensionCounter counter = dimensionCounters.get(dimensionKey)
-  .computeIfAbsent(dimensionValue, d -> new DimensionCounter(
-  new BasicCounter(MonitorConfig.builder(prefix + 
".total").withTag(dimensionKey, dimensionValue).build()),
-  new StepCounter(MonitorConfig.builder(prefix + 
".tps").withTag(dimensionKey, dimensionValue).build(;
-  counter.increment();
-}
+  public void increment(String statusCode) {
+StatusCounter counter = statusCounters
+.computeIfAbsent(statusCode, d -> new StatusCounter(operation, stage, 
role, statusCode));
+counter.increment();
   }
 
-  public CallMetric toMetric(int windowTimeIndex) {
-List totalValues = new ArrayList<>();
-List tpsValues = new ArrayList<>();
-for (Map dimensionCounter : 
dimensionCounters.values()) {
-  for (DimensionCounter counter : dimensionCounter.values()) {
-totalValues.add(new 
LongMetricValue(counter.getTotal().getValue(windowTimeIndex).longValue(),
-MonitorUtils.convertTags(counter.getTotal(;
-tpsValues.add(
-new 
DoubleMetricValue(MonitorUtils.adjustValue(counter.getTps().getValue(windowTimeIndex).doubleValue()),
-MonitorUtils.convertTags(counter.getTps(;
-  }
+  public Map measure(int windowTimeIndex) {
+Map metrics = new HashMap<>();
+for (StatusCounter counter : statusCounters.values()) {
+  metrics.putAll(counter.measure(windowTimeIndex));
 }
-
-return new CallMetric(this.prefix, totalValues, tpsValues);
+return metrics;
   }
 
-  class DimensionCounter {
-private final BasicCounter total;
+  class StatusCounter {
+private final BasicCounter totalCount;
 
 private final StepCounter tps;
 
-public BasicCounter getTotal() {
-  return total;
-}
-
-public StepCounter getTps() {
-  return tps;
-}
+public StatusCounter(String operation, String stage, String role, String 
statusCode) {
+  MonitorConfig config = 
MonitorConfig.builder(MetricsConst.SERVICECOMB_INVOCATION)
+  .withTag(MetricsConst.TAG_STATUS, 
statusCode).withTag(MetricsConst.TAG_OPERATION, operation)
+  .withTag(MetricsConst.TAG_STAGE, 
stage).withTag(MetricsConst.TAG_ROLE, role).build();
 
-public DimensionCounter(BasicCounter total, StepCounter tps) {
-  this.total = total;
-  this.tps = tps;
+  this.totalCount = new BasicCounter(
+  config.withAdditionalTag(Tags.newTag(MetricsConst.TAG_STATISTIC, 
"totalCount")));
+  this.tps = new 
StepCounter(config.withAdditionalTag(Tags.newTag(MetricsConst.TAG_STATISTIC, 
"tps")));
 }
 
 public void 

[jira] [Commented] (SCB-327) Update metrics publish data module

2018-02-08 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on SCB-327:


coveralls commented on issue #550: [SCB-327] Update metrics publish data module
URL: 
https://github.com/apache/incubator-servicecomb-java-chassis/pull/550#issuecomment-363366448
 
 
   
   [![Coverage 
Status](https://coveralls.io/builds/15433378/badge)](https://coveralls.io/builds/15433378)
   
   Coverage increased (+0.02%) to 87.255% when pulling 
**72b6b3330d2134c06dd57009fb675a90e1680543 on zhengyangyong:SCB-327** into 
**05de3cfa3c4d65725ba86c37dc25ec8c1f8ddfe7 on apache:master**.
   


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


> Update metrics publish data module
> --
>
> Key: SCB-327
> URL: https://issues.apache.org/jira/browse/SCB-327
> Project: Apache ServiceComb
>  Issue Type: Sub-task
>  Components: Java-Chassis
>Affects Versions: java-chassis-1.0.0-m1
>Reporter: yangyongzheng
>Assignee: yangyongzheng
>Priority: Major
> Fix For: java-chassis-1.0.0-m1
>
>
> Change data publish from RegistryMetric model to map
>  adjust metrics publish format to spring cloud netflix style



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


[jira] [Commented] (SCB-327) Update metrics publish data module

2018-02-08 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on SCB-327:


zhengyangyong commented on issue #550: [SCB-327] Update metrics publish data 
module
URL: 
https://github.com/apache/incubator-servicecomb-java-chassis/pull/550#issuecomment-364108895
 
 
   Rebase and resolved conflicts


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


> Update metrics publish data module
> --
>
> Key: SCB-327
> URL: https://issues.apache.org/jira/browse/SCB-327
> Project: Apache ServiceComb
>  Issue Type: Sub-task
>  Components: Java-Chassis
>Affects Versions: java-chassis-1.0.0-m1
>Reporter: yangyongzheng
>Assignee: yangyongzheng
>Priority: Major
> Fix For: java-chassis-1.0.0-m1
>
>
> Change data publish from RegistryMetric model to map
>  adjust metrics publish format to spring cloud netflix style



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


[jira] [Commented] (SCB-327) Update metrics publish data module

2018-02-06 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on SCB-327:


coveralls commented on issue #550: [SCB-327] Update metrics publish data module
URL: 
https://github.com/apache/incubator-servicecomb-java-chassis/pull/550#issuecomment-363366448
 
 
   
   [![Coverage 
Status](https://coveralls.io/builds/15393343/badge)](https://coveralls.io/builds/15393343)
   
   Coverage increased (+0.03%) to 87.296% when pulling 
**4247988ae5e93e816dff2028ff6ab1ed231c6ac7 on zhengyangyong:SCB-327** into 
**bbe18e493aa3fb3d1531f7e6bee806e22d9994b4 on apache:master**.
   


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


> Update metrics publish data module
> --
>
> Key: SCB-327
> URL: https://issues.apache.org/jira/browse/SCB-327
> Project: Apache ServiceComb
>  Issue Type: Sub-task
>  Components: Java-Chassis
>Affects Versions: java-chassis-1.0.0-m1
>Reporter: yangyongzheng
>Assignee: yangyongzheng
>Priority: Major
> Fix For: java-chassis-1.0.0-m1
>
>
> Change data publish from RegistryMetric model to map
>  adjust metrics publish format to spring cloud netflix style



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


[jira] [Commented] (SCB-327) Update metrics publish data module

2018-02-06 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on SCB-327:


coveralls commented on issue #550: [SCB-327] Update metrics publish data module
URL: 
https://github.com/apache/incubator-servicecomb-java-chassis/pull/550#issuecomment-363366448
 
 
   
   [![Coverage 
Status](https://coveralls.io/builds/15390786/badge)](https://coveralls.io/builds/15390786)
   
   Coverage increased (+0.01%) to 87.284% when pulling 
**d292bef143fe1918a0d18ab73fbde096478e23f3 on zhengyangyong:SCB-327** into 
**bbe18e493aa3fb3d1531f7e6bee806e22d9994b4 on apache:master**.
   


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


> Update metrics publish data module
> --
>
> Key: SCB-327
> URL: https://issues.apache.org/jira/browse/SCB-327
> Project: Apache ServiceComb
>  Issue Type: Sub-task
>  Components: Java-Chassis
>Affects Versions: java-chassis-1.0.0-m1
>Reporter: yangyongzheng
>Assignee: yangyongzheng
>Priority: Major
> Fix For: java-chassis-1.0.0-m1
>
>
> Change data publish from RegistryMetric model to map
>  adjust metrics publish format to spring cloud netflix style



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


[jira] [Commented] (SCB-327) Update metrics publish data module

2018-02-06 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on SCB-327:


zhengyangyong opened a new pull request #550: [SCB-327] Update metrics publish 
data module
URL: https://github.com/apache/incubator-servicecomb-java-chassis/pull/550
 
 
   Follow this checklist to help us incorporate your contribution quickly and 
easily:
   
- [ ] Make sure there is a [JIRA 
issue](https://issues.apache.org/jira/browse/SCB) filed for the change (usually 
before you start working on it).  Trivial changes like typos do not require a 
JIRA issue.  Your pull request should address just this issue, without pulling 
in other changes.
- [ ] Each commit in the pull request should have a meaningful subject line 
and body.
- [ ] Format the pull request title like `[SCB-XXX] Fixes bug in 
ApproximateQuantiles`, where you replace `SCB-XXX` with the appropriate JIRA 
issue.
- [ ] Write a pull request description that is detailed enough to 
understand what the pull request does, how, and why.
- [ ] Run `mvn clean install` to make sure basic checks pass. A more 
thorough check will be performed on your pull request automatically.
- [ ] If this contribution is large, please file an Apache [Individual 
Contributor License Agreement](https://www.apache.org/licenses/icla.pdf).
   
   ---
   adjust metrics publish format to spring cloud netflix style
   Before:
   servicecomb.instance.system.cpu.load
   servicecomb.instance.system.cpu.runningThreads
   servicecomb.instance.system.heap.init
   servicecomb.instance.system.heap.max
   servicecomb.instance.system.heap.commit
   servicecomb.instance.system.heap.used
   servicecomb.instance.system.nonHeap.init
   servicecomb.instance.system.nonHeap.max
   servicecomb.instance.system.nonHeap.commit
   servicecomb.instance.system.nonHeap.used
   servicecomb.instance|.producer.waitInQueue.count
   servicecomb.instance|.producer.lifeTimeInQueue.average
   servicecomb.instance|.producer.lifeTimeInQueue.max
   servicecomb.instance|.producer.lifeTimeInQueue.min
   servicecomb.instance|.producer.executionTime.average
   servicecomb.instance|.producer.executionTime.max
   servicecomb.instance|.producer.executionTime.min
   servicecomb.instance|.producer.producerLatency.average
   servicecomb.instance|.producer.producerLatency.max
   servicecomb.instance|.producer.producerLatency.min
   servicecomb.instance|.producer.producerCall.total
   servicecomb.instance|.producer.producerCall.tps
   servicecomb.instance|.consumer.consumerLatency.average
   servicecomb.instance|.consumer.consumerLatency.max
   servicecomb.instance|.consumer.consumerLatency.min
   servicecomb.instance|.consumer.consumerCall.total
   servicecomb.instance|.consumer.consumerCall.tps
   
   Current:
   jvm(statistic=gauge,name=)
include : 
cpuLoad,cpuRunningThreads,heapInit,heapMax,heapCommit,heapUsed,nonHeapInit,nonHeapMax,nonHeapCommit,nonHeapUsed
   
   
servicecomb.invocation(operation=,role=,stage=,statistic=,status=,type=)
   
   | TagName   | TagValue  | 
   | :-- | :- |
   | operation | Operation Name |
   | role | consume,producer |
   | stage | queue,execution,whole(queue + execution) |
   | statistic | tps,count(total call count),latency,max,waitInQueue |
   | status | all,success or failed(output_level=success_failed),2xx or 3xx or 
4xx or 5xx or xxx(output_level=code_group),200 or 404 etc(output_level=code) |
   | type | useless |
   


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


> Update metrics publish data module
> --
>
> Key: SCB-327
> URL: https://issues.apache.org/jira/browse/SCB-327
> Project: Apache ServiceComb
>  Issue Type: Sub-task
>  Components: Java-Chassis
>Affects Versions: java-chassis-1.0.0-m1
>Reporter: yangyongzheng
>Assignee: yangyongzheng
>Priority: Major
> Fix For: java-chassis-1.0.0-m1
>
>
> Change data publish from RegistryMetric model to map
>  adjust metrics publish format to spring cloud netflix style



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