[feature](profile) add avg/min/max info in uint counter #27883
This commit is contained in:
@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
@ -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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user