Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Bees now get a simple 'Name' tag on creation. Closes #20.

  • Loading branch information...
commit d5530744fc5f236c21a7d850cb3bcbb5e259f1b2 1 parent cca7eb0
@onyxfish onyxfish authored
Showing with 8 additions and 2 deletions.
  1. +2 −2 README.textile
  2. +6 −0 beeswithmachineguns/bees.py
View
4 README.textile
@@ -50,9 +50,9 @@ bees down
This spins up 4 servers in security group 'public' using the EC2 keypair 'frakkingtoasters', whose private key is expected to reside at ~/.ssh/frakkingtoasters.pem.
-Note: the default EC2 security group is called 'default' and by default it locks out SSH access. I recommend creating a 'public' security group for use with the bees and explicitly opening port 22 on that group.
+*Note*: the default EC2 security group is called 'default' and by default it locks out SSH access. I recommend creating a 'public' security group for use with the bees and explicitly opening port 22 on that group.
-Note 2: Always include a trailing slash when testing a root domain. The underlying load-testing tool (ab) doesn't support raw domains.
+*Note 2*: Always include a trailing slash when testing a root domain. The underlying load-testing tool (ab) doesn't support raw domains.
It then uses those 4 servers to send 10,000 requests, 250 at a time, to attack OurNewWebbyHotness.com.
View
6 beeswithmachineguns/bees.py
@@ -105,14 +105,20 @@ def up(count, group, zone, image_id, username, key_name):
print 'Waiting for bees to load their machine guns...'
+ instance_ids = []
+
for instance in reservation.instances:
while instance.state != 'running':
print '.'
time.sleep(5)
instance.update()
+ instance_ids.append(instance.id)
+
print 'Bee %s is ready for the attack.' % instance.id
+ ec2_connection.create_tags(instance_ids, { "Name": "a bee!" })
+
_write_server_list(username, key_name, reservation.instances)
print 'The swarm has assembled %i bees.' % len(reservation.instances)
Please sign in to comment.
Something went wrong with that request. Please try again.