Skip to content

Commit

Permalink
add examples of using connectapi to grab usage metrics
Browse files Browse the repository at this point in the history
  • Loading branch information
rpodcast committed Sep 3, 2023
1 parent 0f1de25 commit c421afb
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion R/test_dependencies.R
Original file line number Diff line number Diff line change
Expand Up @@ -98,4 +98,20 @@ shinyloadtest_report(df, "R/report1.html")

# run following command in terminal
# java -jar utils/shinycannon-1.1.3-dd43f6b.jar -h
# java -jar utils/shinycannon-1.1.3-dd43f6b.jar R/recording.log https://rsc.training.rstudio.com/bricktest/ --workers 1 --loaded-duration-minutes 5 --output-dir R/run1 --overwrite-output
# java -jar utils/shinycannon-1.1.3-dd43f6b.jar R/recording.log https://rsc.training.rstudio.com/bricktest/ --workers 1 --loaded-duration-minutes 5 --output-dir R/run1 --overwrite-output

# test connectapi with posit connect training server
library(connectapi)

client <- connect(
server = paste0("https://", Sys.getenv("RSCONNECT_SERVER")),
api_key = Sys.getenv("RSCONNECT_KEY")
)

content_df <- get_content(client)
usage_df <- get_usage_shiny(client, limit = 10)

# app guid
lego_guid <- Sys.getenv("LEGO_APP_GUID")

get_usage_shiny(client, content_guid = lego_guid)

0 comments on commit c421afb

Please sign in to comment.