Skip to content

Commit

Permalink
Update profiler command: add total option
Browse files Browse the repository at this point in the history
  • Loading branch information
Winson-Huang committed Aug 12, 2023
1 parent 99abc9d commit 9393d51
Showing 1 changed file with 14 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,11 @@ public class ProfilerCommand extends AnnotatedCommand {
*/
private boolean reverse;

/**
* count the total value (time, bytes, etc.) instead of samples
*/
private boolean total;

private static String libPath;
private static AsyncProfiler profiler = null;

Expand Down Expand Up @@ -328,6 +333,12 @@ public void setReverse(boolean reverse) {
this.reverse = reverse;
}

@Option(longName = "total", flag = true)
@Description("count the total value (time, bytes, etc.) instead of samples")
public void setTotal(boolean total) {
this.total = total;
}

private AsyncProfiler profilerInstance() {
if (profiler != null) {
return profiler;
Expand Down Expand Up @@ -445,6 +456,9 @@ private String executeArgs(ProfilerAction action) {
if (this.reverse) {
sb.append("reverse").append(',');
}
if (this.total) {
sb.append("total").append(',');
}

return sb.toString();
}
Expand Down

0 comments on commit 9393d51

Please sign in to comment.