Package org.apache.hadoop.hbase.http
Class ProfileServlet
java.lang.Object
javax.servlet.GenericServlet
javax.servlet.http.HttpServlet
org.apache.hadoop.hbase.http.ProfileServlet
- All Implemented Interfaces:
Serializable
,javax.servlet.Servlet
,javax.servlet.ServletConfig
Servlet that runs async-profiler as web-endpoint. Following options from async-profiler can be
specified as query paramater. // -e event profiling event: cpu|alloc|lock|cache-misses etc. // -d
duration run profiling for 'duration' seconds (integer) // -i interval sampling interval in
nanoseconds (long) // -j jstackdepth maximum Java stack depth (integer) // -b bufsize frame
buffer size (long) // -t profile different threads separately // -s simple class names instead of
FQN // -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) curl
"http://localhost:10002/prof" - To collect 1 minute CPU profile of current process and output in
tree format (html) curl "http://localhost:10002/prof?output=tree&duration=60" - To collect 30
second heap allocation profile of current process (returns FlameGraph svg) curl
"http://localhost:10002/prof?event=alloc" - To collect lock contention profile of current process
(returns FlameGraph svg) 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: // cpu //
page-faults // context-switches // cycles // instructions // cache-references // cache-misses //
branches // branch-misses // bus-cycles // L1-dcache-load-misses // LLC-load-misses //
dTLB-load-misses // mem:breakpoint // trace:tracepoint // Java events: // alloc // lock
- See Also:
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
(package private) static enum
(package private) static enum
-
Field Summary
Modifier and TypeFieldDescriptionprivate static final String
private static final String
private static final String
private static final String
private static final String
private String
private static final String
private static final int
private static final AtomicInteger
private static final org.slf4j.Logger
(package private) static final String
private Integer
private Process
private static final String
private Lock
private static final long
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected void
doGet
(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse resp) (package private) static String
private ProfileServlet.Event
getEvent
(javax.servlet.http.HttpServletRequest req) private Integer
getInteger
(javax.servlet.http.HttpServletRequest req, String param, Integer defaultValue) private Long
private Double
getMinWidth
(javax.servlet.http.HttpServletRequest req) private ProfileServlet.Output
getOutput
(javax.servlet.http.HttpServletRequest req) (package private) static void
setResponseHeader
(javax.servlet.http.HttpServletResponse response) Methods inherited from class javax.servlet.http.HttpServlet
doDelete, doHead, doOptions, doPost, doPut, doTrace, getLastModified, service, service
Methods inherited from class javax.servlet.GenericServlet
destroy, getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletInfo, getServletName, init, init, log, log
-
Field Details
-
serialVersionUID
- See Also:
-
LOG
-
ACCESS_CONTROL_ALLOW_METHODS
- See Also:
-
ALLOWED_METHODS
- See Also:
-
ACCESS_CONTROL_ALLOW_ORIGIN
- See Also:
-
CONTENT_TYPE_TEXT
- See Also:
-
ASYNC_PROFILER_HOME_ENV
- See Also:
-
ASYNC_PROFILER_HOME_SYSTEM_PROPERTY
- See Also:
-
PROFILER_SCRIPT
- See Also:
-
DEFAULT_DURATION_SECONDS
- See Also:
-
ID_GEN
-
OUTPUT_DIR
-
profilerLock
-
process
-
asyncProfilerHome
-
pid
-
-
Constructor Details
-
ProfileServlet
public ProfileServlet()
-
-
Method Details
-
doGet
protected void doGet(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse resp) throws IOException - Overrides:
doGet
in classjavax.servlet.http.HttpServlet
- Throws:
IOException
-
getInteger
private Integer getInteger(javax.servlet.http.HttpServletRequest req, String param, Integer defaultValue) -
getLong
-
getMinWidth
-
getEvent
-
getOutput
-
setResponseHeader
-
getAsyncProfilerHome
-