The shimmer
package uses discrete event simulation to help answer the questions:
n
number of users?The robust answer to this question is to use shinyloadtest
, but for planning purposes you may want to rapidly develop some hypotheses and intuition about the problem, prior to building and testing an app.
shimmer
and the simmer
packageThe simmer
package makes it easy to build discrete event simulations in R. The shimmer
package uses simmer
under the hood for defining and running the simulation.
The shimmer()
function reads a configuration file using the config::get()
function. The package contains a default configuration file at:
system.file("config.yml", package = "shimmer")
The contents of this file:
f <- readLines(system.file("config.yml", package = "shimmer")) cat(f, sep = "\n")
library(magrittr) library(shimmer)
By default, the simulation runs for an hour (3,600 seconds) of simulation time:
env <- shimmer() env
You can generate several plots from the simulation:
env %>% plot_shimmer_cpu_usage()
env %>% plot_shimmer_response_histogram()
env %>% plot_shimmer_rejection_usage()
In addition, you can also get more detail of the underlying system behaviour:
env %>% plot_shimmer_connection_usage()
env %>% plot_shimmer_process_usage()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.