You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@rocketmq.apache.org by GitBox <gi...@apache.org> on 2020/06/11 13:02:10 UTC

[GitHub] [rocketmq] Jaskey opened a new issue #2088: rocketmq client's stats of RT does not make sense

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:
users@infra.apache.org



[GitHub] [rocketmq] Jaskey commented on issue #2088: rocketmq client's stats of RT does not make sense

Posted by GitBox <gi...@apache.org>.
Jaskey commented on issue #2088:
URL: https://github.com/apache/rocketmq/issues/2088#issuecomment-645219796


   @ShannonDing @imaffe please help review the pr https://github.com/apache/rocketmq/pull/2103


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [rocketmq] vongosling closed issue #2088: rocketmq client's stats of RT does not make sense

Posted by GitBox <gi...@apache.org>.
vongosling closed issue #2088:
URL: https://github.com/apache/rocketmq/issues/2088


   


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [rocketmq] imaffe commented on issue #2088: rocketmq client's stats of RT does not make sense

Posted by GitBox <gi...@apache.org>.
imaffe commented on issue #2088:
URL: https://github.com/apache/rocketmq/issues/2088#issuecomment-645118895


   Would you be interested in submitting a PR to enhance this (add new metrics, rename some metrics) ? Thanks~


----------------------------------------------------------------
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:
users@infra.apache.org