diff options
author | Nullspoon <nullspoon@iohq.net> | 2014-02-23 15:04:20 -0700 |
---|---|---|
committer | Nullspoon <nullspoon@iohq.net> | 2014-02-23 15:06:30 -0700 |
commit | f52231f1e52b5617abfca496e2bac3b664bc8f12 (patch) | |
tree | c4493f8c55a5b89271697e5423a338711ab49db8 | |
parent | 09cb98ce3fdff4384db8d06fe9db89fc14b6d616 (diff) | |
download | forkload-f52231f1e52b5617abfca496e2bac3b664bc8f12.tar.gz forkload-f52231f1e52b5617abfca496e2bac3b664bc8f12.tar.xz |
Added help text and GPL v3 header
Nothing much to see here. Just wrote the help text and added -h,--help to the
argument parsing loop.
Yay GPLv3
-rwxr-xr-x | forkload | 37 |
1 files changed, 35 insertions, 2 deletions
@@ -1,7 +1,37 @@ #!/usr/bin/env bash +# +# Forkload performs rudimentary load testing on remote web applications +# Copyright (C) 2014 Aaron Ball +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see <http://www.gnu.org/licenses/>. +# function get_help { - echo "This needs to be written" + echo " +The forkload script provides rudimentary load testing for web applications +(anything accessible through curl). This currently tests from a single system, +so a significant bottleneck will occur due to the fact that a load test is +running off of a single nic. As such, Forkload is intended for small scale load +tests (tens to the low hundreds of clients, depending on your nic and the +infrastructure between the testing agent and the destination). + +[1mArguments:[0m + -d,--dest Destination to test on + -o,--output File to output the load test results to (default: forkload.out) + -c,--clients Number of virtual clients to test with (default: 1) + -h,--help Prints this help text + " } function main { @@ -14,7 +44,10 @@ function main { # Parse arguments for (( i = 0; i < ${#argv[*]}; i++ )); do val=${argv[$i]} - if [[ ${val} == "-o" || ${val} == "--output" ]]; then + if [[ ${val} == "-h" || ${val} == "--help" ]]; then + echo -e "$(get_help)" + exit 0 + elif [[ ${val} == "-o" || ${val} == "--output" ]]; then i=$((i+1)) out=${argv[$i]} elif [[ ${val} == "-c" || ${val} == "--clients" ]]; then |