You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@phoenix.apache.org by ya...@apache.org on 2020/10/01 00:43:41 UTC

[phoenix] branch 4.x updated: Phoenix-pherf writes the result file even disableRuntimeResult flag is true

This is an automated email from the ASF dual-hosted git repository.

yanxinyi pushed a commit to branch 4.x
in repository https://gitbox.apache.org/repos/asf/phoenix.git


The following commit(s) were added to refs/heads/4.x by this push:
     new 4f778ec  Phoenix-pherf writes the result file even disableRuntimeResult flag is true
4f778ec is described below

commit 4f778ec8df316907910de82f2c1ba8e06bd1cd02
Author: Xinyi Yan <xy...@salesforce.com>
AuthorDate: Mon Sep 28 11:48:39 2020 -0700

    Phoenix-pherf writes the result file even disableRuntimeResult flag is true
    
    Signed-off-by: Xinyi Yan <ya...@apache.org>
---
 .../phoenix/pherf/workload/MultiThreadedRunner.java    | 18 ++++++++++++++----
 1 file changed, 14 insertions(+), 4 deletions(-)

diff --git a/phoenix-pherf/src/main/java/org/apache/phoenix/pherf/workload/MultiThreadedRunner.java b/phoenix-pherf/src/main/java/org/apache/phoenix/pherf/workload/MultiThreadedRunner.java
index b4562e3..c4c38bd 100644
--- a/phoenix-pherf/src/main/java/org/apache/phoenix/pherf/workload/MultiThreadedRunner.java
+++ b/phoenix-pherf/src/main/java/org/apache/phoenix/pherf/workload/MultiThreadedRunner.java
@@ -57,7 +57,7 @@ class MultiThreadedRunner implements Callable<Void> {
     private final Scenario scenario;
     private final WorkloadExecutor workloadExecutor;
     private final XMLConfigParser parser;
-    
+    private final boolean writeRuntimeResults;
 
     /**
      * MultiThreadedRunner
@@ -83,6 +83,7 @@ class MultiThreadedRunner implements Callable<Void> {
        	this.resultManager = new ResultManager(dataModelResult.getName(), writeRuntimeResults);
        	this.workloadExecutor = workloadExecutor;
        	this.parser = parser;
+       	this.writeRuntimeResults = writeRuntimeResults;
     }
 
     /**
@@ -105,16 +106,25 @@ class MultiThreadedRunner implements Callable<Void> {
                 if (!timedQuery(i+1)) {
                     break;
                 }
-                if ((EnvironmentEdgeManager.currentTimeMillis() - lastResultWritten) > 1000) {
+                if (writeRuntimeResults &&
+                        (EnvironmentEdgeManager.currentTimeMillis() - lastResultWritten) > 1000) {
                     resultManager.write(dataModelResult, ruleApplier);
                     lastResultWritten = EnvironmentEdgeManager.currentTimeMillis();
                 }
             }
         }
 
+        if (!writeRuntimeResults) {
+            long duration = EnvironmentEdgeManager.currentTimeMillis() - threadStartTime;
+            LOGGER.info("The read query " + query.getStatement() + " for this thread in ("
+                    + duration + ") Ms");
+        }
+
         // Make sure all result have been dumped before exiting
-        synchronized (workloadExecutor) {
-            resultManager.flush();
+        if (writeRuntimeResults) {
+            synchronized (workloadExecutor) {
+                resultManager.flush();
+            }
         }
 
         LOGGER.info("\n\nThread exiting." + threadName + "\n\n");