Is s simple multi tread tool for creating a flood of HTTP GET requests. Initially was created for testing WordPress installation on Azure VMs
Powered by "concurrent.futures" and "ThreadPoolExecutor" particularly.
http-test.py testUrl numberOfRequests max_workers getRequestTimeout
- testUrl: host name, like "https://www.google.com/"
- numberOfRequests: total number of requests
- max_workers: max parallel tasks (threads)
- getRequestTimeout: timeout for each request
As script saves received data in "results" directoity, such folder should be created.
For simplicity, can be used with the http-test.exe that was created with "pyinstaller": http-test.7z
Usage example is the same as with py-file:
http-test.exe testUrl numberOfRequests max_workers getRequestTimeout
Also can be used with windows bat-files, to create semi auto tests: Check 'run-test.bat' from archive.
http-test.exe https://www.google.com/ 5000 10 10 %*
echo Waiting For Three 3 minutes...
TIMEOUT /T 180 /NOBREAK
http-test.exe https://www.google.com/ 5000 20 10 %*
echo Waiting For Three 3 minutes...
TIMEOUT /T 180 /NOBREAK
http-test.exe https://www.google.com/ 5000 30 10 %*
echo Waiting For Three 3 minutes...
TIMEOUT /T 180 /NOBREAK
Additional resources that were used in code:
#https://www.tutorialspoint.com/python/python_command_line_arguments.htm
#https://creativedata.stream/multi-threading-api-requests-in-python/