profiler command support framebuf option. #1476

This commit is contained in:
hengyunabc 2020-09-07 16:39:12 +08:00
parent 2d4c59d1ce
commit 41f86ac5ca

View File

@ -56,7 +56,7 @@ import one.profiler.Counter;
+ " profiler dumpFlat # Dump flat profile, i.e. the histogram of the hottest methods\n"
+ " profiler dumpCollapsed # Dump profile in 'collapsed stacktraces' format\n"
+ " profiler dumpTraces # Dump collected stack traces\n"
+ " profiler execute 'start' # Execute an agent-compatible profiling command\n"
+ " profiler execute 'start,framebuf=5000000' # Execute an agent-compatible profiling command\n"
+ " profiler execute 'stop,file=/tmp/result.svg' # Execute an agent-compatible profiling command\n"
+ Constants.WIKI + Constants.WIKI_HOME + "profiler")
//@formatter:on
@ -79,6 +79,11 @@ public class ProfilerCommand extends AnnotatedCommand {
*/
private Long interval;
/**
* size of the buffer for stack frames (default: 1'000'000)
*/
private Long framebuf;
/**
* profile different threads separately
*/
@ -150,6 +155,13 @@ public class ProfilerCommand extends AnnotatedCommand {
this.interval = interval;
}
@Option(shortName = "b", longName = "framebuf")
@Description("size of the buffer for stack frames (default: 1'000'000)")
@DefaultValue("1000000")
public void setFramebuf(long framebuf) {
this.framebuf = framebuf;
}
@Option(shortName = "f", longName = "file")
@Description("dump output to <filename>")
public void setFile(String file) {
@ -247,6 +259,9 @@ public class ProfilerCommand extends AnnotatedCommand {
if (this.interval != null) {
sb.append("interval=").append(this.interval).append(',');
}
if (this.framebuf != null) {
sb.append("framebuf=").append(this.framebuf).append(',');
}
if (this.threads) {
sb.append("threads").append(',');
}