servicecomb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] zhengyangyong commented on a change in pull request #562: [SCB-358] fix bug for monitor output id that register only name without any tags
Date Thu, 01 Mar 2018 00:05:05 GMT
zhengyangyong 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_r171427141
 
 

 ##########
 File path: foundations/foundation-metrics/src/main/java/org/apache/servicecomb/foundation/metrics/publish/Metric.java
 ##########
 @@ -71,11 +95,28 @@ public boolean containsTag(String tagKey, String tagValue) {
   }
 
   public boolean containsTag(String... tags) {
-    for (int i = 0; i < tags.length; i += 2) {
-      if (!containsTag(tags[i], tags[i + 1])) {
-        return false;
+    if (tags.length >= 2 && tags.length % 2 == 0) {
+      for (int i = 0; i < tags.length; i += 2) {
+        if (!containsTag(tags[i], tags[i + 1])) {
+          return false;
+        }
       }
+      return true;
     }
-    return true;
+    throw new ServiceCombException("bad tags count");
+  }
+
+  private int getCharCount(String id, char c) {
+    int count = 0;
+    for (char cr : id.toCharArray()) {
+      if (cr == c) {
+        count++;
+      }
+    }
+    return count;
+  }
+
+  private boolean isCorrectId(String id) {
 
 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:
users@infra.apache.org


With regards,
Apache Git Services

Mime
View raw message