Skip to content

Commit 880dd30

Browse files
author
cgroskopf
committed
Added report() command. Added .gitignore.
1 parent 3072f0a commit 880dd30

2 files changed

Lines changed: 24 additions & 2 deletions

File tree

‎.gitignore‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
*.pyc
2+
theswarm.txt

‎load.py‎

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,12 +95,32 @@ def up(count=5, group='staging', zone='us-east-1d'):
9595

9696
print 'The swarm has assembled %i bees.' % len(reservation.instances)
9797

98+
def report():
99+
"""
100+
Report the status of the load testing servers.
101+
"""
102+
if not env.instance_ids:
103+
print 'No bees have been mobilized.'
104+
return
105+
106+
ec2_connection = boto.connect_ec2()
107+
108+
reservations = ec2_connection.get_all_instances(instance_ids=env.instance_ids)
109+
110+
instances = []
111+
112+
for reservation in reservations:
113+
instances.extend(reservation.instances)
114+
115+
for instance in instances:
116+
print 'Bee ' + instance.id + ': ' + instance.state
117+
98118
def down():
99119
"""
100120
Shutdown the load testing server.
101121
"""
102122
if not env.instance_ids:
103-
print 'No test instances available for shutdown.'
123+
print 'No bees have been mobilized.'
104124
return
105125

106126
print 'Connecting to the hive.'
@@ -178,7 +198,7 @@ def test(url, c=10, n=100):
178198
for i, instance in enumerate(instances):
179199
params.append({
180200
'i': i,
181-
'instancd_id': instance.id,
201+
'instance_id': instance.id,
182202
'instance_name': instance.public_dns_name,
183203
'url': url,
184204
'concurrent_requests': c,

0 commit comments

Comments
 (0)