filterProfileData: Filter Profile Data

Description Usage Arguments Details Value Author(s) See Also Examples

View source: R/prof.R View source: R/prof.R

Description

Allow profile data to be filtered on several criteria.

Usage

1
filterProfileData(pd, ..., normalize = FALSE, regex = FALSE)

Arguments

pd

profile data as returned by readProfileData.

...

filter specifications is filter = value form as described below.

normalize

logical; if true the total hit count is set to the total number of hits in the reduced profile data; otherwise the original value is retained.

regex

logical; if true the specifications in select, and omit, and focus filters are treated as regular expressions; otherwise exact matches are required.

Details

This function can be used to make plots and summaries more readable or relevant by removing functions that are not of direct interest or have low hit counts.

Filters are specified in filter = value form with value typically specifying a filter level or argument. Possible filters and their argument values are:

select

character vector specifying names of functions; call stacks not containing functions matching any of these names are dropped.

omit

character vector specifying names of functions; call stacks containing functions matching any of these names are dropped.

focus

character vector specifying names of functions; call stacks not containing functions matching any of these names are dropped, and functions at the bottom of the stack not matching the focus specification are dropped.

skip

integer; the number of elements to trim from the bottom of the stacks.

maxdepth

integer; stacks are truncated to have at most maxdepth elements.

self.pct

numeric; functions at the bottom of the stacks with self percentages below this value are removed.

total.pct

numeric; functions at the top of the stacks with total percentages below this value are removed.

interval

inter vector of length 2 specifying first and last sample to use.

merge.pct

numeric; functions at the top of the stacks are removed and stack traces merged until each retained trace accounts for at least this percentage of run time.

Value

A reduced profile data structure.

Author(s)

Luke Tierney

See Also

Rprof, summaryRprof, flatProfile, readProfileData, plotProfileCallGraph, profileCallGraph2Dot

Examples

1
2
3
4
5
6
pd <- readProfileData(system.file("samples", "glmEx.out", package="proftools"))
plotProfileCallGraph(pd)
plotProfileCallGraph(filterProfileData(pd, self.pct = 1))
plotProfileCallGraph(filterProfileData(pd, self.pct = 1, total.pct = 10))
plotProfileCallGraph(filterProfileData(pd, select = "glm", self.pct=1,
                                       total.pct=10))

proftools documentation built on July 8, 2020, 5:20 p.m.