You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@iotdb.apache.org by xi...@apache.org on 2022/08/01 12:21:38 UTC
[iotdb] branch ml_0729_test_exp1 updated: add metrics for queue
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 4c90040446 add metrics for queue
4c90040446 is described below
commit 4c900404464374ffc67e270d7484ff771a8c3745
Author: Jinrui.Zhang <xi...@gmail.com>
AuthorDate: Mon Aug 1 20:21:27 2022 +0800
add metrics for queue
---
.../db/consensus/statemachine/DataRegionStateMachine.java | 13 +++++++++----
1 file changed, 9 insertions(+), 4 deletions(-)
diff --git a/server/src/main/java/org/apache/iotdb/db/consensus/statemachine/DataRegionStateMachine.java b/server/src/main/java/org/apache/iotdb/db/consensus/statemachine/DataRegionStateMachine.java
index 32847e2eb4..ca9628b28c 100644
--- a/server/src/main/java/org/apache/iotdb/db/consensus/statemachine/DataRegionStateMachine.java
+++ b/server/src/main/java/org/apache/iotdb/db/consensus/statemachine/DataRegionStateMachine.java
@@ -120,11 +120,16 @@ public class DataRegionStateMachine extends BaseStateMachine {
List<InsertNode> insertNodes,
AsyncMethodCallback<TSyncLogRes> resultHandler) {
synchronized (requestCache) {
- requestCache.add(new InsertNodeWrapper(syncIndex, insertNodes, resultHandler));
- if (requestCache.size() == MAX_REQUEST_CACHE_SIZE) {
- return requestCache.poll();
+ long startTime = System.nanoTime();
+ try {
+ requestCache.add(new InsertNodeWrapper(syncIndex, insertNodes, resultHandler));
+ if (requestCache.size() == MAX_REQUEST_CACHE_SIZE) {
+ return requestCache.poll();
+ }
+ return null;
+ } finally {
+ StepTracker.trace("cacheAndGet", startTime, System.nanoTime());
}
- return null;
}
}