ChinmaySKulkarni commented on a change in pull request #749: PHOENIX-4521: 
Allow Pherf scenario to define per query max allowed query execution duration 
after which thread is interrupted
URL: https://github.com/apache/phoenix/pull/749#discussion_r402658134
 
 

 ##########
 File path: 
phoenix-pherf/src/main/java/org/apache/phoenix/pherf/workload/MultiThreadedRunner.java
 ##########
 @@ -88,13 +90,21 @@
      */
     @Override
     public Void call() throws Exception {
-        LOGGER.info("\n\nThread Starting " + threadName + " ; " + 
query.getStatement() + " for "
-                + numberOfExecutions + "times\n\n");
+        LOGGER.info("\n\nThread Starting " + threadName + " ; '" + 
query.getStatement() + "' for "
+                + numberOfExecutions + " times\n\n");
         Long start = EnvironmentEdgeManager.currentTimeMillis();
-        for (long i = numberOfExecutions; (i > 0 && 
((EnvironmentEdgeManager.currentTimeMillis() - start)
-                < executionDurationInMs)); i--) {
+        for (long i = 0; i < numberOfExecutions; i++) {
+
+            if ((EnvironmentEdgeManager.currentTimeMillis() - start) >= 
executionDurationInMs) {
+                LOGGER.info("Queryset timeout of " + executionDurationInMs + " 
ms reached; current time is " + ((EnvironmentEdgeManager.currentTimeMillis() - 
start)) + " ms."
 
 Review comment:
   The log line is the only _actual_ diff here right? Just want to confirm that 
we didn't change any logic for queryset.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to