@@ -45,31 +45,32 @@ public static void main(String[] args) {
4545 System .exit (0 );
4646 }
4747
48- String exchangeType = strArg (cmd , 't' , "direct" );
49- String exchangeName = strArg (cmd , 'e' , exchangeType );
50- String queueName = strArg (cmd , 'u' , "" );
51- String routingKey = strArg (cmd , 'k' , null );
52- int samplingInterval = intArg (cmd , 'i' , 1 );
53- float rateLimit = floatArg (cmd , 'r' , 0.0f );
54- int producerCount = intArg (cmd , 'x' , 1 );
55- int consumerCount = intArg (cmd , 'y' , 1 );
56- int producerTxSize = intArg (cmd , 'm' , 0 );
57- int consumerTxSize = intArg (cmd , 'n' , 0 );
58- long confirm = intArg (cmd , 'c' , -1 );
59- boolean autoAck = cmd .hasOption ('a' );
60- int multiAckEvery = intArg (cmd , 'A' , 0 );
61- int channelPrefetch = intArg (cmd , 'Q' , 0 );
62- int consumerPrefetch = intArg (cmd , 'q' , 0 );
63- int minMsgSize = intArg (cmd , 's' , 0 );
64- int timeLimit = intArg (cmd , 'z' , 0 );
65- int producerMsgCount = intArg (cmd , 'C' , 0 );
66- int consumerMsgCount = intArg (cmd , 'D' , 0 );
67- List <?> flags = lstArg (cmd , 'f' );
68- int frameMax = intArg (cmd , 'M' , 0 );
69- int heartbeat = intArg (cmd , 'b' , 0 );
70- boolean predeclared = cmd .hasOption ('p' );
71-
72- String uri = strArg (cmd , 'h' , "amqp://localhost" );
48+ String exchangeType = strArg (cmd , 't' , "direct" );
49+ String exchangeName = strArg (cmd , 'e' , exchangeType );
50+ String queueName = strArg (cmd , 'u' , "" );
51+ String routingKey = strArg (cmd , 'k' , null );
52+ int samplingInterval = intArg (cmd , 'i' , 1 );
53+ float producerRateLimit = floatArg (cmd , 'r' , 0.0f );
54+ float consumerRateLimit = floatArg (cmd , 'R' , 0.0f );
55+ int producerCount = intArg (cmd , 'x' , 1 );
56+ int consumerCount = intArg (cmd , 'y' , 1 );
57+ int producerTxSize = intArg (cmd , 'm' , 0 );
58+ int consumerTxSize = intArg (cmd , 'n' , 0 );
59+ long confirm = intArg (cmd , 'c' , -1 );
60+ boolean autoAck = cmd .hasOption ('a' );
61+ int multiAckEvery = intArg (cmd , 'A' , 0 );
62+ int channelPrefetch = intArg (cmd , 'Q' , 0 );
63+ int consumerPrefetch = intArg (cmd , 'q' , 0 );
64+ int minMsgSize = intArg (cmd , 's' , 0 );
65+ int timeLimit = intArg (cmd , 'z' , 0 );
66+ int producerMsgCount = intArg (cmd , 'C' , 0 );
67+ int consumerMsgCount = intArg (cmd , 'D' , 0 );
68+ List <?> flags = lstArg (cmd , 'f' );
69+ int frameMax = intArg (cmd , 'M' , 0 );
70+ int heartbeat = intArg (cmd , 'b' , 0 );
71+ boolean predeclared = cmd .hasOption ('p' );
72+
73+ String uri = strArg (cmd , 'h' , "amqp://localhost" );
7374
7475 //setup
7576 PrintlnStats stats = new PrintlnStats (1000L * samplingInterval ,
@@ -91,6 +92,7 @@ public static void main(String[] args) {
9192 p .setConfirm ( confirm );
9293 p .setConsumerCount ( consumerCount );
9394 p .setConsumerMsgCount ( consumerMsgCount );
95+ p .setConsumerRateLimit (consumerRateLimit );
9496 p .setConsumerTxSize ( consumerTxSize );
9597 p .setExchangeName ( exchangeName );
9698 p .setExchangeType ( exchangeType );
@@ -105,7 +107,7 @@ public static void main(String[] args) {
105107 p .setProducerTxSize ( producerTxSize );
106108 p .setQueueName ( queueName );
107109 p .setRoutingKey ( routingKey );
108- p .setRateLimit ( rateLimit );
110+ p .setProducerRateLimit ( producerRateLimit );
109111 p .setTimeLimit ( timeLimit );
110112
111113 MulticastSet set = new MulticastSet (stats , factory , p );
@@ -137,7 +139,8 @@ private static Options getOptions() {
137139 options .addOption (new Option ("u" , "queue" , true , "queue name" ));
138140 options .addOption (new Option ("k" , "routingKey" , true , "routing key" ));
139141 options .addOption (new Option ("i" , "interval" , true , "sampling interval" ));
140- options .addOption (new Option ("r" , "rate" , true , "rate limit" ));
142+ options .addOption (new Option ("r" , "rate" , true , "producer rate limit" ));
143+ options .addOption (new Option ("R" , "consumerRate" , true , "consumer rate limit" ));
141144 options .addOption (new Option ("x" , "producers" , true , "producer count" ));
142145 options .addOption (new Option ("y" , "consumers" , true , "consumer count" ));
143146 options .addOption (new Option ("m" , "ptxsize" , true , "producer tx size" ));
0 commit comments