XiaoyiPeng opened a new pull request #3509: URL: https://github.com/apache/rocketmq/pull/3509
**Make sure set the target branch to `develop`** ## What is the purpose of the change fix bug : https://github.com/apache/rocketmq/issues/2516 ## Brief changelog 1. According to the idea between the original issue author and @RongtongJin , optimizing the method: `BrokerController#headSlowTimeMillss(BlockingQueue<Runnable> q)` 2. Iterate over the `BrokerController#sendThreadPoolQueue` and find the first element that meets the conditions (or NULL)to cacluete the time instead of the [`sendThreadPoolQueue#peek()`] method (think about the impact of concurrency, `BrokerController#sendThreadPoolQueue` is polled by thread in `BrokerController#sendMessageExecutor`). 3. However, for monitoring purposes, I think it's better to count the distribution of this value over each time interval, just like `StoreStatsService#putMessageDistributeTime`, `StoreStatsService#PUT_MESSAGE_ENTIRE_TIME_MAX_DESC` as shown below: ``` private static final String[] PUT_MESSAGE_ENTIRE_TIME_MAX_DESC = new String[] { "[<=0ms]", "[0~10ms]", "[10~50ms]", "[50~100ms]", "[100~200ms]", "[200~500ms]", "[500ms~1s]", "[1~2s]", "[2~3s]", "[3~4s]", "[4~5s]", "[5~10s]", "[10s~]", }; ``` **because RocketMQ-Exporter monitor `sendThreadPoolQueueHeadWaitTimeMills` as a Prometheus `guage` type variable**. ## Verifying this change  -- 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. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
