The shimmer package uses discrete event simulation to help answer the questions:

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.

Relationship between shimmer and the simmer package

The 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.

Setting up 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")

Run the simulation

library(magrittr)
library(shimmer)

By default, the simulation runs for an hour (3,600 seconds) of simulation time:

env <- shimmer()
env

Plots

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()


andrie/shimmer documentation built on May 3, 2019, 3:39 p.m.