Skip to content

Commit

Permalink
TEZ-4568: ProfileServlet: add html to output formats
Browse files Browse the repository at this point in the history
  • Loading branch information
abstractdog committed Jun 5, 2024
1 parent 38c5aac commit 3bf838f
Showing 1 changed file with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -50,19 +50,19 @@
* // -m method fully qualified method name: 'ClassName.methodName'
* // -t profile different threads separately
* // -s simple class names instead of FQN
* // -o fmt[,fmt...] output format: summary|traces|flat|collapsed|svg|tree|jfr
* // -o fmt[,fmt...] output format: summary|traces|flat|collapsed|svg|tree|jfr|html
* // --width px SVG width pixels (integer)
* // --height px SVG frame height pixels (integer)
* // --minwidth px skip frames smaller than px (double)
* // --reverse generate stack-reversed FlameGraph / Call tree
* Example:
* - To collect 30 second CPU profile of current process (returns FlameGraph svg)
* - To collect 30 second CPU profile of current process (returns FlameGraph html)
* {@literal curl "http://localhost:10002/prof"}
* - To collect 1 minute CPU profile of current process and output in tree format (html)
* {@literal curl "http://localhost:10002/prof?output=tree&duration=60"}
* - To collect 30 second heap allocation profile of current process (returns FlameGraph svg)
* - To collect 30 second heap allocation profile of current process (returns FlameGraph html)
* {@literal curl "http://localhost:10002/prof?event=alloc"}
* - To collect lock contention profile of current process (returns FlameGraph svg)
* - To collect lock contention profile of current process (returns FlameGraph html)
* {@literal curl "http://localhost:10002/prof?event=lock"}
* Following event types are supported (default is 'cpu') (NOTE: not all OS'es support all events)
* // Perf events:
Expand Down Expand Up @@ -140,7 +140,7 @@ public static Event fromInternalName(final String name) {
}

enum Output {
SUMMARY, TRACES, FLAT, COLLAPSED, SVG, TREE, JFR
SUMMARY, TRACES, FLAT, COLLAPSED, SVG, TREE, JFR, HTML
}

private final Lock profilerLock = new ReentrantLock();
Expand Down Expand Up @@ -349,11 +349,11 @@ private Output getOutput(final HttpServletRequest req) {
try {
return Output.valueOf(outputArg.trim().toUpperCase());
} catch (IllegalArgumentException e) {
LOG.warn("Output format value is invalid, returning with default SVG");
return Output.SVG;
LOG.warn("Output format value is invalid, returning with default HTML");
return Output.HTML;
}
}
return Output.SVG;
return Output.HTML;
}

private void setResponseHeader(final HttpServletResponse response) {
Expand Down

0 comments on commit 3bf838f

Please sign in to comment.