the 'submit' script now times and reports things correctly
This commit is contained in:
parent
3f4785ef49
commit
4fd0780442
@ -1,6 +1,7 @@
|
|||||||
#!/usr/bin/env python
|
#!/usr/bin/env python
|
||||||
|
|
||||||
import sys
|
import sys
|
||||||
|
import os
|
||||||
|
|
||||||
import time
|
import time
|
||||||
|
|
||||||
@ -34,12 +35,11 @@ def run_queries(count, order = 3, extra_points = 8):
|
|||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
server = 'localhost'
|
server = 'localhost'
|
||||||
expected_participants = 6
|
|
||||||
|
|
||||||
m = QueueManager(address=(server, 50000), authkey='asdf')
|
m = QueueManager(address=(server, 50000), authkey='asdf')
|
||||||
m.connect()
|
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()
|
outq = m.get_outqueue()
|
||||||
@ -49,14 +49,17 @@ if __name__ == '__main__':
|
|||||||
print outq.get()
|
print outq.get()
|
||||||
|
|
||||||
# run codes
|
# 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):
|
for i in xrange(expected_participants):
|
||||||
inq.put([None] * expected_participants)
|
inq.put([None] * 4)
|
||||||
|
|
||||||
results = {}
|
stats = {}
|
||||||
results['submit' ] = float(submit)
|
stats['submit' ] = float(submit)
|
||||||
results['receive'] = float(receive)
|
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
|
print "submit time for %(count)s interps, %(expected_participants)d participants: %(submit)0.2f seconds, results time: %(receive)0.2f" % stats
|
||||||
log.error(results)
|
log.error("stats: %s", stats)
|
||||||
|
Loading…
Reference in New Issue
Block a user