Skip to content

Commit 1f956e9

Browse files
committed
add config
Signed-off-by: Weihao Li <[email protected]>
1 parent 7436c88 commit 1f956e9

File tree

6 files changed

+34
-0
lines changed

6 files changed

+34
-0
lines changed

integration-test/src/main/java/org/apache/iotdb/it/env/cluster/config/MppDataNodeConfig.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,4 +137,10 @@ public DataNodeConfig setDataNodeMemoryProportion(String dataNodeMemoryProportio
137137
setProperty("datanode_memory_proportion", dataNodeMemoryProportion);
138138
return this;
139139
}
140+
141+
@Override
142+
public DataNodeConfig setQueryCostStatWindow(int queryCostStatWindow) {
143+
setProperty("query_cost_stat_window", String.valueOf(queryCostStatWindow));
144+
return this;
145+
}
140146
}

integration-test/src/main/java/org/apache/iotdb/it/env/remote/config/RemoteDataNodeConfig.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,4 +93,9 @@ public DataNodeConfig setDeleteWalFilesPeriodInMs(long deleteWalFilesPeriodInMs)
9393
public DataNodeConfig setDataNodeMemoryProportion(String dataNodeMemoryProportion) {
9494
return this;
9595
}
96+
97+
@Override
98+
public DataNodeConfig setQueryCostStatWindow(int queryCostStatWindow) {
99+
return this;
100+
}
96101
}

integration-test/src/main/java/org/apache/iotdb/itbase/env/DataNodeConfig.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,4 +51,6 @@ DataNodeConfig setLoadTsFileAnalyzeSchemaMemorySizeInBytes(
5151
DataNodeConfig setDeleteWalFilesPeriodInMs(long deleteWalFilesPeriodInMs);
5252

5353
DataNodeConfig setDataNodeMemoryProportion(String dataNodeMemoryProportion);
54+
55+
DataNodeConfig setQueryCostStatWindow(int queryCostStatWindow);
5456
}

iotdb-core/datanode/src/main/java/org/apache/iotdb/db/conf/IoTDBConfig.java

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -814,6 +814,9 @@ public class IoTDBConfig {
814814
/** time cost(ms) threshold for slow query. Unit: millisecond */
815815
private long slowQueryThreshold = 10000;
816816

817+
/** time window threshold for record of history queries. Unit: minute */
818+
private int queryCostStatWindow = 0;
819+
817820
private int patternMatchingThreshold = 1000000;
818821

819822
/**
@@ -2612,6 +2615,14 @@ public void setSlowQueryThreshold(long slowQueryThreshold) {
26122615
this.slowQueryThreshold = slowQueryThreshold;
26132616
}
26142617

2618+
public int getQueryCostStatWindow() {
2619+
return queryCostStatWindow;
2620+
}
2621+
2622+
public void setQueryCostStatWindow(int queryCostStatWindow) {
2623+
this.queryCostStatWindow = queryCostStatWindow;
2624+
}
2625+
26152626
public boolean isEnableIndex() {
26162627
return enableIndex;
26172628
}

iotdb-core/datanode/src/main/java/org/apache/iotdb/db/conf/IoTDBDescriptor.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -813,6 +813,11 @@ public void loadProperties(TrimProperties properties) throws BadNodeUrlException
813813
properties.getProperty(
814814
"slow_query_threshold", String.valueOf(conf.getSlowQueryThreshold()))));
815815

816+
conf.setQueryCostStatWindow(
817+
Integer.parseInt(
818+
properties.getProperty(
819+
"query_cost_stat_window", String.valueOf(conf.getQueryCostStatWindow()))));
820+
816821
conf.setDataRegionNum(
817822
Integer.parseInt(
818823
properties.getProperty("data_region_num", String.valueOf(conf.getDataRegionNum()))));

iotdb-core/node-commons/src/assembly/resources/conf/iotdb-system.properties.template

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1080,6 +1080,11 @@ max_tsblock_line_number=1000
10801080
# Datatype: long
10811081
slow_query_threshold=10000
10821082

1083+
# Time window threshold(min) for record of history queries.
1084+
# effectiveMode: hot_reload
1085+
# Datatype: int
1086+
query_cost_stat_window=0
1087+
10831088
# The max executing time of query. unit: ms
10841089
# effectiveMode: restart
10851090
# Datatype: int

0 commit comments

Comments
 (0)