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

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


The following commit(s) were added to refs/heads/cluster_tpc by this push:
     new 2614b59  add more timers
2614b59 is described below

commit 2614b59102849febc63d3fe7505ddaaac940fe60
Author: jt <[email protected]>
AuthorDate: Thu Oct 8 15:42:26 2020 +0800

    add more timers
---
 .../iotdb/db/engine/storagegroup/TsFileProcessor.java   | 17 +++++++++++++++++
 .../src/main/java/org/apache/iotdb/db/utils/Timer.java  | 13 +++++++++++--
 2 files changed, 28 insertions(+), 2 deletions(-)

diff --git 
a/server/src/main/java/org/apache/iotdb/db/engine/storagegroup/TsFileProcessor.java
 
b/server/src/main/java/org/apache/iotdb/db/engine/storagegroup/TsFileProcessor.java
index 1140f36..6f4e718 100644
--- 
a/server/src/main/java/org/apache/iotdb/db/engine/storagegroup/TsFileProcessor.java
+++ 
b/server/src/main/java/org/apache/iotdb/db/engine/storagegroup/TsFileProcessor.java
@@ -483,12 +483,18 @@ public class TsFileProcessor {
    * flushManager again.
    */
   private void addAMemtableIntoFlushingList(IMemTable tobeFlushed) throws 
IOException {
+    long start;
+    if (Timer.ENABLE_INSTRUMENTING) {
+      start = System.nanoTime();
+    }
     if (!tobeFlushed.isSignalMemTable() &&
         (!updateLatestFlushTimeCallback.call(this) || tobeFlushed.memSize() == 
0)) {
       logger.warn("This normal memtable is empty, skip it in flush. {}: {} 
Memetable info: {}",
           storageGroupName, tsFileResource.getTsFile().getName(), 
tobeFlushed.getMemTableMap());
       return;
     }
+    Statistic.CLOSE_FILE_UPDATE_FLUSH_TIME.addNanoFromStart(start);
+
     flushingMemTables.addLast(tobeFlushed);
     if (logger.isDebugEnabled()) {
       logger.debug(
@@ -498,14 +504,25 @@ public class TsFileProcessor {
     }
     long cur = versionController.nextVersion();
     tobeFlushed.setVersion(cur);
+
+    if (Timer.ENABLE_INSTRUMENTING) {
+      start = System.nanoTime();
+    }
     if (IoTDBDescriptor.getInstance().getConfig().isEnableWal()) {
       getLogNode().notifyStartFlush();
     }
+    Statistic.CLOSE_FILE_NOTIFY_START_FLUSH.addNanoFromStart(start);
+
+
     if (!tobeFlushed.isSignalMemTable()) {
       totalMemTableSize += tobeFlushed.memSize();
     }
     workMemTable = null;
+    if (Timer.ENABLE_INSTRUMENTING) {
+      start = System.nanoTime();
+    }
     FlushManager.getInstance().registerTsFileProcessor(this);
+    Statistic.CLOSE_FILE_REGISTER_FLUSH.addNanoFromStart(start);
   }
 
 
diff --git a/server/src/main/java/org/apache/iotdb/db/utils/Timer.java 
b/server/src/main/java/org/apache/iotdb/db/utils/Timer.java
index e5053e1..b7bc4c8 100644
--- a/server/src/main/java/org/apache/iotdb/db/utils/Timer.java
+++ b/server/src/main/java/org/apache/iotdb/db/utils/Timer.java
@@ -174,10 +174,19 @@ public class Timer {
         CLOSE_FILE),
     CLOSE_FILE_CLOSE_TSFILE_PROCESSOR(
         STORAGE_ENGINE, "close file - close TsFile processor", TIME_SCALE, 
true,
-        CLOSE_FILE),
+        CLOSE_FILE_CLOSE_SG_PROCESSOR),
     CLOSE_FILE_MOVE_MEMTABLE_TO_FLUSH(
         STORAGE_ENGINE, "close file - move memtable to flush", TIME_SCALE, 
true,
-        CLOSE_FILE);
+        CLOSE_FILE_CLOSE_TSFILE_PROCESSOR),
+    CLOSE_FILE_UPDATE_FLUSH_TIME(
+        STORAGE_ENGINE, "close file - update flush time", TIME_SCALE, true,
+        CLOSE_FILE_MOVE_MEMTABLE_TO_FLUSH),
+    CLOSE_FILE_NOTIFY_START_FLUSH(
+        STORAGE_ENGINE, "close file - notify start flush", TIME_SCALE, true,
+        CLOSE_FILE_MOVE_MEMTABLE_TO_FLUSH),
+    CLOSE_FILE_REGISTER_FLUSH(
+        STORAGE_ENGINE, "close file - register flush", TIME_SCALE, true,
+        CLOSE_FILE_MOVE_MEMTABLE_TO_FLUSH);
 
 
     String className;

Reply via email to