rstudio / shinycannon

Load generation tool, part of shinyloadtest
https://rstudio.github.io/shinyloadtest/
15 stars 6 forks source link

testing locally hosted apps #70

Closed kimsjune closed 7 months ago

kimsjune commented 7 months ago

Hello,

Is it possible to load test a locally hosted app? I can generate a recording, but load testing with shinycannon fails with the following error:

java -jar shinycannon-1.1.3-dd43f6b.jar ./recording.log https://127.0.0.1:8600 --workers 5 --loaded-duration-minutes 2 --output-dir ./run2 --overwrite-output
ERROR [thread00] - Uncaught exception on thread00
org.apache.http.conn.HttpHostConnectException: Connect to 127.0.0.1:8600 [/127.0.0.1] failed: Connection refused: connect
        at org.apache.http.impl.conn.DefaultHttpClientConnectionOperator.connect(DefaultHttpClientConnectionOperator.java:156)

I suspect this is because the http port keeps changing, but I could be missing something. I like the idea of load testing, which I am hoping would precede any actual deployment.

schloerke commented 7 months ago

Is it possible to load test a locally hosted app?

@kimsjune Yes, absolutely!

The error is stating it can not connect to https://127.0.0.1:8600. Is your app still running locally? I know I've shut my local app down a few times after making the recording but before load testing. (shinycannon does not know how to execute your app, just it's URL.)

kimsjune commented 7 months ago

I see that now. I was making two mistakes:

  1. not keeping the original app running.
  2. for some reason I put https instead of http.

Thank you.