himanshukandwal commented on code in PR #2735:
URL: https://github.com/apache/helix/pull/2735#discussion_r1488875667


##########
helix-core/src/test/java/org/apache/helix/TestHelper.java:
##########
@@ -864,4 +866,36 @@ public static void printZkListeners(HelixZkClient client) 
throws Exception {
     }
     System.out.println("}");
   }
+
+  public static HelixZkClient createZkClient(String zkAddress) {
+    HelixZkClient.ZkClientConfig clientConfig = new 
HelixZkClient.ZkClientConfig()
+        .setZkSerializer(new 
org.apache.helix.zookeeper.datamodel.serializer.ZNRecordSerializer())
+        .setConnectInitTimeout(1000L)
+        .setOperationRetryTimeout(1000L);
+
+    HelixZkClient.ZkConnectionConfig zkConnectionConfig = new 
HelixZkClient.ZkConnectionConfig(zkAddress)
+        .setSessionTimeout(1000);
+
+    return 
DedicatedZkClientFactory.getInstance().buildZkClient(zkConnectionConfig, 
clientConfig);
+  }
+
+  public static void sleepQuietly(Duration duration) {
+    try {
+      Thread.sleep(duration.toMillis());
+    } catch (InterruptedException e) {
+      e.printStackTrace();
+    }
+  }
+
+  public static void timeIt(Runnable runnable) {
+    long startTime = System.currentTimeMillis();
+    try {
+      runnable.run();
+    } catch (Exception e) {
+      throw e;
+    } finally {
+      System.out.println(" -- time taken: " + (System.currentTimeMillis() - 
startTime) + "ms");

Review Comment:
   I have removed this function as this was something I used for measurement of 
individual pieces of execution.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to