提交 df88bce1 编写于 作者: Y yuz10

add msgTraceEnable config in transaction producer benchmark

上级 58087722
...@@ -69,6 +69,7 @@ public class TransactionProducer { ...@@ -69,6 +69,7 @@ public class TransactionProducer {
config.batchId = commandLine.hasOption("b") ? Long.parseLong(commandLine.getOptionValue("b")) : System.currentTimeMillis(); config.batchId = commandLine.hasOption("b") ? Long.parseLong(commandLine.getOptionValue("b")) : System.currentTimeMillis();
config.sendInterval = commandLine.hasOption("i") ? Integer.parseInt(commandLine.getOptionValue("i")) : 0; config.sendInterval = commandLine.hasOption("i") ? Integer.parseInt(commandLine.getOptionValue("i")) : 0;
config.aclEnable = commandLine.hasOption('a') && Boolean.parseBoolean(commandLine.getOptionValue('a')); 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); final ExecutorService sendThreadPool = Executors.newFixedThreadPool(config.threadCount);
...@@ -123,8 +124,12 @@ public class TransactionProducer { ...@@ -123,8 +124,12 @@ public class TransactionProducer {
}, 10000, 10000); }, 10000, 10000);
final TransactionListener transactionCheckListener = new TransactionListenerImpl(statsBenchmark, config); final TransactionListener transactionCheckListener = new TransactionListenerImpl(statsBenchmark, config);
final TransactionMQProducer producer = final TransactionMQProducer producer = new TransactionMQProducer(
new TransactionMQProducer("benchmark_transaction_producer", config.aclEnable ? AclClient.getAclRPCHook() : null); null,
"benchmark_transaction_producer",
config.aclEnable ? AclClient.getAclRPCHook() : null,
config.msgTraceEnable,
null);
producer.setInstanceName(Long.toString(System.currentTimeMillis())); producer.setInstanceName(Long.toString(System.currentTimeMillis()));
producer.setTransactionListener(transactionCheckListener); producer.setTransactionListener(transactionCheckListener);
producer.setDefaultTopicQueueNums(1000); producer.setDefaultTopicQueueNums(1000);
...@@ -256,6 +261,10 @@ public class TransactionProducer { ...@@ -256,6 +261,10 @@ public class TransactionProducer {
opt.setRequired(false); opt.setRequired(false);
options.addOption(opt); options.addOption(opt);
opt = new Option("m", "msgTraceEnable", true, "Message Trace Enable, Default: false");
opt.setRequired(false);
options.addOption(opt);
return options; return options;
} }
} }
...@@ -439,6 +448,7 @@ class TxSendConfig { ...@@ -439,6 +448,7 @@ class TxSendConfig {
long batchId; long batchId;
int sendInterval; int sendInterval;
boolean aclEnable; boolean aclEnable;
boolean msgTraceEnable;
} }
class LRUMap<K, V> extends LinkedHashMap<K, V> { 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.
先完成此消息的编辑!
想要评论请 注册