Showing
2 changed files
with
6 additions
and
5 deletions
... | @@ -34,7 +34,7 @@ private static Logger log = LoggerFactory.getLogger(SimpleNettyClient.class); | ... | @@ -34,7 +34,7 @@ private static Logger log = LoggerFactory.getLogger(SimpleNettyClient.class); |
34 | 34 | ||
35 | System.exit(0); | 35 | System.exit(0); |
36 | } | 36 | } |
37 | - public static void startStandalone(String... args) throws Exception { | 37 | + public static void startStandalone(String[] args) throws Exception { |
38 | String host = args.length > 0 ? args[0] : "localhost"; | 38 | String host = args.length > 0 ? args[0] : "localhost"; |
39 | int port = args.length > 1 ? Integer.parseInt(args[1]) : 8081; | 39 | int port = args.length > 1 ? Integer.parseInt(args[1]) : 8081; |
40 | int warmup = args.length > 2 ? Integer.parseInt(args[2]) : 1000; | 40 | int warmup = args.length > 2 ? Integer.parseInt(args[2]) : 1000; |
... | @@ -46,7 +46,7 @@ private static Logger log = LoggerFactory.getLogger(SimpleNettyClient.class); | ... | @@ -46,7 +46,7 @@ private static Logger log = LoggerFactory.getLogger(SimpleNettyClient.class); |
46 | metrics.activate(); | 46 | metrics.activate(); |
47 | MetricsFeature feature = new MetricsFeature("latency"); | 47 | MetricsFeature feature = new MetricsFeature("latency"); |
48 | MetricsComponent component = metrics.registerComponent("NettyMessaging"); | 48 | MetricsComponent component = metrics.registerComponent("NettyMessaging"); |
49 | - log.info("warmup...."); | 49 | + log.info("connecting " + host + ":" + port + " warmup:" + warmup + " iterations:" + iterations); |
50 | 50 | ||
51 | for (int i = 0; i < warmup; i++) { | 51 | for (int i = 0; i < warmup; i++) { |
52 | messaging.sendAsync(endpoint, "simple", "Hello World".getBytes()); | 52 | messaging.sendAsync(endpoint, "simple", "Hello World".getBytes()); |
... | @@ -73,6 +73,7 @@ private static Logger log = LoggerFactory.getLogger(SimpleNettyClient.class); | ... | @@ -73,6 +73,7 @@ private static Logger log = LoggerFactory.getLogger(SimpleNettyClient.class); |
73 | // System.out.println("Got back:" + new String(response.get(2, TimeUnit.SECONDS))); | 73 | // System.out.println("Got back:" + new String(response.get(2, TimeUnit.SECONDS))); |
74 | context.stop(); | 74 | context.stop(); |
75 | } | 75 | } |
76 | + metrics.deactivate(); | ||
76 | } | 77 | } |
77 | 78 | ||
78 | public static class TestNettyMessagingService extends NettyMessagingService { | 79 | public static class TestNettyMessagingService extends NettyMessagingService { | ... | ... |
... | @@ -18,15 +18,15 @@ public class SimpleNettyClientCommand extends AbstractShellCommand { | ... | @@ -18,15 +18,15 @@ public class SimpleNettyClientCommand extends AbstractShellCommand { |
18 | required = false, multiValued = false) | 18 | required = false, multiValued = false) |
19 | String hostname = "localhost"; | 19 | String hostname = "localhost"; |
20 | 20 | ||
21 | - @Argument(index = 3, name = "port", description = "Port", | 21 | + @Argument(index = 1, name = "port", description = "Port", |
22 | required = false, multiValued = false) | 22 | required = false, multiValued = false) |
23 | String port = "8081"; | 23 | String port = "8081"; |
24 | 24 | ||
25 | - @Argument(index = 1, name = "warmupCount", description = "Warm-up count", | 25 | + @Argument(index = 2, name = "warmupCount", description = "Warm-up count", |
26 | required = false, multiValued = false) | 26 | required = false, multiValued = false) |
27 | String warmupCount = "1000"; | 27 | String warmupCount = "1000"; |
28 | 28 | ||
29 | - @Argument(index = 2, name = "messageCount", description = "Message count", | 29 | + @Argument(index = 3, name = "messageCount", description = "Message count", |
30 | required = false, multiValued = false) | 30 | required = false, multiValued = false) |
31 | String messageCount = "100000"; | 31 | String messageCount = "100000"; |
32 | 32 | ... | ... |
-
Please register or login to post a comment