Permalink
Browse files

Added report() command. Added .gitignore.

  • Loading branch information...
1 parent 3072f0a commit 880dd30ff1a0a1c927523dea027939a1d731e1e4 cgroskopf committed May 4, 2010
Showing with 24 additions and 2 deletions.
  1. +2 −0 .gitignore
  2. +22 −2 load.py
View
@@ -0,0 +1,2 @@
+*.pyc
+theswarm.txt
View
@@ -95,12 +95,32 @@ def up(count=5, group='staging', zone='us-east-1d'):
print 'The swarm has assembled %i bees.' % len(reservation.instances)
+def report():
+ """
+ Report the status of the load testing servers.
+ """
+ if not env.instance_ids:
+ print 'No bees have been mobilized.'
+ return
+
+ ec2_connection = boto.connect_ec2()
+
+ reservations = ec2_connection.get_all_instances(instance_ids=env.instance_ids)
+
+ instances = []
+
+ for reservation in reservations:
+ instances.extend(reservation.instances)
+
+ for instance in instances:
+ print 'Bee ' + instance.id + ': ' + instance.state
+
def down():
"""
Shutdown the load testing server.
"""
if not env.instance_ids:
- print 'No test instances available for shutdown.'
+ print 'No bees have been mobilized.'
return
print 'Connecting to the hive.'
@@ -178,7 +198,7 @@ def test(url, c=10, n=100):
for i, instance in enumerate(instances):
params.append({
'i': i,
- 'instancd_id': instance.id,
+ 'instance_id': instance.id,
'instance_name': instance.public_dns_name,
'url': url,
'concurrent_requests': c,

0 comments on commit 880dd30

Please sign in to comment.