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 2019/10/13 14:24:33 UTC

[GitHub] [rocketmq] superheizai opened a new issue #1527: Runtime status calculation optimization

superheizai opened a new issue #1527: Runtime status calculation optimization
URL: https://github.com/apache/rocketmq/issues/1527
 
 
   Currently, StatsItem summary the runtime statistics into List by minute, hour and day. But calculation based on the first and the last element of the List. It's not accurate. 
   Calculation based on the last one and the former one will lead to a value which is more accurate.
   
   `        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;
                   }
               }`
   

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


With regards,
Apache Git Services