Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to access the reports #52

Open
takearun opened this issue Nov 16, 2018 · 4 comments
Open

How to access the reports #52

takearun opened this issue Nov 16, 2018 · 4 comments

Comments

@takearun
Copy link

Hi,
I used the docker build to build the image and I was able to run it like this,

docker run slowhttptest:latest -c 100 -H -g -i 10 -r 20 -t GET -u https://localhost/api/resources/365037?api-key=1234 -p 10

It seemed to have ran fine and I got this output,

slow HTTP test status on 240th second:

initializing: 0
pending: 0
connected: 100
error: 0
closed: 0
service available: YES
Fri Nov 16 13:48:33 2018:
Test ended on 241th second
Exit status: Hit test time limit
CSV report saved to slow_2018-11-16_13-44-32.csv
HTML report saved to slow_2018-11-16_13-44-32.html

Now where are the csv and html files stored?

Thanks,
Arun

@jessforrest
Copy link

Was wondering the same. I'm starting to think it's impossible.

@Googolaire
Copy link

on a unix computer you could use a grep command, on windows you should download search everything.

@maikthulhu
Copy link
Contributor

maikthulhu commented Oct 6, 2021

Since slowhttptest saves files to the current directory and doesn't have a way to specify an output folder or name output files, you can accomplish this by creating a bind mount between the host and container, and telling docker where to set the working directory when it starts. I'm an idiot.

Here's one way to do it.

user@host:~$ mkdir output
user@host:~$ sudo docker run -v /home/user/output:/output -w /output shekyan/slowhttptest:latest -c 100 -H -g -i 10 -r 20 -t GET -u https://localhost/api/resources/365037?api-key=1234 -p 10
... wait ...
user@host:~$ ls -l output/
total 8
-rw-r--r-- 1 root    root     485 Oct  6 19:05 slow_2021-10-06_19-04-54.csv
-rw-r--r-- 1 root    root    2861 Oct  6 19:05 slow_2021-10-06_19-04-54.html
  • -v /home/user/output:/output creates /output in the container and binds it to /home/user/output on the host. Anything placed here will be accessible and persist on the host.
  • -w /output sets the working directory to /output when the container starts. Files are saved here and will be available in /home/user/output even after the container stops.

Here's another way.

user@host:~$ mkdir output
user@host:~$ sudo docker run -v /home/user/output:/output shekyan/slowhttptest:latest -c 100 -H -g -i 10 -r 20 -t GET -u https://localhost/api/resources/365037?api-key=1234 -p 10 -o /output/my_results
... wait ...
user@host:~$ ls -l output/
total 8
-rw-r--r-- 1 root root  485 Oct  6 19:33 my_results.csv
-rw-r--r-- 1 root root 2861 Oct  6 19:33 my_results.html
  • -v /home/user/output:/output creates /output in the container and binds it to /home/user/output on the host. Anything placed here will be accessible and persist on the host.
  • -o /output/my_results this -o ... gets passed to slowhttptest and tells it to save files in that folder and/or prefix (files will end in .csv and .html)

@springleo
Copy link

you can start the container in daemon mode, attach to this container, run the test (which generates csv/html), exit the container and copy them back to host.

docker run -d -it --entrypoint sh <image_id>
docker exec -it <container_id> sh
#now we are inside the container, at its CLI prompt
#slowhttptest execution
exit
docker cp <container_id>:my*.html .


Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants