
Last chance! 50% off unlimited learning
Sale ends in
Run load tests for a Shiny application
loadTest(testFile = "./tests/myloadtest.R", url = NULL, numConcurrent = 4,
numTotal = numConcurrent, loadTimeout = 5, stagger = 5,
phantomTimeout = 10)
The file containing a test script to run. Test script can be
generated from recordTest(load_mode = TRUE)
.
Web address of the deployed Shiny application.
Number of concurrent connections to simulate.
Total number of connections to simulation.
Maximum time to wait to connect to the Shiny app (sec)
Concurrent connections are staggered by pausing for a random, uniformally distributed period of time before starting the connection. This parameter is the maximum amount of time (sec) to wait. A value of 0 means that no staggering will occur.
Number of seconds to wait for the slave phantomJS processes to start. Default to 10 seconds.
Returns a list with the results from each child process. The results will either be a data frame with the event log from the test or an error message.
This function simulates load against a deployed Shiny app. The
function creates a cluster of workers using the parallel function
makePSOCKcluster
. The number of works is equal to the number of
desired concurrent connections. Each worker launches a phantomJS process
that calls the URL and drives the app through the test. Tests should be
generated using the recordTest
function with load_mode =
TRUE
. Timing information is aggregated and returned as a data frame. If
the number of total tests > number of concurrent tests, then finished
workers will be recycled to complete remaining tests.The phantomJS process
is reused, but a new browser session is started for each test.