the 'submit' script now times and reports things correctly

This commit is contained in:
Stephen McQuay 2011-03-30 18:36:28 -06:00
parent 3f4785ef49
commit 4fd0780442
1 changed files with 13 additions and 10 deletions

View File

@ -1,6 +1,7 @@
#!/usr/bin/env python
import sys
import os
import time
@ -34,14 +35,13 @@ def run_queries(count, order = 3, extra_points = 8):
if __name__ == '__main__':
server = 'localhost'
expected_participants = 6
m = QueueManager(address=(server, 50000), authkey='asdf')
m.connect()
count = int(sys.argv[1])
expected_participants, count = (int(i) for i in sys.argv[1:])
inq = m.get_inqueue()
inq = m.get_inqueue()
outq = m.get_outqueue()
# wait for all participants to be loaded up
@ -49,14 +49,17 @@ if __name__ == '__main__':
print outq.get()
# run codes
r, submit, receive = run_queries(count, order=3, extra_points = 64)
results, submit, receive = run_queries(count, order=3, extra_points = 64)
# shut down all participants
for i in xrange(expected_participants):
inq.put([None] * expected_participants)
inq.put([None] * 4)
results = {}
results['submit' ] = float(submit)
results['receive'] = float(receive)
stats = {}
stats['submit' ] = float(submit)
stats['receive' ] = float(receive)
stats['count' ] = count
stats['expected_participants'] = expected_participants
print "submit time: %(submit)0.2f seconds, results time: %(receive)0.2f" % results
log.error(results)
print "submit time for %(count)s interps, %(expected_participants)d participants: %(submit)0.2f seconds, results time: %(receive)0.2f" % stats
log.error("stats: %s", stats)