blob: 049e71fb18f1b8e5429769544b981870eab697fb [file] [log] [blame]
pankajf49b45e2014-10-07 14:24:22 -07001package org.onlab.onos.foo;
2
3import static org.onlab.onos.foo.SimpleNettyClient.startStandalone;
4
5import org.apache.karaf.shell.commands.Argument;
6import org.apache.karaf.shell.commands.Command;
7import org.onlab.onos.cli.AbstractShellCommand;
8
9/**
10 * Test Netty client performance.
11 */
12@Command(scope = "onos", name = "simple-netty-client",
13 description = "Starts the simple Netty client")
14public class SimpleNettyClientCommand extends AbstractShellCommand {
15
pankajea0acef2014-10-07 15:01:47 -070016 //FIXME: replace these arguments with proper ones needed for the test.
pankajf0f80b22014-10-07 18:37:32 -070017 @Argument(index = 0, name = "hostname", description = "Server Hostname",
pankajf49b45e2014-10-07 14:24:22 -070018 required = false, multiValued = false)
pankajf0f80b22014-10-07 18:37:32 -070019 String host = "localhost";
pankajf49b45e2014-10-07 14:24:22 -070020
pankaj13373b52014-10-07 18:26:07 -070021 @Argument(index = 3, name = "port", description = "Port",
pankajf49b45e2014-10-07 14:24:22 -070022 required = false, multiValued = false)
pankaj13373b52014-10-07 18:26:07 -070023 String port = "8081";
24
25 @Argument(index = 1, name = "warmupCount", description = "Warm-up count",
26 required = false, multiValued = false)
27 String warmup = "10000";
pankajf49b45e2014-10-07 14:24:22 -070028
29 @Argument(index = 2, name = "messageCount", description = "Message count",
30 required = false, multiValued = false)
pankajf0f80b22014-10-07 18:37:32 -070031 String messageCount = "5000000";
pankajf49b45e2014-10-07 14:24:22 -070032
33 @Override
34 protected void execute() {
35 try {
pankajf0f80b22014-10-07 18:37:32 -070036 startStandalone(new String[]{host, port, warmup, messageCount});
pankajf49b45e2014-10-07 14:24:22 -070037 } catch (Exception e) {
38 error("Unable to start client %s", e);
39 }
40 }
41
42}