You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@skywalking.apache.org by GitBox <gi...@apache.org> on 2018/04/26 15:41:23 UTC

[GitHub] candyleer opened a new issue #1122: Set the attribute which is always 0

candyleer opened a new issue #1122: Set the attribute which is always 0
URL: https://github.com/apache/incubator-skywalking/issues/1122
 
 
   Please answer these questions before submitting your issue.
   
   - Why do you submit this issue?
   - [ ] Question or discussion
   - [x] Bug
   - [ ] Requirement
   - [ ] Feature or performance improvement
   
   ___
   ### Question
   - What do you want to know?
   
   ___
   ### Bug
   - Which version of SkyWalking, OS and JRE?
     lastest master,mac os,jdk8
   - Which company or project?
   
   - What happen?
   If possible, provide a way for reproducing the error. e.g. demo application, component version.
   when I learn the source code,I found some strange code,but I'm not if it is intented.
   
   in method `org.apache.skywalking.apm.collector.analysis.metric.provider.worker.instance.refmetric.InstanceReferenceMinuteMetricAggregationWorker#transform`
   ```
   @Override protected InstanceReferenceMetric transform(ServiceReferenceMetric serviceReferenceMetric) {
           String metricId = serviceReferenceMetric.getFrontInstanceId()
               + Const.ID_SPLIT + serviceReferenceMetric.getBehindInstanceId()
               + Const.ID_SPLIT + serviceReferenceMetric.getSourceValue();
   
           String id = serviceReferenceMetric.getTimeBucket()
               + Const.ID_SPLIT + metricId;
   
           InstanceReferenceMetric instanceReferenceMetric = new InstanceReferenceMetric();
           instanceReferenceMetric.setId(id);
           instanceReferenceMetric.setMetricId(metricId);
           instanceReferenceMetric.setFrontApplicationId(serviceReferenceMetric.getFrontApplicationId());
           instanceReferenceMetric.setFrontInstanceId(serviceReferenceMetric.getFrontInstanceId());
           instanceReferenceMetric.setBehindApplicationId(serviceReferenceMetric.getBehindApplicationId());
           instanceReferenceMetric.setBehindInstanceId(serviceReferenceMetric.getBehindInstanceId());
           instanceReferenceMetric.setSourceValue(serviceReferenceMetric.getSourceValue());
   
           instanceReferenceMetric.setTransactionCalls(serviceReferenceMetric.getTransactionCalls());
           instanceReferenceMetric.setTransactionErrorCalls(serviceReferenceMetric.getTransactionErrorCalls());
           instanceReferenceMetric.setTransactionDurationSum(serviceReferenceMetric.getTransactionDurationSum());
           instanceReferenceMetric.setTransactionErrorDurationSum(serviceReferenceMetric.getTransactionErrorDurationSum());
   
           instanceReferenceMetric.setBusinessTransactionCalls(serviceReferenceMetric.getBusinessTransactionCalls());
   //==start
           instanceReferenceMetric.setBusinessTransactionErrorCalls(instanceReferenceMetric.getBusinessTransactionErrorCalls());
           instanceReferenceMetric.setBusinessTransactionDurationSum(instanceReferenceMetric.getBusinessTransactionDurationSum());
           instanceReferenceMetric.setBusinessTransactionErrorDurationSum(instanceReferenceMetric.getBusinessTransactionErrorDurationSum());
   
           instanceReferenceMetric.setMqTransactionCalls(instanceReferenceMetric.getMqTransactionCalls());
           instanceReferenceMetric.setMqTransactionErrorCalls(instanceReferenceMetric.getMqTransactionErrorCalls());
           instanceReferenceMetric.setMqTransactionDurationSum(instanceReferenceMetric.getMqTransactionDurationSum());
           instanceReferenceMetric.setMqTransactionErrorDurationSum(instanceReferenceMetric.getMqTransactionErrorDurationSum());
   //==end
           instanceReferenceMetric.setTimeBucket(serviceReferenceMetric.getTimeBucket());
           return instanceReferenceMetric;
       }
   ```
   from the `//==start` and `//==end`code,the object `instanceReferenceMetric` always set it's own attribute by it's self getter which have not been initialized,is always 0, maybe it should set from `serviceReferenceMetric`?.
   if you can confirm it is a bug, i can help to fix it
   ___
   ### Requirement or improvement
   - Please describe about your requirements or improvement suggestions.

----------------------------------------------------------------
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