blob: b48fe53e637eea8480bb4f238a4ffbb963aeaca2 [file] [log] [blame]
tomf110fff2014-09-26 00:38:18 -07001package org.onlab.onos.foo;
2
tomf7e13b02014-09-26 11:12:25 -07003import org.apache.karaf.shell.commands.Argument;
tomf110fff2014-09-26 00:38:18 -07004import org.apache.karaf.shell.commands.Command;
5import org.onlab.onos.cli.AbstractShellCommand;
6
7import static org.onlab.onos.foo.IOLoopTestClient.startStandalone;
8
9/**
10 * Starts the test IO loop client.
11 */
12@Command(scope = "onos", name = "test-io-client",
13 description = "Starts the test IO loop client")
14public class TestIOClientCommand extends AbstractShellCommand {
15
tomf7e13b02014-09-26 11:12:25 -070016 @Argument(index = 0, name = "serverIp", description = "Server IP address",
17 required = false, multiValued = false)
18 String serverIp = "127.0.0.1";
19
20 @Argument(index = 1, name = "workers", description = "IO workers",
21 required = false, multiValued = false)
22 String workers = "6";
23
24 @Argument(index = 2, name = "messageCount", description = "Message count",
25 required = false, multiValued = false)
tom14dc4d02014-09-26 12:43:14 -070026 String messageCount = "1000000";
tomf7e13b02014-09-26 11:12:25 -070027
28 @Argument(index = 3, name = "messageLength", description = "Message length (bytes)",
29 required = false, multiValued = false)
30 String messageLength = "128";
31
32 @Argument(index = 4, name = "timeoutSecs", description = "Test timeout (seconds)",
33 required = false, multiValued = false)
tom14dc4d02014-09-26 12:43:14 -070034 String timeoutSecs = "60";
tomf7e13b02014-09-26 11:12:25 -070035
tomf110fff2014-09-26 00:38:18 -070036 @Override
37 protected void execute() {
38 try {
tomf7e13b02014-09-26 11:12:25 -070039 startStandalone(new String[]{serverIp, workers, messageCount, messageLength, timeoutSecs});
tomf110fff2014-09-26 00:38:18 -070040 } catch (Exception e) {
tomf7e13b02014-09-26 11:12:25 -070041 error("Unable to start client %s", e);
tomf110fff2014-09-26 00:38:18 -070042 }
43 }
44
45}