Showing
1 changed file
with
2 additions
and
4 deletions
... | @@ -38,7 +38,7 @@ public final class SimpleNettyClient { | ... | @@ -38,7 +38,7 @@ public final class SimpleNettyClient { |
38 | MetricsComponent component = metrics.registerComponent("NettyMessaging"); | 38 | MetricsComponent component = metrics.registerComponent("NettyMessaging"); |
39 | Timer sendAsyncTimer = metrics.createTimer(component, feature, "AsyncSender"); | 39 | Timer sendAsyncTimer = metrics.createTimer(component, feature, "AsyncSender"); |
40 | 40 | ||
41 | - final int warmup = 100; | 41 | + final int warmup = 1000000; |
42 | for (int i = 0; i < warmup; i++) { | 42 | for (int i = 0; i < warmup; i++) { |
43 | messaging.sendAsync(new Endpoint("localhost", 8081), "simple", "Hello World".getBytes()); | 43 | messaging.sendAsync(new Endpoint("localhost", 8081), "simple", "Hello World".getBytes()); |
44 | Response response = messaging | 44 | Response response = messaging |
... | @@ -46,13 +46,12 @@ public final class SimpleNettyClient { | ... | @@ -46,13 +46,12 @@ public final class SimpleNettyClient { |
46 | "Hello World".getBytes()); | 46 | "Hello World".getBytes()); |
47 | } | 47 | } |
48 | 48 | ||
49 | - final int iterations = 10000; | 49 | + final int iterations = 1000000000; |
50 | for (int i = 0; i < iterations; i++) { | 50 | for (int i = 0; i < iterations; i++) { |
51 | Timer.Context context = sendAsyncTimer.time(); | 51 | Timer.Context context = sendAsyncTimer.time(); |
52 | messaging.sendAsync(new Endpoint("localhost", 8081), "simple", "Hello World".getBytes()); | 52 | messaging.sendAsync(new Endpoint("localhost", 8081), "simple", "Hello World".getBytes()); |
53 | context.stop(); | 53 | context.stop(); |
54 | } | 54 | } |
55 | - metrics.registerMetric(component, feature, "AsyncTimer", sendAsyncTimer); | ||
56 | 55 | ||
57 | Timer sendAndReceiveTimer = metrics.createTimer(component, feature, "SendAndReceive"); | 56 | Timer sendAndReceiveTimer = metrics.createTimer(component, feature, "SendAndReceive"); |
58 | 57 | ||
... | @@ -64,7 +63,6 @@ public final class SimpleNettyClient { | ... | @@ -64,7 +63,6 @@ public final class SimpleNettyClient { |
64 | // System.out.println("Got back:" + new String(response.get(2, TimeUnit.SECONDS))); | 63 | // System.out.println("Got back:" + new String(response.get(2, TimeUnit.SECONDS))); |
65 | context.stop(); | 64 | context.stop(); |
66 | } | 65 | } |
67 | - metrics.registerMetric(component, feature, "PingPong", sendAndReceiveTimer); | ||
68 | } | 66 | } |
69 | 67 | ||
70 | public static class TestNettyMessagingService extends NettyMessagingService { | 68 | public static class TestNettyMessagingService extends NettyMessagingService { | ... | ... |
-
Please register or login to post a comment