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 2022/04/26 16:48:55 UTC

[GitHub] [rocketmq] HScarb commented on a diff in pull request #4208: [Optimization] Replace Timer to ScheduleExecutorService

HScarb commented on code in PR #4208:
URL: https://github.com/apache/rocketmq/pull/4208#discussion_r858942952


##########
example/src/main/java/org/apache/rocketmq/example/benchmark/BatchProducer.java:
##########
@@ -317,7 +318,8 @@ class StatsBenchmarkBatchProducer {
 
     private final LongAdder sendMessageFailedCount = new LongAdder();
 
-    private final Timer timer = new Timer("BenchmarkTimerThread", true);
+    private final ScheduledExecutorService executorService = Executors.newSingleThreadScheduledExecutor(new ThreadFactoryImpl(
+            "BenchmarkTimerThread", Boolean.TRUE));

Review Comment:
   The indent here maybe wrong, pls import rmq_codeStyle.xml in style folder and reformat the code



-- 
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: dev-unsubscribe@rocketmq.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org