diff --git a/GUI/siege.desktop b/GUI/siege.desktop new file mode 100644 index 0000000..700207d --- /dev/null +++ b/GUI/siege.desktop @@ -0,0 +1,9 @@ +[Desktop Entry] +Name=Siege +Comment=http load testing and benchmarking utility +Exec=terminator -xm /usr/bin/siegeGUI.sh +Icon=/usr/share/icons/6atranj-icons/siege.gif +Terminal=false +Type=Application +Encoding=UTF-8 +Categories=Network;Knight; \ No newline at end of file diff --git a/GUI/siege.gif b/GUI/siege.gif new file mode 100755 index 0000000..b2cbf20 Binary files /dev/null and b/GUI/siege.gif differ diff --git a/GUI/siege.png b/GUI/siege.png new file mode 100644 index 0000000..a3151f2 Binary files /dev/null and b/GUI/siege.png differ diff --git a/GUI/siegeGUI.sh b/GUI/siegeGUI.sh new file mode 100644 index 0000000..440b831 --- /dev/null +++ b/GUI/siegeGUI.sh @@ -0,0 +1,105 @@ +#!/bin/bash +# +# siege GUI script for 6atranj distro +#Siege is an HTTP load testing and benchmarking utility. It has a similar interface to ab, which will make transitioning to the tool almost +#seamless. Also, instead of testing against a single URL, Siege allows you to test against multiple. This allows for a more real-world simulation #of how a user would use your system. +# +# Author: Mehrdad Dadkhah +# Email: dadkhah.ir at gmail.com +# Licence: GPL +# fixed icon display in systray, move zenity, +# based now on yad. +# +Encoding=UTF-8 +# +# +# define some variables +# +TITLE='Siege benchmarking' +VERSION=2.7 +ICON=/usr/share/icons/6atranj-icons/siege.gif + +# +#questions +# +function menu { +data=($(yad --form --title="$TITLE"" $VERSION" --window-icon=$ICON \ + --on-top \ + --center \ + --margins=10 \ + --image=$ICON \ + --image-on-top \ + --borders=15 \ + --item-separator=, \ + --separator="," \ + --field="url to test (if want to use list of urls, leave it empty):TEXT" \ + --field="how many users hitting the resource simultaneously:NUM" \ + --field="delay between requests:NUM" \ + --field="time to benchmark/minutes:NUM" \ + --button=$"attach file of URLs:7" \ + --button=$"Test:8" \ + --button="more options:9" \ + --button="gtk-help:10" \ + --button="gtk-close:11" + + )) + +ret=$? + +IFS=',' read -a array <<< "$data" + +# +#file of URLs +# +if [[ $ret -eq 7 ]]; then + CHANGE=$(yad --title="$TITLE"" $VERSION" --window-icon=$ICON \ + --file --width=600 --height=500 \ + --text=$"Choose your own audio file as alert! +________________________________________________") + if [ "$CHANGE" ];then + if [[ ! -z "${array[2]}" && ! -z "${array[1]}" && ! -z "${array[3]}" ]];then + siege -b -d"${array[2]}" -c"${array[1]}" -t"${array[3]}"M -i -f "$CHANGE" + else + yad --title $"$TITLE"" $VERSION" \ + --button="gtk-ok:0" \ + --width 300 \ + --window-icon=$ICON \ + --text=$"Your own file of URLs add successfully ... " + fi + else + zenity --warning \ + --title='oh! your file could not attach ... ' \ + --text='please enter url or import txt file of urls ... ' + fi +menu +fi +# +#Test url +# +if [[ $ret -eq 8 ]]; then + if [[ -z "$CHANGE" ]]; then + if [[ -z "${array[0]}" ]]; then + zenity --warning \ + --title='wrong data ... !' \ + --text='please enter url or import txt file of urls ... ' + else + siege -b -d"${array[2]}" -c"${array[1]}" -t"${array[3]}"M "${array[0]}" | zenity --progress --pulsate + fi + else + siege -b -d"${array[2]}" -c"${array[1]}" -t"${array[3]}"M -i -f "$CHANGE" + fi +menu +fi + +# +#more options and help ... +# +if [[ $ret -eq 9 || $ret -eq 10 ]]; then + siege --help +fi + +[[ $ret -eq 11 ]] && exit 0 + + +} +menu \ No newline at end of file diff --git a/README.md b/README.md index 122efe2..3cbb34d 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,4 @@ - Siege README WHAT IS IT? ----------- @@ -62,6 +61,18 @@ Through your server logs you should be able to get the average amount of time spent on a page. It is recommended that you use that number for your delay when simulating internet activity. +HOW TO USE IT? +--------------- +After install siege you can use as a cli in command line or use it's GUI. In 6atranj group I ([Mehrdad Dadkhah](https://github.com/Mehrdad-Dadkhah)) write an GUI for it. you can run /GUI/siegeGUI.sh and use it simple GUI. if you have Ubuntu and want to add it's icon you should: + + 1. copy /GUI/siege.desktop to /usr/share/applicaions folder + 2. copy /GUI/siegeGUI.sh to /usr/bin/siegeGUI.sh + 3. copy /GUI/siege.gif to /usr/share/icons/6atranj-icons/siege.gif + + +![siege simple GUI](https://github.com/6atranj/siege/blob/master/GUI/siege.png) + + WHERE IS IT? ------------ @@ -142,3 +153,4 @@ from your version. If you delete this exception statement from all source files in the program, then also delete it here. +