lwclover commented on code in PR #4208:
URL: https://github.com/apache/rocketmq/pull/4208#discussion_r858134790
##########
example/src/main/java/org/apache/rocketmq/example/benchmark/BatchProducer.java:
##########
@@ -360,17 +364,17 @@ public LongAdder getSendMessageFailedCount() {
public void start() {
- timer.scheduleAtFixedRate(new TimerTask() {
+ executorService.scheduleAtFixedRate(new TimerTask() {
Review Comment:
It seems better to implement Runnable anonymously
##########
example/src/main/java/org/apache/rocketmq/example/benchmark/BatchProducer.java:
##########
@@ -317,7 +320,8 @@ class StatsBenchmarkBatchProducer {
private final LongAdder sendMessageFailedCount = new LongAdder();
- private final Timer timer = new Timer("BenchmarkTimerThread", true);
+ private final ScheduledExecutorService executorService = new
ScheduledThreadPoolExecutor(1,
+ new
BasicThreadFactory.Builder().namingPattern("BenchmarkTimerThread-%d").daemon(true).build());
Review Comment:
A unified style is recommended
--
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]