Permalink
Browse files

Better output

  • Loading branch information...
1 parent b25cf84 commit 5e581bc2dcea4dc114c2062ec57810431834efc0 @CloudMarc committed Dec 11, 2011
Showing with 5 additions and 4 deletions.
  1. +5 −4 mq.py
View
9 mq.py
@@ -136,7 +136,7 @@ def run(self):
doAll(self.bUrl, self.key, self.msg_id, self.token, self.project_id, self.host, self.port)
dt = time.time() - t0
success = success + 1
- print '+' + str(dt)
+ print str(time.time()) + ' + ' + str(dt)
except:
print "Unexpected error: " , sys.exc_info()[0]
failure = failure + 1
@@ -149,18 +149,19 @@ def run(self):
ta = []
t0 = time.time()
runcount = 10
-for i in range(runcount):
+nThreads = 2
+for i in range(nThreads):
msg_id = "notset"
th = myThread(i, "Thread-"+str(i),0, bUrl, key, msg_id, token, project_id, host, port, runcount)
th.start()
ta.append(th)
- j = j + runcount
+ j = j + 1
#print str(ta)
for th in ta:
print str(th)
th.join()
tTot = time.time() - t0
-tAvg = tTot/(1.0*j*runcount)
+tAvg = tTot/(1.0*nThreads*runcount)
print "Average time per op: " + str(tAvg)

0 comments on commit 5e581bc

Please sign in to comment.