Jaskey opened a new issue #2088:
URL: https://github.com/apache/rocketmq/issues/2088


   **BUG REPORT**
   
   
   ### What did you do (The steps to reproduce)?
   Start a cousumer, and continue to consume message, after one minute, check 
the client log.
   
   ### Please describe the issue you observed:
   
   For RT, we care about average RT and max RT in a sampling period. 
   
   But now we will see current log :
   
   ```
   [CONSUME_RT] [topic_xxxx@xxxx-consumer] Stats In One Minute, SUM: 256807 
TPS: 4280.12 AVGPT: 812.68
   ```
   
   The value TPS does not make any sense. And neither for the the value 
4280.12. In the current logic, tps is the sum_value/time_period
   ```
       private static StatsSnapshot computeStatsData(final 
LinkedList<CallSnapshot> csList) {
           StatsSnapshot statsSnapshot = new StatsSnapshot();
           synchronized (csList) {
               double tps = 0;
               double avgpt = 0;
               long sum = 0;
               if (!csList.isEmpty()) {
                   CallSnapshot first = csList.getFirst();
                   CallSnapshot last = csList.getLast();
                   sum = last.getValue() - first.getValue();
                   tps = (sum * 1000.0d) / (last.getTimestamp() - 
first.getTimestamp());
   
                   long timesDiff = last.getTimes() - first.getTimes();
                   if (timesDiff > 0) {
                       avgpt = (sum * 1.0d) / timesDiff;
                   }
               }
   
               statsSnapshot.setSum(sum);
               statsSnapshot.setTps(tps);
               statsSnapshot.setAvgpt(avgpt);
           }
   
           return statsSnapshot;
       }
   ```
   ### What did you expect to see?
   
    For RT, we should care about sum_value/count_period. And the text should be 
AVG_RT , and MAX_RT rather than TPS and AVGPT
   
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to