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 #555: [SCB-327] Update metrics publish data module (Re-organized)
Date Thu, 01 Jan 1970 00:00:00 GMT
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:
users@infra.apache.org


With regards,
Apache Git Services

Mime
View raw message