[jira] [Commented] (SCB-1048) Provide a way to configure bootstrap information in Cloud Native enviroment

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


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

ASF GitHub Bot commented on SCB-1048:
-

liubao68 opened a new pull request #1014: [SCB-1048]Provide a way to configure 
bootstrap information in Cloud N…
URL: https://github.com/apache/servicecomb-java-chassis/pull/1014
 
 
   …ative enviroment
   
   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).
   
   ---
   


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


> Provide a way to configure bootstrap information in Cloud Native enviroment
> ---
>
> Key: SCB-1048
> URL: https://issues.apache.org/jira/browse/SCB-1048
> Project: Apache ServiceComb
>  Issue Type: New Feature
>  Components: Java-Chassis
>Reporter: liubao
>Assignee: liubao
>Priority: Major
>
> # About Bootstrap Module
> Bootstrap is a mechanism to manage how microservics interact with external 
> services. When running a microservic in a Cloud Native enviroment, it will 
> interact with many external services, like service center, config center, an 
> APM service to report tracing data, a dashboard service to report health 
> data, etc. Bootstrap manages the meta data of these services. Bootstrap 
> queries the addresses , the parameters, the authentication information of 
> these services and so on.
> Bootstrap is some kind of service like service center, they are differ from 
> two aspects:
> 1. All microservics will report their information to service center. But 
> Bootstrap acts as a management system and knows the meta information in 
> deploy time. 
> 2. Service center provide some other functions like instance management and 
> heartbeat, But Bootstrap only provide metadata query services and it is 
> simple.
> Bootstrap does not provide a management service, it providers the interface 
> to interacts with management service. Service Providers can implement the 
> interface.
> They are some design constraints need to be considered when implment 
> Bootstrap interface:
> 1. Bootstrap can only read configurations of environment, microservics.yaml. 
> It can not read dynamic configurations.
> 2. Bootstrap is initialized before bean initialization.



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


[jira] [Commented] (SCB-1048) Provide a way to configure bootstrap information in Cloud Native enviroment

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


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

ASF GitHub Bot commented on SCB-1048:
-

liubao68 closed pull request #1014: [SCB-1048]Provide a way to configure 
bootstrap information in Cloud N…
URL: https://github.com/apache/servicecomb-java-chassis/pull/1014
 
 
   

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

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

diff --git a/coverage-reports/pom.xml b/coverage-reports/pom.xml
index 98285871b..04396fb0a 100644
--- a/coverage-reports/pom.xml
+++ b/coverage-reports/pom.xml
@@ -46,6 +46,10 @@
   org.apache.servicecomb
   foundation-config
 
+
+  org.apache.servicecomb
+  deployment
+
 
   org.apache.servicecomb
   foundation-vertx
diff --git a/deployment/README.md b/deployment/README.md
new file mode 100644
index 0..b2764cc0a
--- /dev/null
+++ b/deployment/README.md
@@ -0,0 +1,13 @@
+# About Deployment Module
+
+Deployment is a mechanism to manage how microservics interact with external 
services. When running a microservice in a Cloud Native environment, it will 
interact with many external services, like service center, config center, an 
APM service to report tracing data, a dashboard service to report health data, 
etc. Deployment Service manages the meta data of these services. Deployment 
queries the addresses , the parameters, the authentication information of these 
services and so on. 
+
+Deployment Service is some kind of service like service center, they are 
differ from two aspects:
+1. All microservics will report their information to service center. But 
Deployment Service acts as a management system and knows the meta information 
in deploy time. 
+2. Service center provide some other functions like instance management and 
heartbeat, while Deployment Service only provides metadata query services and 
it is simple. 
+
+This module does not provide a Deployment Service, it provides the interface 
to interacts with Deployment Service. Service providers can implement the 
interface. 
+
+They are some design constraints need to be considered when implement 
Deployment interface:
+1. Deployment can only read configurations of environment, microservics.yaml. 
It can not read dynamic configurations.
+2. Deployment is initialized before bean initialization. 
diff --git a/deployment/pom.xml b/deployment/pom.xml
new file mode 100644
index 0..6dc9c1446
--- /dev/null
+++ b/deployment/pom.xml
@@ -0,0 +1,71 @@
+
+
+
+http://maven.apache.org/POM/4.0.0; 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance;
+  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 
http://maven.apache.org/xsd/maven-4.0.0.xsd;>
+  
+org.apache.servicecomb
+java-chassis-parent
+1.1.0-SNAPSHOT
+../parent
+  
+  4.0.0
+
+  deployment
+  Java Chassis::Deployment
+
+  
+
+  org.apache.servicecomb
+  foundation-config
+
+
+  org.apache.servicecomb
+  foundation-vertx
+
+
+  org.apache.servicecomb
+  foundation-common
+
+
+
+  io.vertx
+  vertx-codegen
+  provided
+
+
+
+  org.slf4j
+  slf4j-log4j12
+  test
+
+
+  log4j
+  log4j
+  test
+
+
+  org.apache.servicecomb
+  foundation-test-scaffolding
+
+
+  org.apache.commons
+  commons-lang3
+
+  
+
diff --git 
a/deployment/src/main/java/org/apache/servicecomb/deployment/DefaultDeploymentProvider.java
 
