Unlimited learning, half price | 50% off

Last chance! 50% off unlimited learning

Sale ends in


shinyloadtest (version 0.1.0)

loadTest: Run load tests for a Shiny application

Description

Run load tests for a Shiny application

Usage

loadTest(testFile = "./tests/myloadtest.R", url = NULL, numConcurrent = 4,
  numTotal = numConcurrent, loadTimeout = 5, stagger = 5,
  phantomTimeout = 10)

Arguments

testFile

The file containing a test script to run. Test script can be generated from recordTest(load_mode = TRUE).

url

Web address of the deployed Shiny application.

numConcurrent

Number of concurrent connections to simulate.

numTotal

Total number of connections to simulation.

loadTimeout

Maximum time to wait to connect to the Shiny app (sec)

stagger

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.

phantomTimeout

Number of seconds to wait for the slave phantomJS processes to start. Default to 10 seconds.

Value

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.

Details

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.