Permalink
Browse files

check that number of concurrent requests is not greater than total nu…

…mber of requests, thanks to @jakubkrajcovic
  • Loading branch information...
1 parent 4047a6a commit 6459d9c8c8d03063dd1805b6c0bc92f91c379ec5 @cosmin cosmin committed Apr 13, 2013
Showing with 3 additions and 0 deletions.
  1. +3 −0 beeswithmachineguns/bees.py
@@ -316,6 +316,9 @@ def attack(url, n, c, **options):
if c < instance_count:
print 'bees: error: the number of concurrent requests must be at least %d (num. instances)' % instance_count
return
+ if n < c:
+ print 'bees: error: the number of concurrent requests (%d) must be at most the same as number of requests (%d)' % (c, n)
+ return
requests_per_instance = int(float(n) / instance_count)
connections_per_instance = int(float(c) / instance_count)

0 comments on commit 6459d9c

Please sign in to comment.