错误。不支持录制 shinyapps.io 个应用

Error. Recording shinyapps.io apps is not supported

我正在测试来自 shiny 的负载测试器,但我在录制会话时遇到了问题。从 Rstudio https://resources.rstudio.com/webinars/load-testing-shiny-alan-dipert 的这个 youtube 视频中,讲师提到获取已部署应用程序的 url。我已经尝试了我的 server/browser 应用程序中的 url 和我在 shinyapps io 上部署的应用程序中的 url。我也在 Rstudio Cloud 上尝试了 运行 它,我被重定向到一个登录,然后将我带到 404 错误。我曾尝试从 Mozzila、Microsoft Edge 和 Chrome 获取 URL,但没有成功。

library(shinyloadtest)
#server application
record_session("http://127.0.0.1:3793/") 
Error in curl::curl_fetch_memory(appUrl, handle = h) : 
  Failed to connect to 127.0.0.1 port 3793: Connection refused

#deployed shiny app
record_session(" https://finance.shinyapps.io/PrivateApp/")#this is not the real url
Error in .subset2(public_bind_env, "initialize")(...) : 
  Recording shinyapps.io apps is not supported

我正在寻找合适的 url 添加到 record_session 以便我可以开始对我的应用程序进行负载测试。谢谢。

从软件包的 vigentte and on the GitHub thread 中,作者很清楚 您不能针对 shinyapps.io:

上托管的 Shiny 应用程序进行基准测试

在部署限制下它说:

1. WebSockets are required: On RStudio Connect and Shiny Server Pro, SockJS is used instead of plain WebSockets in order to support browsers and load balancers that don’t support WebSockets. Even though Shiny works in the absence of WebSocket support, shinyloadtest does not.

2. shinyapps.io unsupported: Applications deployed on http://www.shinyapps.io/ can’t be recorded or load tested.

相反,文档建议您应该在开发机器上安装包

否则,shinyloadtest 工作得很好(在 R 3.5 及更高版本的多个版本上测试)。函数 record_session() 将已部署应用程序的 URL 作为参数:

shinyloadtest::record_session('https://your-deployed-shinyapp.com/')

摘自文档:

Running the function will open a browser displaying the app. Once open, interact with the application as a normal user would and then close the browser. After closing the browser window or tab, a file will be created that contains a recording of the session. This recording, written to recording.log by default, will serve as the basis for the load test.