未验证 提交 011035f6 编写于 作者: H Heng Du 提交者: GitHub

Merge pull request #3163 from yuz10/develop6

[ISSUE #3162 ]add msgTraceEnable config in transaction producer benchmark
......@@ -69,6 +69,7 @@ public class TransactionProducer {
config.batchId = commandLine.hasOption("b") ? Long.parseLong(commandLine.getOptionValue("b")) : System.currentTimeMillis();
config.sendInterval = commandLine.hasOption("i") ? Integer.parseInt(commandLine.getOptionValue("i")) : 0;
config.aclEnable = commandLine.hasOption('a') && Boolean.parseBoolean(commandLine.getOptionValue('a'));
config.msgTraceEnable = commandLine.hasOption('m') && Boolean.parseBoolean(commandLine.getOptionValue('m'));
final ExecutorService sendThreadPool = Executors.newFixedThreadPool(config.threadCount);
......@@ -123,8 +124,12 @@ public class TransactionProducer {
}, 10000, 10000);
final TransactionListener transactionCheckListener = new TransactionListenerImpl(statsBenchmark, config);
final TransactionMQProducer producer =
new TransactionMQProducer("benchmark_transaction_producer", config.aclEnable ? AclClient.getAclRPCHook() : null);
final TransactionMQProducer producer = new TransactionMQProducer(
null,
"benchmark_transaction_producer",
config.aclEnable ? AclClient.getAclRPCHook() : null,
config.msgTraceEnable,
null);
producer.setInstanceName(Long.toString(System.currentTimeMillis()));
producer.setTransactionListener(transactionCheckListener);
producer.setDefaultTopicQueueNums(1000);
......@@ -256,6 +261,10 @@ public class TransactionProducer {
opt.setRequired(false);
options.addOption(opt);
opt = new Option("m", "msgTraceEnable", true, "Message Trace Enable, Default: false");
opt.setRequired(false);
options.addOption(opt);
return options;
}
}
......@@ -439,6 +448,7 @@ class TxSendConfig {
long batchId;
int sendInterval;
boolean aclEnable;
boolean msgTraceEnable;
}
class LRUMap<K, V> extends LinkedHashMap<K, V> {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册