You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@iotdb.apache.org by ta...@apache.org on 2023/08/02 04:17:13 UTC
[iotdb] branch ca_performance created (now a7408c5d5ab)
This is an automated email from the ASF dual-hosted git repository.
tanxinyu pushed a change to branch ca_performance
in repository https://gitbox.apache.org/repos/asf/iotdb.git
at a7408c5d5ab add shuffle
This branch includes the following new commits:
new f3dbca70834 Add concurrent_write_iot_regions_num metric
new a7408c5d5ab add shuffle
The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
[iotdb] 02/02: add shuffle
Posted by ta...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
tanxinyu pushed a commit to branch ca_performance
in repository https://gitbox.apache.org/repos/asf/iotdb.git
commit a7408c5d5ab3fae65f63f53c979a54fec0e56a16
Author: OneSizeFitQuorum <ta...@apache.org>
AuthorDate: Wed Aug 2 12:16:54 2023 +0800
add shuffle
Signed-off-by: OneSizeFitQuorum <ta...@apache.org>
---
.../db/queryengine/plan/planner/plan/node/write/InsertRowsNode.java | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/planner/plan/node/write/InsertRowsNode.java b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/planner/plan/node/write/InsertRowsNode.java
index 61949962285..72ad5990157 100644
--- a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/planner/plan/node/write/InsertRowsNode.java
+++ b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/planner/plan/node/write/InsertRowsNode.java
@@ -37,6 +37,7 @@ import java.io.DataOutputStream;
import java.io.IOException;
import java.nio.ByteBuffer;
import java.util.ArrayList;
+import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@@ -229,7 +230,9 @@ public class InsertRowsNode extends InsertNode {
}
analysis.setRedirectNodeList(redirectInfo);
- return new ArrayList<>(splitMap.values());
+ List<WritePlanNode> res = new ArrayList<>(splitMap.values());
+ Collections.shuffle(res);
+ return res;
}
@Override
[iotdb] 01/02: Add concurrent_write_iot_regions_num metric
Posted by ta...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
tanxinyu pushed a commit to branch ca_performance
in repository https://gitbox.apache.org/repos/asf/iotdb.git
commit f3dbca70834190e50d616e8556e71ca916c8a87c
Author: OneSizeFitQuorum <ta...@apache.org>
AuthorDate: Wed Aug 2 12:15:09 2023 +0800
Add concurrent_write_iot_regions_num metric
Signed-off-by: OneSizeFitQuorum <ta...@apache.org>
---
.../java/org/apache/iotdb/consensus/iot/IoTConsensus.java | 2 --
.../iotdb/consensus/iot/IoTConsensusServerImpl.java | 5 +++--
.../service/metric/PerformanceOverviewMetrics.java | 15 ++++++++++++++-
3 files changed, 17 insertions(+), 5 deletions(-)
diff --git a/iotdb-core/consensus/src/main/java/org/apache/iotdb/consensus/iot/IoTConsensus.java b/iotdb-core/consensus/src/main/java/org/apache/iotdb/consensus/iot/IoTConsensus.java
index 047d557ad55..105fecfbd9a 100644
--- a/iotdb-core/consensus/src/main/java/org/apache/iotdb/consensus/iot/IoTConsensus.java
+++ b/iotdb-core/consensus/src/main/java/org/apache/iotdb/consensus/iot/IoTConsensus.java
@@ -67,9 +67,7 @@ import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.atomic.AtomicBoolean;
public class IoTConsensus implements IConsensus {
-
private final Logger logger = LoggerFactory.getLogger(IoTConsensus.class);
-
private final TEndPoint thisNode;
private final int thisNodeId;
private final File storageDir;
diff --git a/iotdb-core/consensus/src/main/java/org/apache/iotdb/consensus/iot/IoTConsensusServerImpl.java b/iotdb-core/consensus/src/main/java/org/apache/iotdb/consensus/iot/IoTConsensusServerImpl.java
index 0b76a690dba..a0ddb9cc406 100644
--- a/iotdb-core/consensus/src/main/java/org/apache/iotdb/consensus/iot/IoTConsensusServerImpl.java
+++ b/iotdb-core/consensus/src/main/java/org/apache/iotdb/consensus/iot/IoTConsensusServerImpl.java
@@ -88,7 +88,6 @@ import java.util.concurrent.locks.ReentrantLock;
import java.util.regex.Pattern;
public class IoTConsensusServerImpl {
-
private static final String CONFIGURATION_FILE_NAME = "configuration.dat";
private static final String CONFIGURATION_TMP_FILE_NAME = "configuration.dat.tmp";
public static final String SNAPSHOT_DIR_NAME = "snapshot";
@@ -168,8 +167,9 @@ public class IoTConsensusServerImpl {
*/
public TSStatus write(IConsensusRequest request) {
long consensusWriteStartTime = System.nanoTime();
- stateMachineLock.lock();
try {
+ stateMachineLock.lock();
+ PERFORMANCE_OVERVIEW_METRICS.CONCURRENT_WRITE_IOT_REGIONS_COUNTER.increment();
long getStateMachineLockTime = System.nanoTime();
// statistic the time of acquiring stateMachine lock
ioTConsensusServerMetrics.recordGetStateMachineLockTime(
@@ -245,6 +245,7 @@ public class IoTConsensusServerImpl {
System.nanoTime() - consensusWriteStartTime);
return result;
} finally {
+ PERFORMANCE_OVERVIEW_METRICS.CONCURRENT_WRITE_IOT_REGIONS_COUNTER.decrement();
stateMachineLock.unlock();
}
}
diff --git a/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/service/metric/PerformanceOverviewMetrics.java b/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/service/metric/PerformanceOverviewMetrics.java
index 1efbe626335..905b5375d58 100644
--- a/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/service/metric/PerformanceOverviewMetrics.java
+++ b/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/service/metric/PerformanceOverviewMetrics.java
@@ -31,8 +31,10 @@ import org.apache.iotdb.metrics.utils.MetricType;
import java.util.HashMap;
import java.util.Map;
+import java.util.concurrent.atomic.LongAdder;
public class PerformanceOverviewMetrics implements IMetricSet {
+
private static final Map<String, MetricInfo> metricInfoMap = new HashMap<>();
private PerformanceOverviewMetrics() {
@@ -194,16 +196,22 @@ public class PerformanceOverviewMetrics implements IMetricSet {
private static final String PERFORMANCE_OVERVIEW_STORAGE_DETAIL =
Metric.PERFORMANCE_OVERVIEW_STORAGE_DETAIL.toString();
private static final String ENGINE = "engine";
+ private static final String CONCURRENT_WRITE_IOT_REGIONS_NUM = "concurrent_write_iot_regions_num";
static {
metricInfoMap.put(
ENGINE,
new MetricInfo(
MetricType.TIMER, PERFORMANCE_OVERVIEW_STORAGE_DETAIL, Tag.STAGE.toString(), ENGINE));
+ metricInfoMap.put(
+ CONCURRENT_WRITE_IOT_REGIONS_NUM,
+ new MetricInfo(MetricType.AUTO_GAUGE, CONCURRENT_WRITE_IOT_REGIONS_NUM));
}
private Timer engineTimer = DoNothingMetricManager.DO_NOTHING_TIMER;
+ public final LongAdder CONCURRENT_WRITE_IOT_REGIONS_COUNTER = new LongAdder();
+
public void recordEngineCost(long costTimeInNanos) {
engineTimer.updateNanos(costTimeInNanos);
}
@@ -347,7 +355,12 @@ public class PerformanceOverviewMetrics implements IMetricSet {
MetricLevel.CORE,
Tag.STAGE.toString(),
PerformanceOverviewMetrics.ENGINE);
- // bind storageengine metrics
+ metricService.createAutoGauge(
+ CONCURRENT_WRITE_IOT_REGIONS_NUM,
+ MetricLevel.CORE,
+ this.CONCURRENT_WRITE_IOT_REGIONS_COUNTER,
+ LongAdder::doubleValue);
+ // bind storage engine metrics
lockTimer =
metricService.getOrCreateTimer(
PERFORMANCE_OVERVIEW_ENGINE_DETAIL, MetricLevel.CORE, Tag.STAGE.toString(), LOCK);