Do a test run of pprof() to verify that the system dependencies like pprof work as expected.

test_pprof(
  host = "localhost",
  port = proffer::random_port(),
  browse = interactive(),
  verbose = TRUE
)

Arguments

host

Host name. Set to "localhost" to view locally or "0.0.0.0" to view from another machine. If you view from another machine, the printed out URL will not be valid. For example, if pprof() or serve_pprof() prints "http://0.0.0.0:8080", then you need to replace 0.0.0.0 with your computer's name or IP address, e.g. "http://my_computer.com:8080".

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 pprof server.

Details

See https://github.com/r-prof/proffer#installation for setup instructions.

See also

Examples

if (identical(Sys.getenv("PROFFER_EXAMPLES"), "true")) {
test_pprof()
}