Skip to content

Commit

Permalink
[feature](profile) add avg/min/max info in uint counter #27883
Browse files Browse the repository at this point in the history
  • Loading branch information
Mryange authored Dec 2, 2023
1 parent 934f37e commit 6549842
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,17 @@ public String print() {
+ 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;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down

0 comments on commit 6549842

Please sign in to comment.