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/28 02:13:12 UTC

[GitHub] [rocketmq] MountainOne commented on issue #1527: Runtime status calculation optimization

MountainOne commented on issue #1527: Runtime status calculation optimization
URL: https://github.com/apache/rocketmq/issues/1527#issuecomment-546764792
 
 
   `StatsItem` is sampled in seconds, minutes, and hours. In minutes, for example, sampling is performed every 10 minutes, and the sampled data is stored in the `csListHour` container (representing hourly statistics). Up to 7 samples of data are stored in the container. Suppose the first sampling time is 12:00, then the 7th sampling time in the container is 13:10. If you call `computeStatsData()` to calculate, it will calculate the sum from 12:00 to 13:10. Tps and avgpt, obviously this **time span** is more reflective of the hourly statistics. If it is changed to the last sampled data and the previous sampled data is calculated, it reflects the statistical results from 13:00 to 13:10, and cannot reflect the statistical results of the **time span** in hours.
   
   `StatsItem`分别按秒、分钟、小时进行采样。以分钟为例,每隔 10 分钟会进行一次采样,采样的数据保存在`csListHour`容器中(表示每小时的统计数据)容器中最多保存 7 个采样数据。假设第一次采样的时间为 12:00,那么容器中第 7 次采样的时间为 13:10,如果此时调用`computeStatsData()`进行计算,会计算 12:00 到 13:10 的 sum、tps 和 avgpt,显然这个**时间跨度**是更能反映每小时的统计结果的。如果改成最后一次采样数据和之前一次采样数据计算的话,反映的是 13:00 到 13:10 的统计结果,无法反映以小时为**时间跨度**的统计结果。

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