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

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


The following commit(s) were added to refs/heads/iotdb-3791 by this push:
     new 7f962e027b add more metrics
7f962e027b is described below

commit 7f962e027b1be0d1988d5ce6c145e3520734b8e7
Author: Jinrui.Zhang <[email protected]>
AuthorDate: Thu Jul 14 21:13:03 2022 +0800

    add more metrics
---
 .../consensus/multileader/service/MultiLeaderRPCServiceProcessor.java | 4 ++++
 1 file changed, 4 insertions(+)

diff --git 
a/consensus/src/main/java/org/apache/iotdb/consensus/multileader/service/MultiLeaderRPCServiceProcessor.java
 
b/consensus/src/main/java/org/apache/iotdb/consensus/multileader/service/MultiLeaderRPCServiceProcessor.java
index 07849f86bd..e0ddd7f256 100644
--- 
a/consensus/src/main/java/org/apache/iotdb/consensus/multileader/service/MultiLeaderRPCServiceProcessor.java
+++ 
b/consensus/src/main/java/org/apache/iotdb/consensus/multileader/service/MultiLeaderRPCServiceProcessor.java
@@ -54,6 +54,7 @@ public class MultiLeaderRPCServiceProcessor implements 
MultiLeaderConsensusIServ
   public void syncLog(TSyncLogReq req, AsyncMethodCallback<TSyncLogRes> 
resultHandler) {
     long startTime = System.nanoTime();
     try {
+      long prepareStartTime = System.nanoTime();
       ConsensusGroupId groupId =
           
ConsensusGroupId.Factory.createFromTConsensusGroupId(req.getConsensusGroupId());
       MultiLeaderServerImpl impl = consensus.getImpl(groupId);
@@ -69,8 +70,11 @@ public class MultiLeaderRPCServiceProcessor implements 
MultiLeaderConsensusIServ
         return;
       }
       List<TSStatus> statuses = new ArrayList<>();
+      StepTracker.trace("syncLogPrepare", 10, prepareStartTime, 
System.nanoTime());
       // We use synchronized to ensure atomicity of executing multiple logs
+      long lockWaitingStartTime = System.nanoTime();
       synchronized (impl.getStateMachine()) {
+        StepTracker.trace("syncLogWaitingLock", 10, lockWaitingStartTime, 
System.nanoTime());
         StepTracker.trace("req.getBatches().size()", 10, 0, 
req.getBatches().size() * 1000_000L);
         for (TLogBatch batch : req.getBatches()) {
           long writeOneBatch = System.nanoTime();

Reply via email to