MCPcopy Create free account
hub / github.com/apache/tomcat / main

Method main

test/org/apache/catalina/tribes/demos/LoadTest.java:291–366  ·  view source on GitHub ↗
(String[] args)

Source from the content-addressed store, hash-verified

289 }
290
291 public static void main(String[] args) throws Exception {
292 boolean send = true;
293 boolean debug = false;
294 long pause = 0;
295 int count = 1000000;
296 int stats = 10000;
297 boolean breakOnEx = false;
298 int threads = 1;
299 boolean shutdown = false;
300 int startoptions = Channel.DEFAULT;
301 int channelOptions = Channel.SEND_OPTIONS_DEFAULT;
302 if (args.length == 0) {
303 args = new String[] { "-help" };
304 }
305 for (int i = 0; i < args.length; i++) {
306 if ("-threads".equals(args[i])) {
307 threads = Integer.parseInt(args[++i]);
308 } else if ("-count".equals(args[i])) {
309 count = Integer.parseInt(args[++i]);
310 System.out.println("Sending " + count + " messages.");
311 } else if ("-pause".equals(args[i])) {
312 pause = Long.parseLong(args[++i]) * 1000;
313 } else if ("-break".equals(args[i])) {
314 breakOnEx = true;
315 } else if ("-shutdown".equals(args[i])) {
316 shutdown = true;
317 } else if ("-stats".equals(args[i])) {
318 stats = Integer.parseInt(args[++i]);
319 System.out.println("Stats every " + stats + " message");
320 } else if ("-sendoptions".equals(args[i])) {
321 channelOptions = Integer.parseInt(args[++i]);
322 System.out.println("Setting send options to " + channelOptions);
323 } else if ("-startoptions".equals(args[i])) {
324 startoptions = Integer.parseInt(args[++i]);
325 System.out.println("Setting start options to " + startoptions);
326 } else if ("-size".equals(args[i])) {
327 size = Integer.parseInt(args[++i]) - 4;
328 System.out.println("Message size will be:" + (size + 4) + " bytes");
329 } else if ("-mode".equals(args[i])) {
330 if ("receive".equals(args[++i])) {
331 send = false;
332 }
333 } else if ("-debug".equals(args[i])) {
334 debug = true;
335 } else if ("-help".equals(args[i])) {
336 usage();
337 System.exit(1);
338 }
339 }
340
341 ManagedChannel channel = (ManagedChannel) ChannelCreator.createChannel(args);
342
343 LoadTest test = new LoadTest(channel, send, count, debug, pause, stats, breakOnEx);
344 test.channelOptions = channelOptions;
345 LoadMessage msg = new LoadMessage();
346
347 messageSize = LoadMessage.getMessageSize(msg);
348 channel.addChannelListener(test);

Callers

nothing calls this directly

Calls 13

usageMethod · 0.95
createChannelMethod · 0.95
getMessageSizeMethod · 0.95
runMethod · 0.95
equalsMethod · 0.65
addChannelListenerMethod · 0.65
addMembershipListenerMethod · 0.65
startMethod · 0.65
stopMethod · 0.65
parseIntMethod · 0.45
printlnMethod · 0.45
parseLongMethod · 0.45

Tested by

no test coverage detected