generated from posit-conf-2023/workshop-template
-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #4 from posit-conf-2023/load-testing
Load testing
- Loading branch information
Showing
20 changed files
with
782 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
#' Run the shinycannon utility | ||
#' | ||
#' @param shinycannon_path Path to the Shinycannon JAR file. | ||
#' @param recording_file Path to recording file | ||
#' @param app_url URL of the Shiny application to interact with | ||
#' @param output_dir Path to directory to store session logs in for this | ||
#' test run | ||
#' @param workers Number of workers to simulate. Default is 1. | ||
#' @param loaded_duration_minutes Number of minutes to continue simulating | ||
#' sessions in each worker after all workers have completed one session. | ||
#' Can be fractional. Default is 5. | ||
#' @param overwrite_output Delete the output directory before starting, | ||
#' if it exists already. Default is TRUE. | ||
#' @param debug_log Produce a debug.log in the output directory. File can get | ||
#' very large. Default is FALSE. | ||
#' @param log_level Log level. Possible values include warn, info, error, | ||
#' debug. Default is warn. | ||
#' | ||
#' @return exit code from `sys::exec_wait()` | ||
shinycannon <- function( | ||
shinycannon_path, | ||
recording_file, | ||
app_url, | ||
output_dir, | ||
workers = 1, | ||
loaded_duration_minutes = 5, | ||
overwrite_output = TRUE, | ||
debug_log = FALSE, | ||
log_level = "warn") { | ||
|
||
# assemble command-line arguments | ||
cli_args <- c( | ||
"-jar", | ||
shinycannon_path, | ||
recording_file, | ||
app_url, | ||
"--workers", | ||
workers, | ||
"--loaded-duration-minutes", | ||
loaded_duration_minutes, | ||
"--output-dir", | ||
output_dir, | ||
"--log-level", | ||
log_level | ||
) | ||
|
||
if (debug_log) cli_args <- c(cli_args, "--debug-log") | ||
if (overwrite_output) cli_args <- c(cli_args, "--overwrite-output") | ||
|
||
sys::exec_wait( | ||
cmd = "java", | ||
args = cli_args | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
title: codewindow | ||
author: Emil Hvitfeldt | ||
version: 1.1.0 | ||
quarto-required: ">=1.4.0" | ||
contributes: | ||
revealjs-plugins: | ||
- name: RevealCodewindow | ||
script: | ||
- codewindow.js | ||
stylesheet: | ||
- codewindow.css | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
/* TODO: CSS for plugin */ | ||
|
||
.codewindow { | ||
overflow-wrap: anywhere; | ||
margin-bottom: 36px; | ||
font-size: 0.45em; | ||
font-family: monospace; | ||
background: white; | ||
border-radius: 10px; | ||
box-shadow: #26394d 0px 20px 30px -10px; | ||
} | ||
|
||
.codewindow .header { | ||
display: flex; | ||
background: #e2e8f0; | ||
border-top-left-radius: 10px; | ||
border-top-right-radius: 10px; | ||
padding-left: 16px; | ||
gap: 16px; | ||
height: 30px; | ||
} | ||
|
||
.codewindow .header .file { | ||
margin-top: 5px; | ||
padding-left: 20px; | ||
padding-right: 20px; | ||
display: flex; | ||
background: white; | ||
border-top-left-radius: 10px; | ||
border-top-right-radius: 10px; | ||
height: 90%; | ||
align-items: center; | ||
gap: 4px; | ||
} | ||
|
||
.codewindow .textarea { | ||
padding: 21px; | ||
} | ||
|
||
.codewindow .textarea .sourceCode { | ||
background: unset; | ||
border: unset; | ||
font-size: unset; | ||
} | ||
|
||
.codewindow .textarea pre { | ||
font-size: unset; | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
title: highlightword | ||
author: Emil Hvitfeldt | ||
version: 1.0.0 | ||
quarto-required: ">=1.4.0" | ||
contributes: | ||
revealjs-plugins: | ||
- name: RevealHighlightword | ||
script: | ||
- highlightword.js |
Oops, something went wrong.