Curl Plus
— Bash — 1 min read
This script allows the user to run a series of curl commands against single or multiple urls.
The user can choose to either run the script on a single url or a list of urls. When executed, the script first checks the syntax of the parameters it has been passed, before running a series of curl commands on the urls(s).
Example Usage
curlplus [number of requests OR source file] [url{if no source file}]
Sample Output
1oisin@oisin-ThinkPad-T430:~/curlplus$ ./curlplus.sh urllist.txt 2 test no.1 3 curl sending get request for http://127.0.0.1:4000/ 4 Response code:200 Download Size:15457 Connect time:0.000 Total time:0.0025
6 test no.2 7 curl sending get request for http://127.0.0.1:4000/python/2016/08/18/collating-and-graphing-olympic-data-with-pandas-and-bokeh.html 8 Response code:200 Download Size:10436 Connect time:0.000 Total time:0.0029
10 test no.3 11 curl sending get request for http://127.0.0.1:4000/python/2016/07/26/james-joyce-twitter-bot.html 12 Response code:200 Download Size:10565 Connect time:0.000 Total time:0.00213
14 test no.4 15 curl sending get request for http://127.0.0.1:4000/node.js/2016/07/20/maintaining-state-in-an-AWS-Lambda-function.html 16 Response code:200 Download Size:9512 Connect time:0.000 Total time:0.00217
18 test no.5 19 curl sending get request for http://127.0.0.1:4000/node.js/2016/07/17/twilio-homer-simpson-autodialer.html 20 Response code:200 Download Size:9449 Connect time:0.000 Total time:0.00221
22 test no.6 23 curl sending get request for http://127.0.0.1:4000/bash/2016/07/10/bash-media-project.html 24 Response code:200 Download Size:9940 Connect time:0.000 Total time:0.00325
26 test no.7 27 curl sending get request for http://127.0.0.1:4000/android/2016/05/17/android-college-project.html 28 Response code:200 Download Size:9166 Connect time:0.000 Total time:0.00229
30 test no.8 31 curl sending get request for http://127.0.0.1:4000/java/2016/05/10/java-college-project.html 32 Response code:200 Download Size:10570 Connect time:0.000 Total time:0.00233
34
35
36 overall test results 37
38 overall_test_duration: .11939 number_of_tests: 840 200_status_count: 841 unsuccsessful_transactions: 042 average_connection_time: 043 download_sum: 85095 bytes
The code for this project can be viewed on Github
There are of course better-established load-testing tools already in existance, such as Siege