christinefeng 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_r402671993
 
 

 ##########
 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:
   There's a change in the logline as well as moving the logic for breaking the 
loop in case of executionDuration being exceeded
   It was in the for loop definition before, now it's an if check at the 
beginning of the loop

----------------------------------------------------------------
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