HBASE-25685 asyncprofiler2.0 no longer supports svg; wants html (#3079)

Signed-off-by: Wei-Chiu Chuang <weichiu@apache.org>
This commit is contained in:
Michael Stack 2021-03-22 21:24:58 -07:00 committed by stack
parent 87d05334c5
commit 202b17f4fc
1 changed files with 8 additions and 5 deletions

View File

@ -48,7 +48,7 @@ import org.apache.hbase.thirdparty.com.google.common.base.Joiner;
* // -b bufsize frame buffer size (long) * // -b bufsize frame buffer size (long)
* // -t profile different threads separately * // -t profile different threads separately
* // -s simple class names instead of FQN * // -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) * // --width px SVG width pixels (integer)
* // --height px SVG frame height pixels (integer) * // --height px SVG frame height pixels (integer)
* // --minwidth px skip frames smaller than px (double) * // --minwidth px skip frames smaller than px (double)
@ -145,9 +145,12 @@ public class ProfileServlet extends HttpServlet {
TRACES, TRACES,
FLAT, FLAT,
COLLAPSED, COLLAPSED,
// No SVG in 2.x asyncprofiler.
SVG, SVG,
TREE, TREE,
JFR JFR,
// In 2.x asyncprofiler, this is how you get flamegraphs.
HTML
} }
@edu.umd.cs.findbugs.annotations.SuppressWarnings(value = "SE_TRANSIENT_FIELD_NOT_RESTORED", @edu.umd.cs.findbugs.annotations.SuppressWarnings(value = "SE_TRANSIENT_FIELD_NOT_RESTORED",
@ -358,10 +361,10 @@ public class ProfileServlet extends HttpServlet {
try { try {
return Output.valueOf(outputArg.trim().toUpperCase()); return Output.valueOf(outputArg.trim().toUpperCase());
} catch (IllegalArgumentException e) { } catch (IllegalArgumentException e) {
return Output.SVG; return Output.HTML;
} }
} }
return Output.SVG; return Output.HTML;
} }
static void setResponseHeader(final HttpServletResponse response) { static void setResponseHeader(final HttpServletResponse response) {
@ -390,7 +393,7 @@ public class ProfileServlet extends HttpServlet {
resp.setStatus(HttpServletResponse.SC_INTERNAL_SERVER_ERROR); resp.setStatus(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
setResponseHeader(resp); setResponseHeader(resp);
resp.getWriter().write("The profiler servlet was disabled at startup.\n\n" + resp.getWriter().write("The profiler servlet was disabled at startup.\n\n" +
"Please ensure the prerequsites for the Profiler Servlet have been installed and the\n" + "Please ensure the prerequisites for the Profiler Servlet have been installed and the\n" +
"environment is properly configured. For more information please see\n" + "environment is properly configured. For more information please see\n" +
"http://hbase.apache.org/book.html#profiler\n"); "http://hbase.apache.org/book.html#profiler\n");
return; return;