b/deployment/src/main/java/org/apache/servicecomb/deployment/DefaultDeploymentProvider.java
new file mode 100644
index 0..9099735b0
--- /dev/null
+++ 
b/deployment/src/main/java/org/apache/servicecomb/deployment/DefaultDeploymentProvider.java
@@ -0,0 +1,58 @@
+/*
+ * 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.deployment;
+
+import java.util.Arrays;
+
+import org.apache.commons.configuration.AbstractConfiguration;
+import 

[jira] [Updated] (SCB-921) check if swagger compatible to protobuf and choose transport automatically

2018-12-02 Thread wujimin (JIRA)


 [ 
https://issues.apache.org/jira/browse/SCB-921?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

wujimin updated SCB-921:

Description: 
include these rules at least:
 * not support List/List  (try to support)
 * array in deserialize target model (try to support)
 * file upload and download

  was:
include these rules at least:
 * not support List/List
 * array in deserialize target model


> check if swagger compatible to protobuf and choose transport automatically
> --
>
> Key: SCB-921
> URL: https://issues.apache.org/jira/browse/SCB-921
> Project: Apache ServiceComb
>  Issue Type: Task
>  Components: Java-Chassis
>Reporter: wujimin
>Assignee: wujimin
>Priority: Major
> Fix For: java-chassis-1.2.0
>
>
> include these rules at least:
>  * not support List/List  (try to support)
>  * array in deserialize target model (try to support)
>  * file upload and download



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


[jira] [Commented] (SCB-1056) Put provider QPS flow control in front

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


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

ASF GitHub Bot commented on SCB-1056:
-

wujimin commented on a change in pull request #1017: [SCB-1056] put provider 
flow control logic in front
URL: 
https://github.com/apache/servicecomb-java-chassis/pull/1017#discussion_r238167366
 
 

 ##
 File path: 
common/common-rest/src/main/java/org/apache/servicecomb/common/rest/AbstractRestInvocation.java
 ##
 @@ -150,6 +167,39 @@ protected void scheduleInvocation() {
 });
   }
 
+  private Holder checkQpsFlowControl(OperationMeta operationMeta) {
+Holder qpsFlowControlReject = new Holder<>(false);
+Handler providerQpsFlowControlHandler = 
findQpsFlowControlHandler(operationMeta);
+if (null != providerQpsFlowControlHandler) {
+  try {
+providerQpsFlowControlHandler.handle(invocation, response -> {
+  qpsFlowControlReject.value = true;
+  produceProcessor = ProduceProcessorManager.JSON_PROCESSOR;
+  sendResponse(response);
+});
+  } catch (Exception e) {
+LOGGER.error("failed to execute ProviderQpsFlowControlHandler", e);
+qpsFlowControlReject.value = true;
+sendFailResponse(e);
+  }
+}
+return qpsFlowControlReject;
+  }
+
+  @VisibleForTesting
+  Handler findQpsFlowControlHandler(OperationMeta operationMeta) {
 
 Review comment:
   it's not a good idea to find each time.
   we can init and save it in OperationMeta, and mark the new field to be 
temporary, only for internal usage


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


> Put provider QPS flow control in front
> --
>
> Key: SCB-1056
> URL: https://issues.apache.org/jira/browse/SCB-1056
> Project: Apache ServiceComb
>  Issue Type: Improvement
>  Components: Java-Chassis
>Reporter: YaoHaishi
>Assignee: YaoHaishi
>Priority: Major
>
> Currently provider QPS flow control is in ProviderQpsFlowControlHandler which 
> works in provider handler chain. As a result, the flow control logic takes 
> effect too late and much CPU resource is wasted on processing those requests 
> that should be rejected earlier.
> Put the provider QPS flow control logic in front can save the resource.



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


[jira] [Commented] (SCB-1060) edge support Exception converter

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


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

ASF GitHub Bot commented on SCB-1060:
-

coveralls commented on issue #1018: [SCB-1060]edge support Exception converter
URL: 
https://github.com/apache/servicecomb-java-chassis/pull/1018#issuecomment-443616322
 
 
   
   [![Coverage 
Status](https://coveralls.io/builds/20413444/badge)](https://coveralls.io/builds/20413444)
   
   Coverage increased (+0.002%) to 86.746% when pulling 
**a65f10cfd2e6f003f745f4708e836ea0bf991b7c on heyile:edgeException** into 
**2b3626560adfbbc8e3f6d788567d82087bb33cf5 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


> edge support Exception converter 
> -
>
> Key: SCB-1060
> URL: https://issues.apache.org/jira/browse/SCB-1060
> Project: Apache ServiceComb
>  Issue Type: Bug
>Reporter: 何一乐
>Priority: Major
>




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


[jira] [Commented] (SCB-1059) Bug fixes for v1.1.0

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


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

ASF GitHub Bot commented on SCB-1059:
-

codecov-io commented on issue #504: SCB-1059 Support go 1.11.2
URL: 
https://github.com/apache/servicecomb-service-center/pull/504#issuecomment-443613897
 
 
   # 
[Codecov](https://codecov.io/gh/apache/servicecomb-service-center/pull/504?src=pr=h1)
 Report
   > Merging 
[#504](https://codecov.io/gh/apache/servicecomb-service-center/pull/504?src=pr=desc)
 into 
[master](https://codecov.io/gh/apache/servicecomb-service-center/commit/0e8562ed709191f1543a9b232ad5dc73013632a9?src=pr=desc)
 will **increase** coverage by `<.01%`.
   > The diff coverage is `n/a`.
   
   [![Impacted file tree 
graph](https://codecov.io/gh/apache/servicecomb-service-center/pull/504/graphs/tree.svg?width=650=GAaF7zrg8R=150=pr)](https://codecov.io/gh/apache/servicecomb-service-center/pull/504?src=pr=tree)
   
   ```diff
   @@Coverage Diff @@
   ##   master #504  +/-   ##
   ==
   + Coverage   59.34%   59.35%   +<.01% 
   ==
 Files 166  166  
 Lines   1394513945  
   ==
   + Hits 8276 8277   +1 
 Misses   5081 5081  
   + Partials  588  587   -1
   ```
   
   
   | [Impacted 
Files](https://codecov.io/gh/apache/servicecomb-service-center/pull/504?src=pr=tree)
 | Coverage Δ | |
   |---|---|---|
   | 
[server/plugin/pkg/registry/etcd/tracing.go](https://codecov.io/gh/apache/servicecomb-service-center/pull/504/diff?src=pr=tree#diff-c2VydmVyL3BsdWdpbi9wa2cvcmVnaXN0cnkvZXRjZC90cmFjaW5nLmdv)
 | `72.72% <0%> (-9.1%)` | :arrow_down: |
   | 
[pkg/tlsutil/tlsutil.go](https://codecov.io/gh/apache/servicecomb-service-center/pull/504/diff?src=pr=tree#diff-cGtnL3Rsc3V0aWwvdGxzdXRpbC5nbw==)
 | `73.58% <0%> (-0.95%)` | :arrow_down: |
   | 
[server/broker/service.go](https://codecov.io/gh/apache/servicecomb-service-center/pull/504/diff?src=pr=tree#diff-c2VydmVyL2Jyb2tlci9zZXJ2aWNlLmdv)
 | `57.94% <0%> (+0.15%)` | :arrow_up: |
   | 
[server/broker/util.go](https://codecov.io/gh/apache/servicecomb-service-center/pull/504/diff?src=pr=tree#diff-c2VydmVyL2Jyb2tlci91dGlsLmdv)
 | `53.47% <0%> (+0.26%)` | :arrow_up: |
   | 
[server/govern/service.go](https://codecov.io/gh/apache/servicecomb-service-center/pull/504/diff?src=pr=tree#diff-c2VydmVyL2dvdmVybi9zZXJ2aWNlLmdv)
 | `72.93% <0%> (+0.33%)` | :arrow_up: |
   
   --
   
   [Continue to review full report at 
Codecov](https://codecov.io/gh/apache/servicecomb-service-center/pull/504?src=pr=continue).
   > **Legend** - [Click here to learn 
more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute  (impact)`, `ø = not affected`, `? = missing data`
   > Powered by 
[Codecov](https://codecov.io/gh/apache/servicecomb-service-center/pull/504?src=pr=footer).
 Last update 
[0e8562e...4863401](https://codecov.io/gh/apache/servicecomb-service-center/pull/504?src=pr=lastupdated).
 Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   


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


> Bug fixes for v1.1.0
> 
>
> Key: SCB-1059
> URL: https://issues.apache.org/jira/browse/SCB-1059
> Project: Apache ServiceComb
>  Issue Type: Bug
>  Components: Service-Center
>Reporter: little-cui
>Assignee: little-cui
>Priority: Major
> Fix For: service-center-1.2.0
>
>




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


[jira] [Commented] (SCB-1044) add current process CPU rate and net packets in the metrics

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


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

ASF GitHub Bot commented on SCB-1044:
-

heyile commented on a change in pull request #1012: [SCB-1044]add current 
process CPU rate  and net packets in the metrics
URL: 
https://github.com/apache/servicecomb-java-chassis/pull/1012#discussion_r238163272
 
 

 ##
 File path: 
metrics/metrics-core/src/main/java/org/apache/servicecomb/metrics/core/meter/os/CpuMeter.java
 ##
 @@ -18,68 +18,126 @@
 
 import java.io.File;
 import java.io.IOException;
+import java.lang.management.ManagementFactory;
 import java.nio.charset.StandardCharsets;
 import java.util.List;
 
 import org.apache.commons.io.FileUtils;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
+import com.netflix.spectator.api.BasicTag;
 import com.netflix.spectator.api.Id;
 import com.netflix.spectator.api.Measurement;
+import com.netflix.spectator.api.Tag;
 
 public class CpuMeter {
   private static final Logger LOGGER = LoggerFactory.getLogger(CpuMeter.class);
 
+  public static final String STATISTIC = "statistic";
+
+  public static final Tag TAG_All = new BasicTag(STATISTIC, "allProcess");
+
+  public static final Tag TAG_CURRENT = new BasicTag(STATISTIC, 
"currentProcess");
+
   private double rate;
 
+  private double processRate;
+
   private long lastTotalTime;
 
   private long lastIdleTime;
 
+  private long lastProcessTime;
+
   private int cpuNum;
 
-  private Id id;
+  // process id
+  private String pid;
+
+  // allProcess
+  private Id AId;
+
+  // currentProcess
+  private Id CId;
 
   public CpuMeter(Id id) {
-this.id = id;
+this.AId = id.withTag(TAG_All);
+this.CId = id.withTag(TAG_CURRENT);
+
+this.pid = getCurrentPid();
 this.cpuNum = Runtime.getRuntime().availableProcessors();
 refreshCpu();
 rate = 0.0;
+processRate = 0.0;
+  }
+
+  private String getCurrentPid() {
+String name = ManagementFactory.getRuntimeMXBean().getName();
+if (name.contains("@")) {
+  return name.substring(0, name.indexOf("@"));
+}
+LOGGER.warn("Failed to get current process id. {}", name);
 
 Review comment:
   I see


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


> add current process CPU rate  and net packets in the metrics
> 
>
> Key: SCB-1044
> URL: https://issues.apache.org/jira/browse/SCB-1044
> Project: Apache ServiceComb
>  Issue Type: Improvement
>  Components: Java-Chassis
>Reporter: 何一乐
>Assignee: 何一乐
>Priority: Major
>




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


[jira] [Commented] (SCB-1059) Bug fixes for v1.1.0

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


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

ASF GitHub Bot commented on SCB-1059:
-

coveralls edited a comment on issue #504: SCB-1059 Support go 1.11.2
URL: 
https://github.com/apache/servicecomb-service-center/pull/504#issuecomment-443613736
 
 
   
   [![Coverage 
Status](https://coveralls.io/builds/20413330/badge)](https://coveralls.io/builds/20413330)
   
   Coverage increased (+0.03%) to 61.822% when pulling 
**4863401de8c2aefaf64c578c00386366fb9b6c46 on little-cui:docker** into 
**0e8562ed709191f1543a9b232ad5dc73013632a9 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


> Bug fixes for v1.1.0
> 
>
> Key: SCB-1059
> URL: https://issues.apache.org/jira/browse/SCB-1059
> Project: Apache ServiceComb
>  Issue Type: Bug
>  Components: Service-Center
>Reporter: little-cui
>Assignee: little-cui
>Priority: Major
> Fix For: service-center-1.2.0
>
>




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


[jira] [Commented] (SCB-1059) Bug fixes for v1.1.0

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


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

ASF GitHub Bot commented on SCB-1059:
-

coveralls commented on issue #504: SCB-1059 Support go 1.11.2
URL: 
https://github.com/apache/servicecomb-service-center/pull/504#issuecomment-443613736
 
 
   
   [![Coverage 
Status](https://coveralls.io/builds/20413327/badge)](https://coveralls.io/builds/20413327)
   
   Coverage increased (+0.0008%) to 61.79% when pulling 
**4863401de8c2aefaf64c578c00386366fb9b6c46 on little-cui:docker** into 
**0e8562ed709191f1543a9b232ad5dc73013632a9 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


> Bug fixes for v1.1.0
> 
>
> Key: SCB-1059
> URL: https://issues.apache.org/jira/browse/SCB-1059
> Project: Apache ServiceComb
>  Issue Type: Bug
>  Components: Service-Center
>Reporter: little-cui
>Assignee: little-cui
>Priority: Major
> Fix For: service-center-1.2.0
>
>




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


[jira] [Commented] (SCB-1044) add current process CPU rate and net packets in the metrics

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


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

ASF GitHub Bot commented on SCB-1044:
-

heyile commented on a change in pull request #1012: [SCB-1044]add current 
process CPU rate  and net packets in the metrics
URL: 
https://github.com/apache/servicecomb-java-chassis/pull/1012#discussion_r238163106
 
 

 ##
 File path: 
metrics/metrics-core/src/main/java/org/apache/servicecomb/metrics/core/publish/DefaultLogPublisher.java
 ##
 @@ -161,8 +166,14 @@ private void printNetLog(StringBuilder sb, 
MeasurementNode osNode) {
 
   private void printCpuLog(StringBuilder sb, MeasurementNode osNode) {
 MeasurementNode cpuNode = osNode.findChild(OsMeter.OS_TYPE_CPU);
-if (cpuNode != null && !cpuNode.getMeasurements().isEmpty()) {
-  appendLine(sb, "  cpu: %.2f%%", cpuNode.summary() * 100);
+if (cpuNode == null || cpuNode.getMeasurements().isEmpty()) {
+  return;
+}
+double allRate = cpuNode.findChild(CpuMeter.TAG_All.value()).summary();
+double processRate = 
cpuNode.findChild(CpuMeter.TAG_CURRENT.value()).summary();
+if (allRate != 0 || processRate != 0) {
 
 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


> add current process CPU rate  and net packets in the metrics
> 
>
> Key: SCB-1044
> URL: https://issues.apache.org/jira/browse/SCB-1044
> Project: Apache ServiceComb
>  Issue Type: Improvement
>  Components: Java-Chassis
>Reporter: 何一乐
>Assignee: 何一乐
>Priority: Major
>




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


[jira] [Commented] (SCB-1060) edge support Exception converter

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


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

ASF GitHub Bot commented on SCB-1060:
-

heyile opened a new pull request #1018: [SCB-1060]edge support Exception 
converter
URL: https://github.com/apache/servicecomb-java-chassis/pull/1018
 
 
   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).
   
   ---
   


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


> edge support Exception converter 
> -
>
> Key: SCB-1060
> URL: https://issues.apache.org/jira/browse/SCB-1060
> Project: Apache ServiceComb
>  Issue Type: Bug
>Reporter: 何一乐
>Priority: Major
>




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


[jira] [Commented] (SCB-1054) when download file, we should ignore consumer acceptType

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


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

ASF GitHub Bot commented on SCB-1054:
-

wujimin commented on a change in pull request #1016: [SCB-1054]when download 
file, we should ignore consumer acceptType
URL: 
https://github.com/apache/servicecomb-java-chassis/pull/1016#discussion_r238161533
 
 

 ##
 File path: 
common/common-rest/src/main/java/org/apache/servicecomb/common/rest/definition/RestOperationMeta.java
 ##
 @@ -105,6 +111,24 @@ public void init(OperationMeta operationMeta) {
 setAbsolutePath(concatPath(swagger.getBasePath(), 
operationMeta.getOperationPath()));
   }
 
+  private void checkDownloadFile(Operation operation) {
 
 Review comment:
   1.change name to checkDownloadFileFlag
   2.OperationMeta already collect ResponseMetas, just invoke 
org.apache.servicecomb.swagger.invocation.response.ResponsesMeta#findResponseMeta,
 and determined by 
org.apache.servicecomb.swagger.invocation.response.ResponseMeta#javaType


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


> when download file, we should ignore consumer acceptType
> 
>
> Key: SCB-1054
> URL: https://issues.apache.org/jira/browse/SCB-1054
> Project: Apache ServiceComb
>  Issue Type: Bug
>Reporter: 何一乐
>Assignee: 何一乐
>Priority: Critical
>




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


[jira] [Created] (SCB-1060) edge support Exception converter

2018-12-02 Thread JIRA
何一乐 created SCB-1060:


 Summary: edge support Exception converter 
 Key: SCB-1060
 URL: https://issues.apache.org/jira/browse/SCB-1060
 Project: Apache ServiceComb
  Issue Type: Bug
Reporter: 何一乐






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


[jira] [Commented] (SCB-1059) Bug fixes for v1.1.0

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


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

ASF GitHub Bot commented on SCB-1059:
-

little-cui opened a new pull request #504: SCB-1059 Support go 1.11.2
URL: https://github.com/apache/servicecomb-service-center/pull/504
 
 
   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 `go build` `go test` `go fmt` `go vet` 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).
   
   ---
   


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


> Bug fixes for v1.1.0
> 
>
> Key: SCB-1059
> URL: https://issues.apache.org/jira/browse/SCB-1059
> Project: Apache ServiceComb
>  Issue Type: Bug
>  Components: Service-Center
>Reporter: little-cui
>Assignee: little-cui
>Priority: Major
> Fix For: service-center-1.2.0
>
>




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


[jira] [Commented] (SCB-1051) when interface set produces=text/plain;charset=utf-8. and consumers set accept = text/plain,will cause error

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


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

ASF GitHub Bot commented on SCB-1051:
-

wujimin commented on a change in pull request #1015: [SCB-1051]when interface 
set produces=text/plain;charset=utf-8. and c…
URL: 
https://github.com/apache/servicecomb-java-chassis/pull/1015#discussion_r238158735
 
 

 ##
 File path: 
integration-tests/it-consumer/src/main/java/org/apache/servicecomb/it/testcase/TestAcceptType.java
 ##
 @@ -0,0 +1,110 @@
+/*
+ * 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.it.testcase;
+
+import org.apache.servicecomb.it.Consumers;
+import org.apache.servicecomb.swagger.invocation.exception.InvocationException;
+import org.junit.Assert;
+import org.junit.Test;
+import org.springframework.http.HttpEntity;
+import org.springframework.http.HttpHeaders;
+import org.springframework.http.HttpMethod;
+import org.springframework.http.MediaType;
+import org.springframework.http.ResponseEntity;
+
+public class TestAcceptType {
+  interface AcceptTypeIntf {
+  }
+
+  private static Consumers consumersAcceptTypeSpringmvc = new 
Consumers<>("acceptTypeSpringmvcSchema",
+  AcceptTypeIntf.class);
+
+  private static Consumers consumersAcceptTypeJaxrs = new 
Consumers<>("acceptTypeJaxrsSchema",
+  AcceptTypeIntf.class);
+
+
+  @Test
+  public void testTextPlain_rt() {
+checkTextPlain(consumersAcceptTypeSpringmvc);
+checkTextPlain(consumersAcceptTypeJaxrs);
+  }
+
+  private void checkTextPlain(Consumers consumers) {
+String result = textHeader_rt(consumers, MediaType.TEXT_PLAIN_VALUE);
+Assert.assertEquals("cse", result);
+
+try {
+  textHeader_rt(consumers, MediaType.APPLICATION_JSON_VALUE);
+  Assert.fail("should throw exception");
+} catch (InvocationException e) {
+  Assert.assertEquals(406, e.getStatusCode());
+  Assert.assertTrue(e.getMessage().contains("Accept application/json is 
not supported"));
+} catch (Exception e) {
 
 Review comment:
   change Exception to Throwable 
   and delete below useless empty lines.


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


> when interface set produces=text/plain;charset=utf-8. and consumers set 
> accept = text/plain,will cause error
> 
>
> Key: SCB-1051
> URL: https://issues.apache.org/jira/browse/SCB-1051
> Project: Apache ServiceComb
>  Issue Type: Improvement
>  Components: Java-Chassis
>Reporter: 何一乐
>Assignee: 何一乐
>Priority: Major
> Attachments: screenshot-1.png
>
>




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


[jira] [Updated] (SCB-921) check if swagger compatible to protobuf and choose transport automatically

2018-12-02 Thread Willem Jiang (JIRA)


 [ 
https://issues.apache.org/jira/browse/SCB-921?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Willem Jiang updated SCB-921:
-
Fix Version/s: (was: java-chassis-1.1.0)
   java-chassis-1.2.0

> check if swagger compatible to protobuf and choose transport automatically
> --
>
> Key: SCB-921
> URL: https://issues.apache.org/jira/browse/SCB-921
> Project: Apache ServiceComb
>  Issue Type: Task
>  Components: Java-Chassis
>Reporter: wujimin
>Assignee: wujimin
>Priority: Major
> Fix For: java-chassis-1.2.0
>
>
> include these rules at least:
>  * not support List/List
>  * array in deserialize target model



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


[jira] [Commented] (SCB-1044) add current process CPU rate and net packets in the metrics

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


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

ASF GitHub Bot commented on SCB-1044:
-

wujimin commented on a change in pull request #1012: [SCB-1044]add current 
process CPU rate  and net packets in the metrics
URL: 
https://github.com/apache/servicecomb-java-chassis/pull/1012#discussion_r238156023
 
 

 ##
 File path: 
metrics/metrics-core/src/main/java/org/apache/servicecomb/metrics/core/publish/DefaultLogPublisher.java
 ##
 @@ -161,8 +166,14 @@ private void printNetLog(StringBuilder sb, 
MeasurementNode osNode) {
 
   private void printCpuLog(StringBuilder sb, MeasurementNode osNode) {
 MeasurementNode cpuNode = osNode.findChild(OsMeter.OS_TYPE_CPU);
-if (cpuNode != null && !cpuNode.getMeasurements().isEmpty()) {
-  appendLine(sb, "  cpu: %.2f%%", cpuNode.summary() * 100);
+if (cpuNode == null || cpuNode.getMeasurements().isEmpty()) {
+  return;
+}
+double allRate = cpuNode.findChild(CpuMeter.TAG_All.value()).summary();
+double processRate = 
cpuNode.findChild(CpuMeter.TAG_CURRENT.value()).summary();
+if (allRate != 0 || processRate != 0) {
 
 Review comment:
   always print cpu usage.


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


> add current process CPU rate  and net packets in the metrics
> 
>
> Key: SCB-1044
> URL: https://issues.apache.org/jira/browse/SCB-1044
> Project: Apache ServiceComb
>  Issue Type: Improvement
>  Components: Java-Chassis
>Reporter: 何一乐
>Assignee: 何一乐
>Priority: Major
>




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


[jira] [Commented] (SCB-1047) microservice.yaml service_description.version support format xxx.xx.xxx.xxx

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


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

ASF GitHub Bot commented on SCB-1047:
-

wujimin commented on a change in pull request #1013: 
[SCB-1047]microservice.yaml  service_description.version support form…
URL: 
https://github.com/apache/servicecomb-java-chassis/pull/1013#discussion_r238156830
 
 

 ##
 File path: 
service-registry/src/main/java/org/apache/servicecomb/serviceregistry/version/VersionRuleUtils.java
 ##
 @@ -54,7 +54,17 @@ public static VersionRule create(String strVersionRule) {
 return versionRule;
   }
 }
+throw new IllegalStateException("config service_description.version is 
invalid ");
+  }
 
-throw new IllegalStateException("never run to here");
+  public static void checkVersionFormat(String strVersionRule) {
+strVersionRule = strVersionRule.trim();
 
 Review comment:
   named check version, but checking versionRule?


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


> microservice.yaml  service_description.version support format xxx.xx.xxx.xxx
> 
>
> Key: SCB-1047
> URL: https://issues.apache.org/jira/browse/SCB-1047
> Project: Apache ServiceComb
>  Issue Type: Improvement
>  Components: Java-Chassis
>Reporter: 何一乐
>Assignee: 何一乐
>Priority: Major
>




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


[jira] [Commented] (SCB-1047) microservice.yaml service_description.version support format xxx.xx.xxx.xxx

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


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

ASF GitHub Bot commented on SCB-1047:
-

wujimin commented on a change in pull request #1013: 
[SCB-1047]microservice.yaml  service_description.version support form…
URL: 
https://github.com/apache/servicecomb-java-chassis/pull/1013#discussion_r238156749
 
 

 ##
 File path: 
service-registry/src/main/java/org/apache/servicecomb/serviceregistry/api/registry/MicroserviceFactory.java
 ##
 @@ -53,8 +54,11 @@ private Microservice 
createMicroserviceFromDefinition(Configuration configuratio
 
microservice.setServiceName(configuration.getString(CONFIG_QUALIFIED_MICROSERVICE_NAME_KEY,
 DEFAULT_MICROSERVICE_NAME));
 microservice.setAppId(configuration.getString(CONFIG_APPLICATION_ID_KEY, 
DEFAULT_APPLICATION_ID));
-
microservice.setVersion(configuration.getString(CONFIG_QUALIFIED_MICROSERVICE_VERSION_KEY,
-DEFAULT_MICROSERVICE_VERSION));
+String version = 
configuration.getString(CONFIG_QUALIFIED_MICROSERVICE_VERSION_KEY,
+DEFAULT_MICROSERVICE_VERSION);
+//check version format
+VersionRuleUtils.checkVersionFormat(version);
 
 Review comment:
   versionRule to check version?


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


> microservice.yaml  service_description.version support format xxx.xx.xxx.xxx
> 
>
> Key: SCB-1047
> URL: https://issues.apache.org/jira/browse/SCB-1047
> Project: Apache ServiceComb
>  Issue Type: Improvement
>  Components: Java-Chassis
>Reporter: 何一乐
>Assignee: 何一乐
>Priority: Major
>




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


[jira] [Commented] (SCB-1047) microservice.yaml service_description.version support format xxx.xx.xxx.xxx

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


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

ASF GitHub Bot commented on SCB-1047:
-

wujimin commented on a change in pull request #1013: 
[SCB-1047]microservice.yaml  service_description.version support form…
URL: 
https://github.com/apache/servicecomb-java-chassis/pull/1013#discussion_r238156487
 
 

 ##
 File path: 
service-registry/src/main/java/org/apache/servicecomb/serviceregistry/version/Version.java
 ##
 @@ -23,35 +23,44 @@
 
 // short version is enough
 public class Version implements Comparable {
-  private static final String[] ZERO = new String[] {"0", "0", "0"};
+  private static final String[] ZERO = new String[] {"0", "0", "0", "0"};
 
   private final short major;
 
   private final short minor;
 
   private final short patch;
 
+  private final short build;
+
+  private final boolean versionFour;
 
 Review comment:
   why need a flag versionFour?


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


> microservice.yaml  service_description.version support format xxx.xx.xxx.xxx
> 
>
> Key: SCB-1047
> URL: https://issues.apache.org/jira/browse/SCB-1047
> Project: Apache ServiceComb
>  Issue Type: Improvement
>  Components: Java-Chassis
>Reporter: 何一乐
>Assignee: 何一乐
>Priority: Major
>




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


[jira] [Created] (SCB-1059) Bug fixes for v1.1.0

2018-12-02 Thread little-cui (JIRA)
little-cui created SCB-1059:
---

 Summary: Bug fixes for v1.1.0
 Key: SCB-1059
 URL: https://issues.apache.org/jira/browse/SCB-1059
 Project: Apache ServiceComb
  Issue Type: Bug
  Components: Service-Center
Reporter: little-cui
Assignee: little-cui
 Fix For: service-center-1.2.0






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


[jira] [Commented] (SCB-1044) add current process CPU rate and net packets in the metrics

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


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

ASF GitHub Bot commented on SCB-1044:
-

wujimin commented on a change in pull request #1012: [SCB-1044]add current 
process CPU rate  and net packets in the metrics
URL: 
https://github.com/apache/servicecomb-java-chassis/pull/1012#discussion_r238155871
 
 

 ##
 File path: 
metrics/metrics-core/src/main/java/org/apache/servicecomb/metrics/core/meter/os/NetMeter.java
 ##
 @@ -56,32 +60,55 @@
 
 private Id receiveId;
 
+private Id sendPacketId;
 
 Review comment:
   same to cpu
   logic of send and receive is same, except value of id/read from index is 
different, extract to one class,and InterfaceInfo  have 2 field of it.


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


> add current process CPU rate  and net packets in the metrics
> 
>
> Key: SCB-1044
> URL: https://issues.apache.org/jira/browse/SCB-1044
> Project: Apache ServiceComb
>  Issue Type: Improvement
>  Components: Java-Chassis
>Reporter: 何一乐
>Assignee: 何一乐
>Priority: Major
>




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


[jira] [Commented] (SCB-1049) Alarm center

2018-12-02 Thread Willem Jiang (JIRA)


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

Willem Jiang commented on SCB-1049:
---

[~little-cui]  It's really hard for us to understand the whole story from two 
words.
Could you describe the purpose and the design of the Alarm center in this JIRA?
 

> Alarm center
> 
>
> Key: SCB-1049
> URL: https://issues.apache.org/jira/browse/SCB-1049
> Project: Apache ServiceComb
>  Issue Type: New Feature
>  Components: Service-Center
>Reporter: little-cui
>Assignee: little-cui
>Priority: Major
> Fix For: service-center-1.2.0
>
>




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


[jira] [Commented] (SCB-1044) add current process CPU rate and net packets in the metrics

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


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

ASF GitHub Bot commented on SCB-1044:
-

wujimin commented on a change in pull request #1012: [SCB-1044]add current 
process CPU rate  and net packets in the metrics
URL: 
https://github.com/apache/servicecomb-java-chassis/pull/1012#discussion_r238155430
 
 

 ##
 File path: 
metrics/metrics-core/src/main/java/org/apache/servicecomb/metrics/core/publish/ClientEndpointsLogPublisher.java
 ##
 @@ -32,7 +32,7 @@ public ClientEndpointsLogPublisher(MeasurementTree tree, 
StringBuilder sb, Strin
   @Override
   public void print(boolean printDetail) {
 appendLine(sb, "client.endpoints:");
-appendLine(sb, "  remoteconnectCount
disconnectCount connections send receive");
+appendLine(sb, "  remoteconnectCount
disconnectCount connections send(B)  receive(B)");
 
 Review comment:
   Bps?


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


> add current process CPU rate  and net packets in the metrics
> 
>
> Key: SCB-1044
> URL: https://issues.apache.org/jira/browse/SCB-1044
> Project: Apache ServiceComb
>  Issue Type: Improvement
>  Components: Java-Chassis
>Reporter: 何一乐
>Assignee: 何一乐
>Priority: Major
>




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


[jira] [Commented] (SCB-1044) add current process CPU rate and net packets in the metrics

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


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

ASF GitHub Bot commented on SCB-1044:
-

wujimin commented on a change in pull request #1012: [SCB-1044]add current 
process CPU rate  and net packets in the metrics
URL: 
https://github.com/apache/servicecomb-java-chassis/pull/1012#discussion_r238155081
 
 

 ##
 File path: 
metrics/metrics-core/src/main/java/org/apache/servicecomb/metrics/core/meter/os/CpuMeter.java
 ##
 @@ -18,68 +18,126 @@
 
 import java.io.File;
 import java.io.IOException;
+import java.lang.management.ManagementFactory;
 import java.nio.charset.StandardCharsets;
 import java.util.List;
 
 import org.apache.commons.io.FileUtils;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
+import com.netflix.spectator.api.BasicTag;
 import com.netflix.spectator.api.Id;
 import com.netflix.spectator.api.Measurement;
+import com.netflix.spectator.api.Tag;
 
 public class CpuMeter {
 
 Review comment:
   seems everything is duplicated for os and process cpu, except one source 
data is /proc/stat, another is /proc/{pid}/stat
   extract it and new 2 instance,


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


> add current process CPU rate  and net packets in the metrics
> 
>
> Key: SCB-1044
> URL: https://issues.apache.org/jira/browse/SCB-1044
> Project: Apache ServiceComb
>  Issue Type: Improvement
>  Components: Java-Chassis
>Reporter: 何一乐
>Assignee: 何一乐
>Priority: Major
>




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


[jira] [Commented] (SCB-968) [SCB-968]968 http2 do not support pump download

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


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

ASF GitHub Bot commented on SCB-968:


wujimin closed pull request #1001: [SCB-968]968 http2 do not support pump 
download
URL: https://github.com/apache/servicecomb-java-chassis/pull/1001
 
 
   

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

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

diff --git a/LICENSE b/LICENSE
index c75dbb5b5..48c8a8e59 100644
--- a/LICENSE
+++ b/LICENSE
@@ -216,6 +216,11 @@ 
transports/transport-rest/transport-rest-vertx/src/main/java/org/apache/servicec
 This product bundles files from vertx which is licensed under the Apache 
License v2.
 For details, see https://github.com/vert-x3/vertx-web
 
+
+For  
foundations/foundation-vertx/src/main/java/org/apache/servicecomb/foundation/vertx/stream/PumpImplEx.java
+
+This product bundles files from vertx which is licensed under the Apache 
License v2.
+For details, see https://github.com/eclipse-vertx/vert.x
 
 
 For 
swagger/swagger-generator/generator-core/src/main/java/org/apache/servicecomb/swagger/extend/property/AbstractBaseIntegerProperty.java
diff --git 
a/foundations/foundation-vertx/src/main/java/org/apache/servicecomb/foundation/vertx/stream/PumpCommon.java
 
b/foundations/foundation-vertx/src/main/java/org/apache/servicecomb/foundation/vertx/stream/PumpCommon.java
index 77334b9c9..090882ab1 100644
--- 
a/foundations/foundation-vertx/src/main/java/org/apache/servicecomb/foundation/vertx/stream/PumpCommon.java
+++ 
b/foundations/foundation-vertx/src/main/java/org/apache/servicecomb/foundation/vertx/stream/PumpCommon.java
@@ -23,7 +23,6 @@
 import io.vertx.core.Context;
 import io.vertx.core.buffer.Buffer;
 import io.vertx.core.http.HttpClientResponse;
-import io.vertx.core.streams.Pump;
 import io.vertx.core.streams.ReadStream;
 import io.vertx.core.streams.WriteStream;
 
@@ -64,7 +63,7 @@
 // belongs to difference eventloop
 // maybe will cause deadlock
 // if happened, vertx will print deadlock stacks
-Pump.pump(readStream, writeStream).start();
+PumpImplEx.getPumpImplEx(readStream, writeStream).start();
 try {
   context.runOnContext(v -> readStream.resume());
 } catch (Throwable e) {
diff --git 
a/foundations/foundation-vertx/src/main/java/org/apache/servicecomb/foundation/vertx/stream/PumpImplEx.java
 
b/foundations/foundation-vertx/src/main/java/org/apache/servicecomb/foundation/vertx/stream/PumpImplEx.java
new file mode 100644
index 0..e8356298f
--- /dev/null
+++ 
b/foundations/foundation-vertx/src/main/java/org/apache/servicecomb/foundation/vertx/stream/PumpImplEx.java
@@ -0,0 +1,104 @@
+/*
+ * Copyright (c) 2014 Red Hat, Inc. and others
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License 2.0 which is available at
+ * http://www.eclipse.org/legal/epl-2.0, or the Apache License, Version 2.0
+ * which is available at https://www.apache.org/licenses/LICENSE-2.0.
+ *
+ * SPDX-License-Identifier: EPL-2.0 OR Apache-2.0
+ */
+
+/*
+ *  Froked from 
https://github.com/eclipse-vertx/vert.x/blob/master/src/main/java/io/vertx/core/streams/impl/PumpImpl.java
+ *
+ */
+package org.apache.servicecomb.foundation.vertx.stream;
+
+import io.vertx.core.Handler;
+import io.vertx.core.buffer.Buffer;
+import io.vertx.core.streams.Pump;
+import io.vertx.core.streams.ReadStream;
+import io.vertx.core.streams.WriteStream;
+
+public class PumpImplEx implements Pump {
+
+  private final ReadStream readStream;
+
+  private final WriteStream writeStream;
+
+  private final Handler dataHandler;
+
+  private final Handler drainHandler;
+
+  private int pumped;
+
+  public PumpImplEx(ReadStream readStream, WriteStream writeStream, int 
maxWriteQueueSize) {
+this(readStream, writeStream);
+this.writeStream.setWriteQueueMaxSize(maxWriteQueueSize);
+  }
+
+  public PumpImplEx(ReadStream readStream, WriteStream writeStream) {
+this.readStream = readStream;
+this.writeStream = writeStream;
+drainHandler = v -> readStream.resume();
+dataHandler = data -> {
+  if (data instanceof Buffer) {
+if (((Buffer) data).length() == 0) {
+  return;
+}
+  }
+  writeStream.write(data);
+  incPumped();
+  if (writeStream.writeQueueFull()) {
+readStream.pause();
+writeStream.drainHandler(drainHandler);
+  }
+};
+  }
+
+
+  @Override
+  public PumpImplEx setWriteQueueMaxSize(int maxSize) {
+

[jira] [Commented] (SCB-1049) Alarm center

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


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

ASF GitHub Bot commented on SCB-1049:
-

codecov-io commented on issue #503: WIP: SCB-1049 Alarm center
URL: 
https://github.com/apache/servicecomb-service-center/pull/503#issuecomment-443584904
 
 
   # 
[Codecov](https://codecov.io/gh/apache/servicecomb-service-center/pull/503?src=pr=h1)
 Report
   > Merging 
[#503](https://codecov.io/gh/apache/servicecomb-service-center/pull/503?src=pr=desc)
 into 
[master](https://codecov.io/gh/apache/servicecomb-service-center/commit/0e8562ed709191f1543a9b232ad5dc73013632a9?src=pr=desc)
 will **decrease** coverage by `0.11%`.
   > The diff coverage is `70.55%`.
   
   [![Impacted file tree 
graph](https://codecov.io/gh/apache/servicecomb-service-center/pull/503/graphs/tree.svg?width=650=GAaF7zrg8R=150=pr)](https://codecov.io/gh/apache/servicecomb-service-center/pull/503?src=pr=tree)
   
   ```diff
   @@Coverage Diff @@
   ##   master #503  +/-   ##
   ==
   - Coverage   59.34%   59.23%   -0.12% 
   ==
 Files 166  167   +1 
 Lines   1394513991  +46 
   ==
   + Hits 8276 8287  +11 
   - Misses   5081 5121  +40 
   + Partials  588  583   -5
   ```
   
   
   | [Impacted 
Files](https://codecov.io/gh/apache/servicecomb-service-center/pull/503?src=pr=tree)
 | Coverage Δ | |
   |---|---|---|
   | 
[server/notify/publisher.go](https://codecov.io/gh/apache/servicecomb-service-center/pull/503/diff?src=pr=tree#diff-c2VydmVyL25vdGlmeS9wdWJsaXNoZXIuZ28=)
 | `95.65% <ø> (ø)` | |
   | 
[server/service/event/rule\_event\_handler.go](https://codecov.io/gh/apache/servicecomb-service-center/pull/503/diff?src=pr=tree#diff-c2VydmVyL3NlcnZpY2UvZXZlbnQvcnVsZV9ldmVudF9oYW5kbGVyLmdv)
 | `8.33% <0%> (ø)` | :arrow_up: |
   | 
[server/service/event/instance\_event\_handler.go](https://codecov.io/gh/apache/servicecomb-service-center/pull/503/diff?src=pr=tree#diff-c2VydmVyL3NlcnZpY2UvZXZlbnQvaW5zdGFuY2VfZXZlbnRfaGFuZGxlci5nbw==)
 | `7.54% <0%> (ø)` | :arrow_up: |
   | 
[server/service/event/tag\_event\_handler.go](https://codecov.io/gh/apache/servicecomb-service-center/pull/503/diff?src=pr=tree#diff-c2VydmVyL3NlcnZpY2UvZXZlbnQvdGFnX2V2ZW50X2hhbmRsZXIuZ28=)
 | `7.14% <0%> (ø)` | :arrow_up: |
   | 
[server/core/config.go](https://codecov.io/gh/apache/servicecomb-service-center/pull/503/diff?src=pr=tree#diff-c2VydmVyL2NvcmUvY29uZmlnLmdv)
 | `0% <0%> (ø)` | :arrow_up: |
   | 
[server/admin/controller\_v4.go](https://codecov.io/gh/apache/servicecomb-service-center/pull/503/diff?src=pr=tree#diff-c2VydmVyL2FkbWluL2NvbnRyb2xsZXJfdjQuZ28=)
 | `16.21% <10%> (-6.01%)` | :arrow_down: |
   | 
[pkg/util/json.go](https://codecov.io/gh/apache/servicecomb-service-center/pull/503/diff?src=pr=tree#diff-cGtnL3V0aWwvanNvbi5nbw==)
 | `100% <100%> (ø)` | |
   | 
[pkg/notify/subject.go](https://codecov.io/gh/apache/servicecomb-service-center/pull/503/diff?src=pr=tree#diff-cGtnL25vdGlmeS9zdWJqZWN0Lmdv)
 | `100% <100%> (ø)` | |
   | 
[pkg/notify/group.go](https://codecov.io/gh/apache/servicecomb-service-center/pull/503/diff?src=pr=tree#diff-cGtnL25vdGlmeS9ncm91cC5nbw==)
 | `100% <100%> (ø)` | |
   | 
[pkg/notify/notification\_healthchecker.go](https://codecov.io/gh/apache/servicecomb-service-center/pull/503/diff?src=pr=tree#diff-cGtnL25vdGlmeS9ub3RpZmljYXRpb25faGVhbHRoY2hlY2tlci5nbw==)
 | `100% <100%> (ø)` | |
   | ... and [16 
more](https://codecov.io/gh/apache/servicecomb-service-center/pull/503/diff?src=pr=tree-more)
 | |
   
   --
   
   [Continue to review full report at 
Codecov](https://codecov.io/gh/apache/servicecomb-service-center/pull/503?src=pr=continue).
   > **Legend** - [Click here to learn 
more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute  (impact)`, `ø = not affected`, `? = missing data`
   > Powered by 
[Codecov](https://codecov.io/gh/apache/servicecomb-service-center/pull/503?src=pr=footer).
 Last update 
[0e8562e...6ba2c94](https://codecov.io/gh/apache/servicecomb-service-center/pull/503?src=pr=lastupdated).
 Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   


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


> Alarm center
> 
>
> Key: SCB-1049
> URL: https://issues.apache.org/jira/browse/SCB-1049
> Project: Apache ServiceComb
>  Issue Type: New Feature
>  Components: 

[jira] [Commented] (SCB-1049) Alarm center

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


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

ASF GitHub Bot commented on SCB-1049:
-

coveralls commented on issue #503: WIP: SCB-1049 Alarm center
URL: 
https://github.com/apache/servicecomb-service-center/pull/503#issuecomment-443585336
 
 
   
   [![Coverage 
Status](https://coveralls.io/builds/20411759/badge)](https://coveralls.io/builds/20411759)
   
   Coverage decreased (-0.2%) to 61.599% when pulling 
**6ba2c94c0506e3291dca1acf15102c4600dc6d1d on little-cui:alarm** into 
**0e8562ed709191f1543a9b232ad5dc73013632a9 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


> Alarm center
> 
>
> Key: SCB-1049
> URL: https://issues.apache.org/jira/browse/SCB-1049
> Project: Apache ServiceComb
>  Issue Type: New Feature
>  Components: Service-Center
>Reporter: little-cui
>Assignee: little-cui
>Priority: Major
> Fix For: service-center-1.2.0
>
>




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


[jira] [Commented] (SCB-1049) Alarm center

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


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

ASF GitHub Bot commented on SCB-1049:
-

little-cui opened a new pull request #503: WIP: SCB-1049 Alarm center
URL: https://github.com/apache/servicecomb-service-center/pull/503
 
 
   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 `go build` `go test` `go fmt` `go vet` 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).
   
   ---
   
   ### Alarm Center
   Used to collect SC local alarm information, provide API query and clear 
alarm information.
   
   Scenario: Requirements for monitoring alarm reporting
   
   List the alarms
   ```bash
   curl -X GET \
 http://127.0.0.1:30100/v4/default/admin/alarms \
 -H 'x-domain-name: default'
   ```
   Response:
   ```json
   {
   "alarms": [
   {
   "status": "ACTIVATED",
   "id": "InternalError",
   "fields": {
   "detail": "context canceled"
   }
   }
   ]
   }
   ```
   Clear all alarms
   ```bash
   curl -X DELETE \
 http://127.0.0.1:30100/v4/default/admin/alarms \
 -H 'x-domain-name: default'
   ```
   
   


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


> Alarm center
> 
>
> Key: SCB-1049
> URL: https://issues.apache.org/jira/browse/SCB-1049
> Project: Apache ServiceComb
>  Issue Type: New Feature
>  Components: Service-Center
>Reporter: little-cui
>Assignee: little-cui
>Priority: Major
> Fix For: service-center-1.2.0
>
>




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


[jira] [Commented] (SCB-1056) Put provider QPS flow control in front

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


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

ASF GitHub Bot commented on SCB-1056:
-

liubao68 commented on issue #1017: [SCB-1056] put provider flow control logic 
in front
URL: 
https://github.com/apache/servicecomb-java-chassis/pull/1017#issuecomment-443582182
 
 
   Can you create a new issue to tracing the improvement?


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


> Put provider QPS flow control in front
> --
>
> Key: SCB-1056
> URL: https://issues.apache.org/jira/browse/SCB-1056
> Project: Apache ServiceComb
>  Issue Type: Improvement
>  Components: Java-Chassis
>Reporter: YaoHaishi
>Assignee: YaoHaishi
>Priority: Major
>
> Currently provider QPS flow control is in ProviderQpsFlowControlHandler which 
> works in provider handler chain. As a result, the flow control logic takes 
> effect too late and much CPU resource is wasted on processing those requests 
> that should be rejected earlier.
> Put the provider QPS flow control logic in front can save the resource.



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


[jira] [Resolved] (SCB-1053) Batch microservices instances discovery API

2018-12-02 Thread little-cui (JIRA)


 [ 
https://issues.apache.org/jira/browse/SCB-1053?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

little-cui resolved SCB-1053.
-
Resolution: Fixed

> Batch microservices instances discovery API
> ---
>
> Key: SCB-1053
> URL: https://issues.apache.org/jira/browse/SCB-1053
> Project: Apache ServiceComb
>  Issue Type: Improvement
>  Components: Service-Center
>Reporter: little-cui
>Assignee: little-cui
>Priority: Major
> Fix For: service-center-1.2.0
>
>




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


[jira] [Commented] (SCB-1056) Put provider QPS flow control in front

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


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

ASF GitHub Bot commented on SCB-1056:
-

yhs0092 commented on issue #1017: [SCB-1056] put provider flow control logic in 
front
URL: 
https://github.com/apache/servicecomb-java-chassis/pull/1017#issuecomment-443566378
 
 
   @liubao68  As wujimin says, a new handler mechanism should be designed to 
replace the current handler and filter mechanism. So I think there may be no 
need to change too much on current code.


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


> Put provider QPS flow control in front
> --
>
> Key: SCB-1056
> URL: https://issues.apache.org/jira/browse/SCB-1056
> Project: Apache ServiceComb
>  Issue Type: Improvement
>  Components: Java-Chassis
>Reporter: YaoHaishi
>Assignee: YaoHaishi
>Priority: Major
>
> Currently provider QPS flow control is in ProviderQpsFlowControlHandler which 
> works in provider handler chain. As a result, the flow control logic takes 
> effect too late and much CPU resource is wasted on processing those requests 
> that should be rejected earlier.
> Put the provider QPS flow control logic in front can save the resource.



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


[jira] [Commented] (SCB-1044) add current process CPU rate and net packets in the metrics

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


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

ASF GitHub Bot commented on SCB-1044:
-

liubao68 commented on a change in pull request #1012: [SCB-1044]add current 
process CPU rate  and net packets in the metrics
URL: 
https://github.com/apache/servicecomb-java-chassis/pull/1012#discussion_r238126996
 
 

 ##
 File path: 
metrics/metrics-core/src/main/java/org/apache/servicecomb/metrics/core/meter/os/CpuMeter.java
 ##
 @@ -18,68 +18,126 @@
 
 import java.io.File;
 import java.io.IOException;
+import java.lang.management.ManagementFactory;
 import java.nio.charset.StandardCharsets;
 import java.util.List;
 
 import org.apache.commons.io.FileUtils;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
+import com.netflix.spectator.api.BasicTag;
 import com.netflix.spectator.api.Id;
 import com.netflix.spectator.api.Measurement;
+import com.netflix.spectator.api.Tag;
 
 public class CpuMeter {
   private static final Logger LOGGER = LoggerFactory.getLogger(CpuMeter.class);
 
+  public static final String STATISTIC = "statistic";
+
+  public static final Tag TAG_All = new BasicTag(STATISTIC, "allProcess");
+
+  public static final Tag TAG_CURRENT = new BasicTag(STATISTIC, 
"currentProcess");
+
   private double rate;
 
+  private double processRate;
+
   private long lastTotalTime;
 
   private long lastIdleTime;
 
+  private long lastProcessTime;
+
   private int cpuNum;
 
-  private Id id;
+  // process id
+  private String pid;
+
+  // allProcess
+  private Id AId;
+
+  // currentProcess
+  private Id CId;
 
   public CpuMeter(Id id) {
-this.id = id;
+this.AId = id.withTag(TAG_All);
+this.CId = id.withTag(TAG_CURRENT);
+
+this.pid = getCurrentPid();
 this.cpuNum = Runtime.getRuntime().availableProcessors();
 refreshCpu();
 rate = 0.0;
+processRate = 0.0;
+  }
+
+  private String getCurrentPid() {
+String name = ManagementFactory.getRuntimeMXBean().getName();
+if (name.contains("@")) {
+  return name.substring(0, name.indexOf("@"));
+}
+LOGGER.warn("Failed to get current process id. {}", name);
 
 Review comment:
   If it is impossible, you can throw an IllegalStateException here. 


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


> add current process CPU rate  and net packets in the metrics
> 
>
> Key: SCB-1044
> URL: https://issues.apache.org/jira/browse/SCB-1044
> Project: Apache ServiceComb
>  Issue Type: Improvement
>  Components: Java-Chassis
>Reporter: 何一乐
>Assignee: 何一乐
>Priority: Major
>




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


[jira] [Commented] (SCB-1044) add current process CPU rate and net packets in the metrics

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


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

ASF GitHub Bot commented on SCB-1044:
-

heyile commented on a change in pull request #1012: [SCB-1044]add current 
process CPU rate  and net packets in the metrics
URL: 
https://github.com/apache/servicecomb-java-chassis/pull/1012#discussion_r237763091
 
 

 ##
 File path: 
metrics/metrics-core/src/main/java/org/apache/servicecomb/metrics/core/meter/os/CpuMeter.java
 ##
 @@ -18,68 +18,126 @@
 
 import java.io.File;
 import java.io.IOException;
+import java.lang.management.ManagementFactory;
 import java.nio.charset.StandardCharsets;
 import java.util.List;
 
 import org.apache.commons.io.FileUtils;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
+import com.netflix.spectator.api.BasicTag;
 import com.netflix.spectator.api.Id;
 import com.netflix.spectator.api.Measurement;
+import com.netflix.spectator.api.Tag;
 
 public class CpuMeter {
   private static final Logger LOGGER = LoggerFactory.getLogger(CpuMeter.class);
 
+  public static final String STATISTIC = "statistic";
+
+  public static final Tag TAG_All = new BasicTag(STATISTIC, "allProcess");
+
+  public static final Tag TAG_CURRENT = new BasicTag(STATISTIC, 
"currentProcess");
+
   private double rate;
 
+  private double processRate;
+
   private long lastTotalTime;
 
   private long lastIdleTime;
 
+  private long lastProcessTime;
+
   private int cpuNum;
 
-  private Id id;
+  // process id
+  private String pid;
+
+  // allProcess
+  private Id AId;
+
+  // currentProcess
+  private Id CId;
 
   public CpuMeter(Id id) {
-this.id = id;
+this.AId = id.withTag(TAG_All);
+this.CId = id.withTag(TAG_CURRENT);
+
+this.pid = getCurrentPid();
 this.cpuNum = Runtime.getRuntime().availableProcessors();
 refreshCpu();
 rate = 0.0;
+processRate = 0.0;
+  }
+
+  private String getCurrentPid() {
+String name = ManagementFactory.getRuntimeMXBean().getName();
+if (name.contains("@")) {
+  return name.substring(0, name.indexOf("@"));
+}
+LOGGER.warn("Failed to get current process id. {}", name);
 
 Review comment:
   do not know when will pid is null. It's impossible that the pid is null.


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


> add current process CPU rate  and net packets in the metrics
> 
>
> Key: SCB-1044
> URL: https://issues.apache.org/jira/browse/SCB-1044
> Project: Apache ServiceComb
>  Issue Type: Improvement
>  Components: Java-Chassis
>Reporter: 何一乐
>Assignee: 何一乐
>Priority: Major
>




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


[jira] [Commented] (SCB-1053) Batch microservices instances discovery API

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


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

ASF GitHub Bot commented on SCB-1053:
-

coveralls edited a comment on issue #502: SCB-1053 Batch microservices 
instances discovery API 
URL: 
https://github.com/apache/servicecomb-service-center/pull/502#issuecomment-442483399
 
 
   
   [![Coverage 
Status](https://coveralls.io/builds/20406998/badge)](https://coveralls.io/builds/20406998)
   
   Coverage increased (+0.1%) to 61.833% when pulling 
**cf2141030db257ee38df93e3724982e65f35971a on little-cui:find** into 
**6285f2bb9cb4b6ad7195dfaf931bfb0ba89561de 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


> Batch microservices instances discovery API
> ---
>
> Key: SCB-1053
> URL: https://issues.apache.org/jira/browse/SCB-1053
> Project: Apache ServiceComb
>  Issue Type: Improvement
>  Components: Service-Center
>Reporter: little-cui
>Assignee: little-cui
>Priority: Major
> Fix For: service-center-1.2.0
>
>




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