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

ASF GitHub Bot commented on SCB-150:
------------------------------------

seanyinx commented on a change in pull request #508: [SCB-150] Add 
Status(success/failed) dimension to operation call count and tps
URL: 
https://github.com/apache/incubator-servicecomb-java-chassis/pull/508#discussion_r161936555
 
 

 ##########
 File path: 
metrics/metrics-integration/metrics-prometheus/src/main/java/org/apache/servicecomb/metrics/prometheus/MetricsCollector.java
 ##########
 @@ -56,24 +58,76 @@ public MetricsCollector(DataSource dataSource) {
   private List<MetricFamilySamples> load() {
     RegistryMetric registryMetric = dataSource.getRegistryMetric();
     List<MetricFamilySamples> familySamples = new ArrayList<>();
-    familySamples.add(getFamilySamples("Instance Level", 
registryMetric.getInstanceMetric().toMap()));
-    for (Entry<String, ConsumerInvocationMetric> consumerMetric : 
registryMetric.getConsumerMetrics().entrySet()) {
-      familySamples
-          .add(getFamilySamples(consumerMetric.getKey() + " Consumer Side", 
consumerMetric.getValue().toMap()));
+
+    List<Sample> samples = new ArrayList<>();
+    
samples.addAll(convertMetricValues(registryMetric.getInstanceMetric().getSystemMetric().toMap()));
+    
samples.addAll(convertConsumerMetric(registryMetric.getInstanceMetric().getConsumerMetric()));
+    
samples.addAll(convertCallMetric(registryMetric.getInstanceMetric().getConsumerMetric().getConsumerCall()));
+    
samples.addAll(convertProducerMetric(registryMetric.getInstanceMetric().getProducerMetric()));
+    
samples.addAll(convertCallMetric(registryMetric.getInstanceMetric().getProducerMetric().getProducerCall()));
+    familySamples.add(new MetricFamilySamples("Instance Level", Type.UNTYPED, 
"Instance Level Metrics", samples));
+
+    if (registryMetric.getConsumerMetrics().size() != 0) {
+      samples = new ArrayList<>();
 
 Review comment:
   use a local list in this scope is better

----------------------------------------------------------------
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 Success / Fail Dimension for Invocation
> -------------------------------------------
>
>                 Key: SCB-150
>                 URL: https://issues.apache.org/jira/browse/SCB-150
>             Project: Apache ServiceComb
>          Issue Type: Sub-task
>          Components: Java-Chassis
>            Reporter: yangyongzheng
>            Assignee: yangyongzheng
>            Priority: Major
>             Fix For: java-chassis-1.0.0-m1
>
>         Attachments: screenshot-1.png
>
>
> Add Success / Fail Dimension for Invocation,new metric available :
> !screenshot-1.png!



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

Reply via email to