You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@iotdb.apache.org by ji...@apache.org on 2022/10/07 08:41:48 UTC

[iotdb] branch expr_vgraft updated: record commit time

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

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


The following commit(s) were added to refs/heads/expr_vgraft by this push:
     new 84a7805722 record commit time
84a7805722 is described below

commit 84a780572219816b19bb1866d614b23359b17544
Author: Tian Jiang <jt...@163.com>
AuthorDate: Fri Oct 7 16:41:41 2022 +0800

    record commit time
---
 cluster/src/main/java/org/apache/iotdb/cluster/log/VotingLogList.java | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/cluster/src/main/java/org/apache/iotdb/cluster/log/VotingLogList.java b/cluster/src/main/java/org/apache/iotdb/cluster/log/VotingLogList.java
index 9b180d9073..fde20d18bf 100644
--- a/cluster/src/main/java/org/apache/iotdb/cluster/log/VotingLogList.java
+++ b/cluster/src/main/java/org/apache/iotdb/cluster/log/VotingLogList.java
@@ -37,6 +37,8 @@ import java.util.concurrent.Executors;
 import java.util.concurrent.ScheduledExecutorService;
 import java.util.concurrent.TimeUnit;
 
+import static org.apache.iotdb.cluster.server.monitor.Timer.Statistic.RAFT_SENDER_COMMIT_LOG_IN_MANAGER;
+
 public class VotingLogList {
 
   private static final Logger logger = LoggerFactory.getLogger(VotingLogList.class);
@@ -56,11 +58,13 @@ public class VotingLogList {
           long newCommitIndex = computeNewCommitIndex();
           if (newCommitIndex > member.getLogManager().getCommitLogIndex()) {
             synchronized (member.getLogManager()) {
+              long operationStartTime = RAFT_SENDER_COMMIT_LOG_IN_MANAGER.getOperationStartTime();
               try {
                 member.getLogManager().commitTo(newCommitIndex);
               } catch (LogExecutionException e) {
                 logger.error("Fail to commit {}", newCommitIndex, e);
               }
+              RAFT_SENDER_COMMIT_LOG_IN_MANAGER.calOperationCostTimeFromStart(operationStartTime);
             }
           }
         },