You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@helix.apache.org by ka...@apache.org on 2014/09/11 05:37:49 UTC

[1/2] git commit: Adds -maxChannelLifeMillis CLI argument to BenchmarkDriver

Repository: helix
Updated Branches:
  refs/heads/master ef2fac3b9 -> e8cf54e09


Adds -maxChannelLifeMillis CLI argument to BenchmarkDriver


Project: http://git-wip-us.apache.org/repos/asf/helix/repo
Commit: http://git-wip-us.apache.org/repos/asf/helix/commit/126849d5
Tree: http://git-wip-us.apache.org/repos/asf/helix/tree/126849d5
Diff: http://git-wip-us.apache.org/repos/asf/helix/diff/126849d5

Branch: refs/heads/master
Commit: 126849d53d52b4eeb1c94ad8cba7209c48d468c8
Parents: ef2fac3
Author: Greg Brandt <br...@gmail.com>
Authored: Wed Sep 10 11:37:00 2014 -0700
Committer: Greg Brandt <br...@gmail.com>
Committed: Wed Sep 10 11:37:00 2014 -0700

----------------------------------------------------------------------
 .../helix/ipc/benchmark/BenchmarkDriver.java    | 28 ++++++++++++++------
 1 file changed, 20 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/helix/blob/126849d5/helix-ipc/src/test/java/org/apache/helix/ipc/benchmark/BenchmarkDriver.java
