You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by mo...@apache.org on 2022/10/20 00:51:42 UTC
[doris] branch master updated: [Enhancement](profile) support configure the number of query profile (#13421)
This is an automated email from the ASF dual-hosted git repository.
morningman pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/doris.git
The following commit(s) were added to refs/heads/master by this push:
new 697fa5f586 [Enhancement](profile) support configure the number of query profile (#13421)
697fa5f586 is described below
commit 697fa5f586c0fe753b55c8d63c3a1fb0e1176d78
Author: xueweizhang <zx...@163.com>
AuthorDate: Thu Oct 20 08:51:36 2022 +0800
[Enhancement](profile) support configure the number of query profile (#13421)
Signed-off-by: nextdreamblue <zx...@163.com>
---
docs/en/docs/admin-manual/config/fe-config.md | 10 ++++++++++
docs/zh-CN/docs/admin-manual/config/fe-config.md | 12 +++++++++++-
fe/fe-core/src/main/java/org/apache/doris/common/Config.java | 6 ++++++
.../java/org/apache/doris/common/util/ProfileManager.java | 5 +++--
4 files changed, 30 insertions(+), 3 deletions(-)
diff --git a/docs/en/docs/admin-manual/config/fe-config.md b/docs/en/docs/admin-manual/config/fe-config.md
index bcb0713bf7..674437e670 100644
--- a/docs/en/docs/admin-manual/config/fe-config.md
+++ b/docs/en/docs/admin-manual/config/fe-config.md
@@ -2232,3 +2232,13 @@ The latest data version currently supported, cannot be modified, and should be c
### `min_be_exec_version`
The oldest data version currently supported, which cannot be modified, should be consistent with the `HeartbeatServer::min_be_exec_version` in the BE of the matching version.
+
+### `max_query_profile_num`
+
+The max number of query profile.
+
+Default: 100
+
+Is it possible to dynamically configure: true
+
+Is it a configuration item unique to the Master FE node: false
diff --git a/docs/zh-CN/docs/admin-manual/config/fe-config.md b/docs/zh-CN/docs/admin-manual/config/fe-config.md
index a221bcea51..bc00e0d649 100644
--- a/docs/zh-CN/docs/admin-manual/config/fe-config.md
+++ b/docs/zh-CN/docs/admin-manual/config/fe-config.md
@@ -2286,4 +2286,14 @@ load 标签清理器将每隔 `label_clean_interval_second` 运行一次以清
### `min_be_exec_version`
-目前支持的最旧数据版本,不可修改,应与配套版本的BE中的`HeartbeatServer::min_data_version`一致。
\ No newline at end of file
+目前支持的最旧数据版本,不可修改,应与配套版本的BE中的`HeartbeatServer::min_data_version`一致。
+
+### `max_query_profile_num`
+
+用于设置保存查询的 profile 的最大个数。
+
+默认值:100
+
+是否可以动态配置:true
+
+是否为 Master FE 节点独有的配置项:false
diff --git a/fe/fe-core/src/main/java/org/apache/doris/common/Config.java b/fe/fe-core/src/main/java/org/apache/doris/common/Config.java
index 607db27e82..3db76156f1 100644
--- a/fe/fe-core/src/main/java/org/apache/doris/common/Config.java
+++ b/fe/fe-core/src/main/java/org/apache/doris/common/Config.java
@@ -1788,4 +1788,10 @@ public class Config extends ConfigBase {
@ConfField(mutable = false)
public static int statistic_task_scheduler_execution_interval_ms = 60 * 1000;
+ /**
+ * Max query profile num.
+ */
+ @ConfField(mutable = true, masterOnly = false)
+ public static int max_query_profile_num = 100;
+
}
diff --git a/fe/fe-core/src/main/java/org/apache/doris/common/util/ProfileManager.java b/fe/fe-core/src/main/java/org/apache/doris/common/util/ProfileManager.java
index 7223169122..5d22ed5197 100644
--- a/fe/fe-core/src/main/java/org/apache/doris/common/util/ProfileManager.java
+++ b/fe/fe-core/src/main/java/org/apache/doris/common/util/ProfileManager.java
@@ -18,6 +18,7 @@
package org.apache.doris.common.util;
import org.apache.doris.common.AnalysisException;
+import org.apache.doris.common.Config;
import org.apache.doris.common.profile.MultiProfileTreeBuilder;
import org.apache.doris.common.profile.ProfileTreeBuilder;
import org.apache.doris.common.profile.ProfileTreeNode;
@@ -53,7 +54,7 @@ import java.util.concurrent.locks.ReentrantReadWriteLock.WriteLock;
public class ProfileManager {
private static final Logger LOG = LogManager.getLogger(ProfileManager.class);
private static volatile ProfileManager INSTANCE = null;
- private static final int ARRAY_SIZE = 100;
+ // private static final int ARRAY_SIZE = 100;
// private static final int TOTAL_LEN = 1000 * ARRAY_SIZE ;
public static final String QUERY_ID = "Query ID";
public static final String START_TIME = "Start Time";
@@ -152,7 +153,7 @@ public class ProfileManager {
writeLock.lock();
try {
if (!queryIdDeque.contains(queryId)) {
- if (queryIdDeque.size() >= ARRAY_SIZE) {
+ if (queryIdDeque.size() >= Config.max_query_profile_num) {
queryIdToProfileMap.remove(queryIdDeque.getFirst());
queryIdDeque.removeFirst();
}
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org