Produce a flame graph or a callee tree map for the call tree in a profile stack trace.
flameGraph(pd, svgfile, order = c("hot", "alpha", "time"),
colormap = NULL, srclines = FALSE, cex = 0.75,
main = "Call Graph", tooltip = FALSE)calleeTreeMap(pd, srclines = FALSE, cex = 0.75, colormap = NULL,
main = "Callee Tree Map", squarify = FALSE, border = NULL)
# S3 method for proftools_calleeTreeMap
identify(x, n = 1, print = FALSE, ...)
# S3 method for proftools_flameGraph
identify(x, n = 1, print = FALSE,
outline = FALSE, ...)
profile data as returned by readProfileData
.
character; name for SVG output file.
character; see details below.
a function or NULL
; see details below.
logical; include source information, if available, or not.
numeric character expansion value.
character; plot title.
logical; whether SVG should show details in tooltips.
character or NULL
; border color for rectangles.
logical; whether the squarified tiling algorithm should be used.
flameGraph
of calleeTreeMap
object to use.
integer; number of items to identify.
logical; whether to print result on each click.
logical; whether to outline rectangles corresponding to identified call.
Further arguments for the identify methods; currently ignored.
Objects that can be used with identify
.
calleeTreeMap
shows a tree map of the calls in a stack trace's
call tree. The tiling algorithm used depends on the squarify
argument. If squarify
is TRUE
then the
squarified algorithm is used; otherwise, the longer side is
partitioned.
flameGraph
produces a flame graph of the call tree. The
vertical positions of rectangles represent call depth on the
stack. The widths of the rectangles represent the amount of time spent
in a call at a particular call or set of calls at a particular depth.
The order
argument determines the ordering of call rectangles
at a particular level within a call at the lower level. The
"alpha"
ordering orders the calls alphabetically; "hot"
uses the hot path ordering with the call with the largest amount of
time first. The "time"
ordering preserves the original time
ordering within the stack trace file.
Default colors are based on the rainbow
palette. Alternative
colors can be specified by a colormap
function. This function
is called with three argument vectors, with one element for each
rectangle. The arguments are the function name, call depth, and number
of hits.
The results returned by flameGraph
and calleeTreeMap
can
be passed to identify
. The identify
method for
calleeTreeMap
returns a list of the call stacks for the
identified rectangles. The identify
method for flameGraph
returns a character vector of the labels of the identified rectangles.
Rprof
,
summaryRprof
,
flatProfile
,
filterProfileData
,
readProfileData
,
plotProfileCallGraph
,
profileCallGraph2Dot
,
hotPaths
# NOT RUN {
pd <- readProfileData(system.file("samples", "glmEx.out", package="proftools"))
flameGraph(pd)
calleeTreeMap(pd)
# }
Run the code above in your browser using DataLab