----------------------------------------------------------------------
diff --git a/helix-ipc/src/test/java/org/apache/helix/ipc/benchmark/BenchmarkDriver.java b/helix-ipc/src/test/java/org/apache/helix/ipc/benchmark/BenchmarkDriver.java
index 2d682f7..13d9b3f 100644
--- a/helix-ipc/src/test/java/org/apache/helix/ipc/benchmark/BenchmarkDriver.java
+++ b/helix-ipc/src/test/java/org/apache/helix/ipc/benchmark/BenchmarkDriver.java
@@ -64,18 +64,24 @@ public class BenchmarkDriver implements Runnable {
   private final AtomicBoolean isShutdown;
   private final byte[] messageBytes;
   private final int numConnections;
+  private final long maxChannelLifeMillis;
 
   private HelixIPCService ipcService;
   private String localhost;
   private Thread[] trafficThreads;
 
-  public BenchmarkDriver(int port, int numPartitions, int numThreads, int messageSize,
-      int numConnections) {
+  public BenchmarkDriver(int port,
+                         int numPartitions,
+                         int numThreads,
+                         int messageSize,
+                         int numConnections,
+                         long maxChannelLifeMillis) {
     this.port = port;
     this.numPartitions = numPartitions;
     this.isShutdown = new AtomicBoolean(true);
     this.trafficThreads = new Thread[numThreads];
     this.numConnections = numConnections;
+    this.maxChannelLifeMillis = maxChannelLifeMillis;
 
     StringBuilder sb = new StringBuilder();
     for (int i = 0; i < messageSize; i++) {
@@ -105,8 +111,10 @@ public class BenchmarkDriver implements Runnable {
       localhost = InetAddress.getLocalHost().getCanonicalHostName();
       ipcService =
           new NettyHelixIPCService(new NettyHelixIPCService.Config()
-              .setInstanceName(localhost + "_" + port).setPort(port)
-              .setNumConnections(numConnections));
+              .setInstanceName(localhost + "_" + port)
+              .setPort(port)
+              .setNumConnections(numConnections)
+              .setMaxChannelLifeMillis(maxChannelLifeMillis));
 
       // Counts number of messages received, and ack them
       ipcService.registerCallback(MESSAGE_TYPE, new HelixIPCCallback() {
@@ -193,6 +201,7 @@ public class BenchmarkDriver implements Runnable {
     options.addOption("threads", true, "Number of threads");
     options.addOption("messageSize", true, "Message size in bytes");
     options.addOption("numConnections", true, "Number of connections between nodes");
+    options.addOption("maxChannelLifeMillis", true, "Maximum length of time to keep Netty Channel open");
 
     CommandLine commandLine = new GnuParser().parse(options, args);
 
@@ -211,10 +220,13 @@ public class BenchmarkDriver implements Runnable {
       }
     });
 
-    new BenchmarkDriver(Integer.parseInt(commandLine.getArgs()[0]), Integer.parseInt(commandLine
-        .getOptionValue("partitions", "1")), Integer.parseInt(commandLine.getOptionValue("threads",
-        "1")), Integer.parseInt(commandLine.getOptionValue("messageSize", "1024")),
-        Integer.parseInt(commandLine.getOptionValue("numConnections", "1"))).run();
+    new BenchmarkDriver(
+            Integer.parseInt(commandLine.getArgs()[0]),
+            Integer.parseInt(commandLine.getOptionValue("partitions", "1")),
+            Integer.parseInt(commandLine.getOptionValue("threads", "1")),
+            Integer.parseInt(commandLine.getOptionValue("messageSize", "1024")),
+            Integer.parseInt(commandLine.getOptionValue("numConnections", "1")),
+            Long.parseLong(commandLine.getOptionValue("maxChannelLifeMillis", "5000"))).run();
 
     latch.await();
   }


[2/2] git commit: Adds -maxChannelLifeMillis CLI argument to BenchmarkDriver, this closes #3

Posted by ka...@apache.org.
Adds -maxChannelLifeMillis CLI argument to BenchmarkDriver, this closes #3


Project: http://git-wip-us.apache.org/repos/asf/helix/repo
Commit: http://git-wip-us.apache.org/repos/asf/helix/commit/e8cf54e0
Tree: http://git-wip-us.apache.org/repos/asf/helix/tree/e8cf54e0
Diff: http://git-wip-us.apache.org/repos/asf/helix/diff/e8cf54e0

Branch: refs/heads/master
Commit: e8cf54e096afeef8b5669a593efd61c3b8b765d0
Parents: 126849d
Author: Kanak Biscuitwala <ka...@hotmail.com>
Authored: Wed Sep 10 20:37:28 2014 -0700
Committer: Kanak Biscuitwala <ka...@hotmail.com>
Committed: Wed Sep 10 20:37:28 2014 -0700

----------------------------------------------------------------------
 .../helix/ipc/benchmark/BenchmarkDriver.java    | 29 ++++++++------------
 1 file changed, 11 insertions(+), 18 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/helix/blob/e8cf54e0/helix-ipc/src/test/java/org/apache/helix/ipc/benchmark/BenchmarkDriver.java
----------------------------------------------------------------------
diff --git a/helix-ipc/src/test/java/org/apache/helix/ipc/benchmark/BenchmarkDriver.java b/helix-ipc/src/test/java/org/apache/helix/ipc/benchmark/BenchmarkDriver.java
index 13d9b3f..30b02ce 100644
--- a/helix-ipc/src/test/java/org/apache/helix/ipc/benchmark/BenchmarkDriver.java
+++ b/helix-ipc/src/test/java/org/apache/helix/ipc/benchmark/BenchmarkDriver.java
@@ -70,12 +70,8 @@ public class BenchmarkDriver implements Runnable {
   private String localhost;
   private Thread[] trafficThreads;
 
-  public BenchmarkDriver(int port,
-                         int numPartitions,
-                         int numThreads,
-                         int messageSize,
-                         int numConnections,
-                         long maxChannelLifeMillis) {
+  public BenchmarkDriver(int port, int numPartitions, int numThreads, int messageSize,
+      int numConnections, long maxChannelLifeMillis) {
     this.port = port;
     this.numPartitions = numPartitions;
     this.isShutdown = new AtomicBoolean(true);
@@ -111,10 +107,8 @@ public class BenchmarkDriver implements Runnable {
       localhost = InetAddress.getLocalHost().getCanonicalHostName();
       ipcService =
           new NettyHelixIPCService(new NettyHelixIPCService.Config()
-              .setInstanceName(localhost + "_" + port)
-              .setPort(port)
-              .setNumConnections(numConnections)
-              .setMaxChannelLifeMillis(maxChannelLifeMillis));
+              .setInstanceName(localhost + "_" + port).setPort(port)
+              .setNumConnections(numConnections).setMaxChannelLifeMillis(maxChannelLifeMillis));
 
       // Counts number of messages received, and ack them
       ipcService.registerCallback(MESSAGE_TYPE, new HelixIPCCallback() {
@@ -201,7 +195,8 @@ public class BenchmarkDriver implements Runnable {
     options.addOption("threads", true, "Number of threads");
     options.addOption("messageSize", true, "Message size in bytes");
     options.addOption("numConnections", true, "Number of connections between nodes");
-    options.addOption("maxChannelLifeMillis", true, "Maximum length of time to keep Netty Channel open");
+    options.addOption("maxChannelLifeMillis", true,
+        "Maximum length of time to keep Netty Channel open");
 
     CommandLine commandLine = new GnuParser().parse(options, args);
 
@@ -220,13 +215,11 @@ public class BenchmarkDriver implements Runnable {
       }
     });
 
-    new BenchmarkDriver(
-            Integer.parseInt(commandLine.getArgs()[0]),
-            Integer.parseInt(commandLine.getOptionValue("partitions", "1")),
-            Integer.parseInt(commandLine.getOptionValue("threads", "1")),
-            Integer.parseInt(commandLine.getOptionValue("messageSize", "1024")),
-            Integer.parseInt(commandLine.getOptionValue("numConnections", "1")),
-            Long.parseLong(commandLine.getOptionValue("maxChannelLifeMillis", "5000"))).run();
+    new BenchmarkDriver(Integer.parseInt(commandLine.getArgs()[0]), Integer.parseInt(commandLine
+        .getOptionValue("partitions", "1")), Integer.parseInt(commandLine.getOptionValue("threads",
+        "1")), Integer.parseInt(commandLine.getOptionValue("messageSize", "1024")),
+        Integer.parseInt(commandLine.getOptionValue("numConnections", "1")),
+        Long.parseLong(commandLine.getOptionValue("maxChannelLifeMillis", "5000"))).run();
 
     latch.await();
   }