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

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


The following commit(s) were added to refs/heads/ml_0729_test_exp1 by this push:
     new e873f1986d add metrics for batch size
e873f1986d is described below

commit e873f1986d799671fecd690d6fe90778c6346b07
Author: Jinrui.Zhang <[email protected]>
AuthorDate: Fri Aug 5 10:41:54 2022 +0800

    add metrics for batch size
---
 .../iotdb/consensus/multileader/logdispatcher/LogDispatcher.java       | 3 ++-
 .../consensus/multileader/service/MultiLeaderRPCServiceProcessor.java  | 3 ++-
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git 
a/consensus/src/main/java/org/apache/iotdb/consensus/multileader/logdispatcher/LogDispatcher.java
 
b/consensus/src/main/java/org/apache/iotdb/consensus/multileader/logdispatcher/LogDispatcher.java
index b08069aa9e..c951ec83c3 100644
--- 
a/consensus/src/main/java/org/apache/iotdb/consensus/multileader/logdispatcher/LogDispatcher.java
+++ 
b/consensus/src/main/java/org/apache/iotdb/consensus/multileader/logdispatcher/LogDispatcher.java
@@ -227,7 +227,8 @@ public class LogDispatcher {
           // we may block here if the synchronization pipeline is full
           long getBatchSlotStartTime = System.nanoTime();
           syncStatus.addNextBatch(batch);
-          StepTracker.trace("getBatchSlot", getBatchSlotStartTime, 
System.nanoTime());
+          StepTracker.trace("batchSize", 25, 0, batch.getBatches().size() * 
1000_000L);
+          StepTracker.trace("getBatchSlot", 25, getBatchSlotStartTime, 
System.nanoTime());
           // sends batch asynchronously and migrates the retry logic into the 
callback handler
           sendBatchAsync(batch, new DispatchLogHandler(this, batch));
         }
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 a9c97fa4d0..ad1304a608 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
@@ -99,7 +99,8 @@ public class MultiLeaderRPCServiceProcessor implements 
MultiLeaderConsensusIServ
         }
         long followerWriteRequestStartTime = System.nanoTime();
         impl.getStateMachine().multiLeaderWriteAsync(indexedConsensusRequests, 
resultHandler);
-        StepTracker.trace("followerWriteRequest", 
followerWriteRequestStartTime, System.nanoTime());
+        StepTracker.trace(
+            "followerWriteRequest", 25, followerWriteRequestStartTime, 
System.nanoTime());
       }
     } catch (Exception e) {
       resultHandler.onError(e);

Reply via email to