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

jackietien pushed a commit to branch ty-graduate
in repository https://gitbox.apache.org/repos/asf/iotdb.git


The following commit(s) were added to refs/heads/ty-graduate by this push:
     new 557442d  add flush time cost
557442d is described below

commit 557442d49ddc855d646d63f62c7235f6901a027a
Author: JackieTien97 <[email protected]>
AuthorDate: Tue Jan 18 20:16:24 2022 +0800

    add flush time cost
---
 .../java/org/apache/iotdb/db/engine/flush/MemTableFlushTask.java  | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git 
a/server/src/main/java/org/apache/iotdb/db/engine/flush/MemTableFlushTask.java 
b/server/src/main/java/org/apache/iotdb/db/engine/flush/MemTableFlushTask.java
index 3501db0..489e7b1 100644
--- 
a/server/src/main/java/org/apache/iotdb/db/engine/flush/MemTableFlushTask.java
+++ 
b/server/src/main/java/org/apache/iotdb/db/engine/flush/MemTableFlushTask.java
@@ -71,6 +71,8 @@ public class MemTableFlushTask {
   private volatile long memSerializeTime = 0L;
   private volatile long ioTime = 0L;
 
+  private long totalCostTime = 0L;
+
   /**
    * @param memTable the memTable to flush
    * @param writer the writer where memTable will be flushed to (current 
tsfile writer or vm writer)
@@ -166,11 +168,15 @@ public class MemTableFlushTask {
               "flush");
     }
 
+    long costTime = System.currentTimeMillis() - start;
     LOGGER.info(
         "Storage group {} memtable {} flushing a memtable has finished! Time 
consumption: {}ms",
         storageGroup,
         memTable,
-        System.currentTimeMillis() - start);
+            costTime);
+
+    totalCostTime += costTime;
+    LOGGER.info("Cumulative flush cost time: {}", totalCostTime);
   }
 
   /** encoding task (second task of pipeline) */

Reply via email to