You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@iotdb.apache.org by xi...@apache.org on 2023/04/18 04:52:40 UTC

[iotdb] branch guonengtest updated: add read loop in log

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

xingtanzjr pushed a commit to branch guonengtest
in repository https://gitbox.apache.org/repos/asf/iotdb.git


The following commit(s) were added to refs/heads/guonengtest by this push:
     new 7333f9e149 add read loop in log
7333f9e149 is described below

commit 7333f9e14908d605401d5d5f100be7b4006b4d29
Author: Jinrui.Zhang <xi...@gmail.com>
AuthorDate: Tue Apr 18 12:51:36 2023 +0800

    add read loop in log
---
 example/session/src/main/java/org/apache/iotdb/ReadTest.java | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/example/session/src/main/java/org/apache/iotdb/ReadTest.java b/example/session/src/main/java/org/apache/iotdb/ReadTest.java
index 829eb5168f..8166bc883e 100644
--- a/example/session/src/main/java/org/apache/iotdb/ReadTest.java
+++ b/example/session/src/main/java/org/apache/iotdb/ReadTest.java
@@ -103,7 +103,7 @@ public class ReadTest {
       }
     }
 
-    protected void finishReadAndWait(long cost) throws InterruptedException {
+    protected void finishReadAndWait(long cost, int loopIndex) throws InterruptedException {
       CountDownLatch currentLatch = latch;
       totalCost += cost;
       synchronized (this) {
@@ -113,8 +113,9 @@ public class ReadTest {
           long totalCost = (System.nanoTime() - currentTimestamp);
           LOGGER.info(
               String.format(
-                  "[%s] finished with %d thread. AVG COST: %.3fms. TOTAL COST: %.3fms",
+                  "[%s][%d] finished with %d thread. AVG COST: %.3fms. TOTAL COST: %.3fms",
                   this.queryName,
+                  loopIndex,
                   this.count,
                   this.totalCost * 1.0 / this.count / 1_000_000,
                   totalCost * 1.0 / 1_000_000));
@@ -203,7 +204,7 @@ public class ReadTest {
           long startTime = System.nanoTime();
           executeQuery();
           long cost = System.nanoTime() - startTime;
-          signal.finishReadAndWait(cost);
+          signal.finishReadAndWait(cost, i);
         } catch (InterruptedException | IoTDBConnectionException | StatementExecutionException e) {
           throw new RuntimeException(e);
         }