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 654984206ba [feature](profile) add avg/min/max info in uint counter
#27883
654984206ba is described below
commit 654984206ba31dc2562d14b61df1d54a5c87fc3a
Author: Mryange <[email protected]>
AuthorDate: Sat Dec 2 17:32:35 2023 +0800
[feature](profile) add avg/min/max info in uint counter #27883
---
.../main/java/org/apache/doris/common/util/AggCounter.java | 12 +++++++++++-
.../java/org/apache/doris/common/util/RuntimeProfile.java | 1 +
2 files changed, 12 insertions(+), 1 deletion(-)
diff --git
a/fe/fe-core/src/main/java/org/apache/doris/common/util/AggCounter.java
b/fe/fe-core/src/main/java/org/apache/doris/common/util/AggCounter.java
index 69380e14543..3f080b3752f 100644
--- a/fe/fe-core/src/main/java/org/apache/doris/common/util/AggCounter.java
+++ b/fe/fe-core/src/main/java/org/apache/doris/common/util/AggCounter.java
@@ -68,7 +68,17 @@ public class AggCounter extends Counter {
+ RuntimeProfile.printCounter(min.getValue(),
min.getType());
return infoString;
} else {
- String infoString = RuntimeProfile.printCounter(sum.getValue(),
sum.getType());
+ Counter avg = new Counter(sum.getType(), sum.getValue());
+ avg.divValue(number);
+ String infoString = ""
+ + RuntimeProfile.SUM_TIME_PRE
+ + RuntimeProfile.printCounter(sum.getValue(),
sum.getType()) + ", "
+ + RuntimeProfile.AVG_TIME_PRE
+ + RuntimeProfile.printCounter(avg.getValue(),
avg.getType()) + ", "
+ + RuntimeProfile.MAX_TIME_PRE
+ + RuntimeProfile.printCounter(max.getValue(),
max.getType()) + ", "
+ + RuntimeProfile.MIN_TIME_PRE
+ + RuntimeProfile.printCounter(min.getValue(),
min.getType());
return infoString;
}
}
diff --git
a/fe/fe-core/src/main/java/org/apache/doris/common/util/RuntimeProfile.java
b/fe/fe-core/src/main/java/org/apache/doris/common/util/RuntimeProfile.java
index 080336871d1..c95b5f37386 100644
--- a/fe/fe-core/src/main/java/org/apache/doris/common/util/RuntimeProfile.java
+++ b/fe/fe-core/src/main/java/org/apache/doris/common/util/RuntimeProfile.java
@@ -51,6 +51,7 @@ public class RuntimeProfile {
public static String MAX_TIME_PRE = "max ";
public static String MIN_TIME_PRE = "min ";
public static String AVG_TIME_PRE = "avg ";
+ public static String SUM_TIME_PRE = "sum ";
private Counter counterTotalTime;
private double localTimePercent;
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]