pprof | R Documentation |
Run R code and display profiling results
in a local interactive pprof server.
Results are collected with record_pprof()
.
pprof( expr, host = "localhost", port = proffer::random_port(), browse = interactive(), verbose = TRUE, ... )
expr |
R code to run and profile. |
host |
Host name. Set to |
port |
Port number for hosting the local pprof server. Chosen randomly by default. |
browse |
Logical, whether to open a browser to view the pprof server. |
verbose |
Logical, whether to print console messages
such as the URL of the local |
... |
Additional arguments passed on to |
A processx::process$new()
handle. Use this handle
to take down the server with $kill()
.
if (identical(Sys.getenv("PROFFER_EXAMPLES"), "true")) { # Start a pprof virtual server in the background. px <- pprof(replicate(1e2, sample.int(1e4))) # Terminate the server. px$kill() }
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.