From dev-return-2300-archive-asf-public=cust-asf.ponee.io@servicecomb.apache.org Thu Mar 1 01:37:24 2018 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx-eu-01.ponee.io (Postfix) with SMTP id 23197180657 for ; Thu, 1 Mar 2018 01:37:23 +0100 (CET) Received: (qmail 43127 invoked by uid 500); 1 Mar 2018 00:37:23 -0000 Mailing-List: contact dev-help@servicecomb.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@servicecomb.apache.org Delivered-To: mailing list dev@servicecomb.apache.org Received: (qmail 43116 invoked by uid 99); 1 Mar 2018 00:37:23 -0000 Received: from ec2-52-202-80-70.compute-1.amazonaws.com (HELO gitbox.apache.org) (52.202.80.70) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 01 Mar 2018 00:37:23 +0000 From: GitBox To: dev@servicecomb.apache.org Subject: [GitHub] wujimin commented on a change in pull request #562: [SCB-358] fix bug for monitor output id that register only name without any tags Message-ID: <151986464267.6324.10384922196621393831.gitbox@gitbox.apache.org> Date: Thu, 01 Mar 2018 00:37:22 -0000 wujimin commented on a change in pull request #562: [SCB-358] fix bug for monitor output id that register only name without any tags URL: https://github.com/apache/incubator-servicecomb-java-chassis/pull/562#discussion_r171432377 ########## File path: foundations/foundation-metrics/src/main/java/org/apache/servicecomb/foundation/metrics/publish/Metric.java ########## @@ -35,14 +36,33 @@ public String getName() { } public Metric(String id, double value) { - String[] nameAndTag = id.split("\\("); - this.tags = new HashMap<>(); - String[] tagAnValues = nameAndTag[1].split("[=,)]"); - for (int i = 0; i < tagAnValues.length; i += 2) { - this.tags.put(tagAnValues[i], tagAnValues[i + 1]); + if (validateMetricId(id)) { Review comment: so many if/else...... flat them. ---------------------------------------------------------------- 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: users@infra.apache.org With regards, Apache Git Services