This is an automated email from the ASF dual-hosted git repository.
yiguolei 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 0b606a421fc [feature](profile )merge of profiles can be disabled by
profile level. #29861
0b606a421fc is described below
commit 0b606a421fc98730d4ab1b835fbaab2b8ffbb316
Author: Mryange <[email protected]>
AuthorDate: Thu Jan 11 21:04:30 2024 +0800
[feature](profile )merge of profiles can be disabled by profile level.
#29861
The merging of profiles requires ensuring the correctness of the profiles
themselves. However, if merging is intended for troubleshooting correctness
issues through profiles, errors may occur.
Moreover, the 'try-catch' does not catch exceptions related to profile
merging. If merging fails, even the normal profile cannot be obtained.
---
.../java/org/apache/doris/common/profile/Profile.java | 19 +++++++++++++++----
.../java/org/apache/doris/qe/SessionVariable.java | 2 +-
2 files changed, 16 insertions(+), 5 deletions(-)
diff --git
a/fe/fe-core/src/main/java/org/apache/doris/common/profile/Profile.java
b/fe/fe-core/src/main/java/org/apache/doris/common/profile/Profile.java
index 383880b2c82..19a51a1aaa6 100644
--- a/fe/fe-core/src/main/java/org/apache/doris/common/profile/Profile.java
+++ b/fe/fe-core/src/main/java/org/apache/doris/common/profile/Profile.java
@@ -42,6 +42,7 @@ import java.util.Map;
*/
public class Profile {
private static final Logger LOG = LogManager.getLogger(Profile.class);
+ private static final int MergedProfileLevel = 1;
private RuntimeProfile rootProfile;
private SummaryProfile summaryProfile;
private AggregatedProfile aggregatedProfile;
@@ -49,6 +50,8 @@ public class Profile {
private boolean isFinished;
private Map<Integer, String> planNodeMap;
+ private int profileLevel = 3;
+
public Profile(String name, boolean isEnable) {
this.rootProfile = new RuntimeProfile(name);
this.summaryProfile = new SummaryProfile(rootProfile);
@@ -86,6 +89,7 @@ public class Profile {
rootProfile.setIsPipelineX(isPipelineX);
ProfileManager.getInstance().pushProfile(this);
this.isFinished = isFinished;
+ this.profileLevel = profileLevel;
} catch (Throwable t) {
LOG.warn("update profile failed", t);
throw t;
@@ -105,14 +109,21 @@ public class Profile {
// add summary to builder
summaryProfile.prettyPrint(builder);
LOG.info(builder.toString());
- builder.append("\n MergedProfile \n");
-
aggregatedProfile.getAggregatedFragmentsProfile(planNodeMap).prettyPrint(builder,
" ");
+ if (this.profileLevel == MergedProfileLevel) {
+ try {
+ builder.append("\n MergedProfile \n");
+
aggregatedProfile.getAggregatedFragmentsProfile(planNodeMap).prettyPrint(builder,
" ");
+ } catch (Throwable aggProfileException) {
+ LOG.warn("build merged simple profile failed",
aggProfileException);
+ builder.append("build merged simple profile failed");
+ }
+ }
try {
builder.append("\n");
executionProfile.getExecutionProfile().prettyPrint(builder, "");
} catch (Throwable aggProfileException) {
- LOG.warn("build merged simple profile failed",
aggProfileException);
- builder.append("build merged simple profile failed");
+ LOG.warn("build profile failed", aggProfileException);
+ builder.append("build profile failed");
}
return builder.toString();
}
diff --git a/fe/fe-core/src/main/java/org/apache/doris/qe/SessionVariable.java
b/fe/fe-core/src/main/java/org/apache/doris/qe/SessionVariable.java
index 9c8546a98e4..8f51cf20992 100644
--- a/fe/fe-core/src/main/java/org/apache/doris/qe/SessionVariable.java
+++ b/fe/fe-core/src/main/java/org/apache/doris/qe/SessionVariable.java
@@ -722,7 +722,7 @@ public class SessionVariable implements Serializable,
Writable {
public int parallelPipelineTaskNum = 0;
@VariableMgr.VarAttr(name = PROFILE_LEVEL, fuzzy = true)
- public int profileLevel = 3;
+ public int profileLevel = 1;
@VariableMgr.VarAttr(name = MAX_INSTANCE_NUM)
public int maxInstanceNum = 64;
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]