Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions GUI/siege.desktop
Original file line number Diff line number Diff line change
@@ -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;
Binary file added GUI/siege.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added GUI/siege.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
105 changes: 105 additions & 0 deletions GUI/siegeGUI.sh
Original file line number Diff line number Diff line change
@@ -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=$"<b>Choose your own audio file as alert!</b>
________________________________________________")
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
14 changes: 13 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@

Siege README

WHAT IS IT?
-----------
Expand Down Expand Up @@ -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?
------------
Expand Down Expand Up @@ -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.