Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

validate number of connections and number of concurrent connections

  • Loading branch information...
commit 3c98561f539585e5d1996138a8deb03367bf8804 1 parent 216f3ea
@cosmin cosmin authored
Showing with 9 additions and 1 deletion.
  1. +9 −1 beeswithmachineguns/bees.py
View
10 beeswithmachineguns/bees.py
@@ -269,7 +269,7 @@ def _print_results(results):
print 'Mission Assessment: Target severely compromised.'
else:
print 'Mission Assessment: Swarm annihilated target.'
-
+
def attack(url, n, c):
"""
Test the root url of this site.
@@ -294,6 +294,14 @@ def attack(url, n, c):
instances.extend(reservation.instances)
instance_count = len(instances)
+
+ if n < instance_count * 2:
+ print 'bees: error: the total number of requests must be at least %d (2x num. instances)' % (instance_count * 2)
+ return
+ if c < instance_count:
+ print 'bees: error: the number of concurrent requests must be at least %d (num. instances)' % instance_count
+ return
+
requests_per_instance = int(float(n) / instance_count)
connections_per_instance = int(float(c) / instance_count)
Please sign in to comment.
Something went wrong with that request. Please try again.