summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBenoit Foucher <benoit@zeroc.com>2005-03-18 12:08:56 +0000
committerBenoit Foucher <benoit@zeroc.com>2005-03-18 12:08:56 +0000
commit0507149f0f13d20ec7aa33cb20c0eace2b7a7e8f (patch)
tree72a0f6e7ce969fad0a19d8b8b970ea091de80b31
parentAdded IceStorm performance tests. (diff)
downloadice-0507149f0f13d20ec7aa33cb20c0eace2b7a7e8f.tar.bz2
ice-0507149f0f13d20ec7aa33cb20c0eace2b7a7e8f.tar.xz
ice-0507149f0f13d20ec7aa33cb20c0eace2b7a7e8f.zip
Improvments for IceStorm tests
-rw-r--r--perf/config/TestUtil.py19
-rwxr-xr-xperf/runIcePerf.py56
-rwxr-xr-xperf/runIceStormPerf.py366
-rw-r--r--perf/src/IceStorm/PerfI.cpp10
-rw-r--r--perf/src/IceStorm/Publisher.cpp10
-rw-r--r--perf/src/IceStorm/Subscriber.cpp2
-rw-r--r--perf/src/IceStorm/db/.dummy0
7 files changed, 299 insertions, 164 deletions
diff --git a/perf/config/TestUtil.py b/perf/config/TestUtil.py
index 99327ac45bc..87fcacde689 100644
--- a/perf/config/TestUtil.py
+++ b/perf/config/TestUtil.py
@@ -307,7 +307,7 @@ class Test :
self.product = product
self.test = test
- def run(self, name, directory, clientOpts, serverOpts):
+ def run(self, name, options):
match = len(self.expr) == 0
for e in self.expr:
@@ -318,22 +318,17 @@ class Test :
if not match:
return
- cwd = os.getcwd()
- os.chdir(os.path.join(toplevel, "src", self.product, directory))
-
print str(self.iteration) + ": " + self.product + " " + self.test + " " + name + "...",
sys.stdout.flush()
-
- serverPipe = os.popen(os.path.join(".", "server") + " " + serverOpts)
- getAdapterReady(serverPipe)
- clientPipe = os.popen(os.path.join(".", "client") + " " + clientOpts)
- result = float(clientPipe.read())
- clientPipe.close()
-
- os.chdir(cwd)
+ result = self.execute(options)
self.results.add(self.product, self.test, name, result)
print result
+ def execute(self, options):
+
+ return
+
+
diff --git a/perf/runIcePerf.py b/perf/runIcePerf.py
index ad5598f8385..a1ccff45c28 100755
--- a/perf/runIcePerf.py
+++ b/perf/runIcePerf.py
@@ -47,81 +47,105 @@ threadPoolOne = " --Ice.ThreadPool.Server.Size=1 --Ice.ThreadPool.Server.SizeMax
threadPoolFour = " --Ice.ThreadPool.Server.Size=4 --Ice.ThreadPool.Server.SizeMax=4 --Ice.ThreadPool.Server.SizeWarn=5"
threadPerConnection = " --Ice.ThreadPerConnection"
+class ClientServerTest(TestUtil.Test) :
+
+ def run(self, name, directory, serverOptions, clientOptions):
+
+ TestUtil.Test.run(self, name, { "client" : clientOptions, "server" : serverOptions, "directory" : directory })
+
+ def execute(self, options):
+
+ cwd = os.getcwd()
+ os.chdir(os.path.join(toplevel, "src", self.product, options["directory"]))
+
+ serverPipe = os.popen(os.path.join(".", "server") + " " + options["server"])
+ TestUtil.getAdapterReady(serverPipe)
+
+ clientPipe = os.popen(os.path.join(".", "client") + " " + options["client"])
+ result = float(clientPipe.read())
+
+ clientPipe.close()
+ serverPipe.close()
+
+ os.chdir(cwd)
+
+ return result
+
def runIcePerfs(expr, results, i):
- test = TestUtil.Test(expr, results, i, "Ice", "latency twoway")
+ test = ClientServerTest(expr, results, i, "Ice", "latency twoway")
test.run("1tp", "latency", "twoway", threadPoolOne)
test.run("4tp", "latency", "twoway", threadPoolFour)
test.run("tpc", "latency", "twoway " + threadPerConnection, threadPerConnection)
- test = TestUtil.Test(expr, results, i, "Ice", "latency oneway")
+ test = ClientServerTest(expr, results, i, "Ice", "latency oneway")
test.run("1tp", "latency", "oneway", threadPoolOne)
test.run("4tp", "latency", "oneway", threadPoolFour)
test.run("tpc", "latency", "oneway " + threadPerConnection, threadPerConnection)
- test = TestUtil.Test(expr, results, i, "Ice", "latency oneway")
+ test = ClientServerTest(expr, results, i, "Ice", "latency oneway")
test.run("1tp (batch)", "latency", "batch", threadPoolOne)
test.run("4tp (batch)", "latency", "batch", threadPoolFour)
test.run("tpc (batch)", "latency", "batch " + threadPerConnection, threadPerConnection)
- test = TestUtil.Test(expr, results, i, "Ice", "latency twoway AMI")
+ test = ClientServerTest(expr, results, i, "Ice", "latency twoway AMI")
test.run("1tp", "latency", "twoway ami", threadPoolOne)
test.run("4tp", "latency", "twoway ami", threadPoolFour)
test.run("tpc", "latency", "twoway ami " + threadPerConnection, threadPerConnection)
- test = TestUtil.Test(expr, results, i, "Ice", "throughput byte")
+ test = ClientServerTest(expr, results, i, "Ice", "throughput byte")
test.run("1tp", "throughput", "byte", threadPoolOne)
test.run("4tp", "throughput", "byte", threadPoolFour)
test.run("tpc", "throughput", "byte " + threadPerConnection, threadPerConnection)
- test = TestUtil.Test(expr, results, i, "Ice", "throughput string seq")
+ test = ClientServerTest(expr, results, i, "Ice", "throughput string seq")
test.run("1tp", "throughput", "stringSeq", threadPoolOne)
test.run("4tp", "throughput", "stringSeq", threadPoolFour)
test.run("tpc", "throughput", "stringSeq " + threadPerConnection, threadPerConnection)
- test = TestUtil.Test(expr, results, i, "Ice", "throughput long string seq")
+ test = ClientServerTest(expr, results, i, "Ice", "throughput long string seq")
test.run("1tp", "throughput", "longStringSeq", threadPoolOne)
test.run("4tp", "throughput", "longStringSeq", threadPoolFour)
test.run("tpc", "throughput", "longStringSeq " + threadPerConnection, threadPerConnection)
- test = TestUtil.Test(expr, results, i, "Ice", "throughput struct seq")
+ test = ClientServerTest(expr, results, i, "Ice", "throughput struct seq")
test.run("1tp", "throughput", "structSeq", threadPoolOne)
test.run("4tp", "throughput", "structSeq", threadPoolFour)
test.run("tpc", "throughput", "structSeq " + threadPerConnection, threadPerConnection)
def runTAOPerfs(expr, results, i):
- test = TestUtil.Test(expr, results, i, "TAO", "latency twoway")
+ test = ClientServerTest(expr, results, i, "TAO", "latency twoway")
test.run("1tp", "Thread_Pool", "latency twoway", "1")
test.run("4tp", "Thread_Pool", "latency twoway", "4")
test.run("tpc", "Thread_Per_Connection", "latency twoway", "")
- test = TestUtil.Test(expr, results, i, "TAO", "latency oneway")
+ test = ClientServerTest(expr, results, i, "TAO", "latency oneway")
test.run("1tp", "Thread_Pool", "latency oneway", "1")
test.run("4tp", "Thread_Pool", "latency oneway", "4")
test.run("tpc", "Thread_Per_Connection", "latency oneway", "")
- test = TestUtil.Test(expr, results, i, "TAO", "latency twoway AMI")
+ test = ClientServerTest(expr, results, i, "TAO", "latency twoway AMI")
test.run("1tp", "Thread_Pool", "latency twoway ami", "1")
test.run("4tp", "Thread_Pool", "latency twoway ami", "4")
test.run("tpc", "Thread_Per_Connection", "latency twoway ami", "")
- test = TestUtil.Test(expr, results, i, "TAO", "throughput byte")
+ test = ClientServerTest(expr, results, i, "TAO", "throughput byte")
test.run("1tp", "Thread_Pool", "throughput byte", "1")
test.run("4tp", "Thread_Pool", "throughput byte", "4")
test.run("tpc", "Thread_Per_Connection", "throughput byte", "")
- test = TestUtil.Test(expr, results, i, "TAO", "throughput string seq")
+ test = ClientServerTest(expr, results, i, "TAO", "throughput string seq")
test.run("1tp", "Thread_Pool", "throughput string", "1")
test.run("4tp", "Thread_Pool", "throughput string", "4")
test.run("tpc", "Thread_Per_Connection", "throughput string", "")
- test = TestUtil.Test(expr, results, i, "TAO", "throughput long string seq")
+ test = ClientServerTest(expr, results, i, "TAO", "throughput long string seq")
test.run("1tp", "Thread_Pool", "throughput longString", "1")
test.run("4tp", "Thread_Pool", "throughput longString", "4")
test.run("tpc", "Thread_Per_Connection", "throughput longString", "")
- test = TestUtil.Test(expr, results, i, "TAO", "throughput struct seq")
+ test = ClientServerTest(expr, results, i, "TAO", "throughput struct seq")
test.run("1tp", "Thread_Pool", "throughput struct", "1")
test.run("4tp", "Thread_Pool", "throughput struct", "4")
test.run("tpc", "Thread_Per_Connection", "throughput struct", "")
@@ -181,4 +205,4 @@ print "\n"
print "All results:"
all = TestUtil.AllResults()
all.add(results)
-all.printAll(False)
+all.printAll(TestUtil.ValuesMeanAndBest(), False)
diff --git a/perf/runIceStormPerf.py b/perf/runIceStormPerf.py
index ad8a3518c59..d9ad1b1440a 100755
--- a/perf/runIceStormPerf.py
+++ b/perf/runIceStormPerf.py
@@ -8,7 +8,7 @@
#
# **********************************************************************
-import os, sys, time
+import os, sys, time, getopt, re
for toplevel in [".", "..", "../..", "../../..", "../../../.."]:
toplevel = os.path.normpath(toplevel)
@@ -20,156 +20,264 @@ else:
sys.path.append(os.path.join(toplevel, "config"))
import TestUtil
-repetitions = 1000
+latencyRepetitions = 10000
+throughputRepetitions = 50000
period = 2 # (ms)
-results = { }
-
-# Constants
-blocking = 1
-reactive = 2
-mt = 3
-
-def calcResults(subscribers):
-
- mean1 = 0.0
- mean2 = 0.0
- maxV = 0.0
- for [l1,v1,t1,l2,v2,t2] in subscribers:
- mean1 += l1
- mean2 += l2
-
- if v1 > maxV:
- maxV = v1
- if v2 > maxV:
- maxV = v2
+
+# def calcResults(subscribers):
+
+# mean1 = 0.0
+# mean2 = 0.0
+# maxV = 0.0
+# for [l1,v1,t1,l2,v2,t2] in subscribers:
+# mean1 += l1
+# mean2 += l2
+
+# if v1 > maxV:
+# maxV = v1
+# if v2 > maxV:
+# maxV = v2
- return [mean1 / len(subscribers), mean2 / len(subscribers), maxV]
+# return [mean1 / len(subscribers), mean2 / len(subscribers), maxV]
-def printAllResults():
+# def printAllResults():
- print "\n"
- print "Final results"
+# print "\n"
+# print "Final results"
- for (k, v) in results.iteritems():
- mean1 = 0.0
- mean2 = 0.0
- mean3 = 0.0
- bestl1 = max
- bestl2 = max
- bestv = max
- for [l1,l2,var] in v:
- mean1 += l1
- mean2 += l2
- mean3 += var
- if l2 < bestl2:
- bestl1 = l1
- bestl2 = l2
- bestv = var
- mean1 /= len(v)
- mean2 /= len(v)
- mean3 /= len(v)
+# for (k, v) in results.iteritems():
+# mean1 = 0.0
+# mean2 = 0.0
+# mean3 = 0.0
+# bestl1 = max
+# bestl2 = max
+# bestv = max
+# for [l1,l2,var] in v:
+# mean1 += l1
+# mean2 += l2
+# mean3 += var
+# if l2 < bestl2:
+# bestl1 = l1
+# bestl2 = l2
+# bestv = var
+# mean1 /= len(v)
+# mean2 /= len(v)
+# mean3 /= len(v)
+
+# print "%-36s %04.2f %04.2f %01.3f %04.2f %04.2f %01.3f " % (k, mean1, mean2, mean3, bestl1, bestl2, bestv)
+
+class IceStormTest(TestUtil.Test) :
+
+ def __init__(self, expr, results, i, product, latency, nPublishers, nSubscribers):
+
+ if latency:
+ test = "latency " + str(nPublishers) + "-" + str(nSubscribers)
+ else:
+ test = "throughput " + str(nPublishers) + "-" + str(nSubscribers)
+
+ TestUtil.Test.__init__(self, expr, results, i, product, test)
+
+ self.latency = latency
+ self.nSubscribers = nSubscribers
+ self.nPublishers = nPublishers
+
+ def run(self, name, subscriberOpts, publisherOpts):
+
+ TestUtil.Test.run(self, name, { "publisher" : publisherOpts, "subscriber" : subscriberOpts })
+
+ def execute(self, options):
- print "%-36s %04.2f %04.2f %01.3f %04.2f %04.2f %01.3f " % (k, mean1, mean2, mean3, bestl1, bestl2, bestv)
+ cwd = os.getcwd()
+ os.chdir(os.path.join(toplevel, "src", self.product))
+
+ # Start IceStorm
+ servicePipe = os.popen(os.path.join(os.environ['ICE_HOME'], "bin", "icebox") + " --Ice.Config=config")
+ TestUtil.getAdapterReady(servicePipe)
+ TestUtil.getAdapterReady(servicePipe)
+ TestUtil.getAdapterReady(servicePipe)
+
+ # Start the subscribers
+ subscribersPipe = [ ]
+ if self.latency:
+ options["publisher"] += " -r " + str(latencyRepetitions)
+ else:
+ options["publisher"] += " -r " + str(throughputRepetitions)
+ for i in range(0, self.nSubscribers):
+ subscribersPipe.append(os.popen("./subscriber -c " + str(self.nPublishers) + " " + options["subscriber"]))
+ TestUtil.getAdapterReady(subscribersPipe[i])
+
+ # Start the publishers
+ publishersPipe = [ ]
+ if self.latency:
+ options["publisher"] += " -p " + str(period) + " -r " + str(latencyRepetitions)
+ else:
+ options["publisher"] += " -r " + str(throughputRepetitions)
+
+ for i in range(0, self.nPublishers):
+ publishersPipe.append(os.popen("./publisher " + options["publisher"]))
+
+ # Wait for the publishers to complete
+ for i in range(0, self.nPublishers):
+ TestUtil.printOutputFromPipe(publishersPipe[i])
+ publishersPipe[i].close()
+
+ # Gather results from each subscribers
+ results = [ ]
+ for i in range(0, self.nSubscribers):
+ out = subscribersPipe[i].read()
+ try:
+ r = [float(x) for x in out.split()]
+ if self.latency:
+ results.append((r[0], r[3])) # Latency w/o payload & w/ payload
+ if r[1] > 3:
+ print "high deviation: " + r[1] + " ",
+ if r[4] > 3:
+ print "high deviation: " + r[4] + " ",
+ else:
+ results.append((r[2], r[5])) # Throughput w/o payload & w/ payload
+ except KeyboardInterrupt:
+ print " invalid output: " + out,
+ pass
+ subscribersPipe[i].close()
+
+ # Shutdown IceStorm
+ os.system(os.path.join(os.environ['ICE_HOME'], "bin", "iceboxadmin") + " --Ice.Config=config shutdown")
+ servicePipe.close();
+
+ os.chdir(cwd)
+
+ return results
-def runPerfIceStorm(iter, name, nSubscriber, options, publisherOptions):
-
- print str(iter) + ": " + name + "...",
- sys.stdout.flush()
-
- cwd = os.getcwd()
- os.chdir(os.path.join("src", "IceStorm"))
-
- servicePipe = os.popen("icebox --Ice.Config=config")
- TestUtil.getAdapterReady(servicePipe)
- TestUtil.getAdapterReady(servicePipe)
- TestUtil.getAdapterReady(servicePipe)
-
- subscriberPipe = [ ]
- for i in range(0, nSubscriber):
- subscriberPipe.append(os.popen("./subscriber -r " + str(repetitions) + " " + options))
- getAdapterReady(subscriberPipe[i])
-
- publisherPipe = os.popen("./publisher -r " + str(repetitions) + " -p " + str(period) + " " + publisherOptions)
-
- publisherPipe.close()
- subscribers = [ ]
- for i in range(0, nSubscriber):
- out = subscriberPipe[i].read()
- try:
- subscribers.append([float(x) for x in out.split()])
- except KeyboardInterrupt:
- print " invalid output: " + out,
- pass
- subscriberPipe[i].close()
-
- os.system("iceboxadmin --Ice.Config=config shutdown")
- servicePipe.close();
-
- os.chdir(cwd)
-
- if len(subscribers) > 0:
- r = calcResults(subscribers)
- addResults(name, r)
- printResults(r)
- else:
- print "failed"
-def runPerfCosEvent(iter, name, nSubscriber, mode):
+# def runPerfCosEvent(iter, name, nSubscriber, mode):
- print str(iter) + ": " + name + "...",
- sys.stdout.flush()
+# print str(iter) + ": " + name + "...",
+# sys.stdout.flush()
- os.chdir("./src/CosEvent")
+# os.chdir("./src/CosEvent")
- options = ""
+# options = ""
- # Publisher options
- pOpts = ""
- if mode == blocking:
- pOpts = " -ORBSvcConf svc.blocking.conf"
+# # Publisher options
+# pOpts = ""
+# if mode == blocking:
+# pOpts = " -ORBSvcConf svc.blocking.conf"
- # Service options
- svcOpts = ""
- if mode == blocking:
- svcOpts = " -ORBSvcConf svc.event.blocking.conf"
- elif mode == reactive:
- svcOpts = " -ORBSvcConf svc.event.reactive.conf"
- else:
- svcOpts = " -ORBSvcConf svc.event.mt.conf"
+# # Service options
+# svcOpts = ""
+# if mode == blocking:
+# svcOpts = " -ORBSvcConf svc.event.blocking.conf"
+# elif mode == reactive:
+# svcOpts = " -ORBSvcConf svc.event.reactive.conf"
+# else:
+# svcOpts = " -ORBSvcConf svc.event.mt.conf"
- servicePipe = os.popen("./Service " + svcOpts + " 2>&1")
- ior = servicePipe.readline().strip()
- ior = ior[14:len(ior) - 1]
- subscriberPipe = [ ]
+# servicePipe = os.popen("./Service " + svcOpts + " 2>&1")
+# ior = servicePipe.readline().strip()
+# ior = ior[14:len(ior) - 1]
+# subscriberPipe = [ ]
- for i in range(0, nSubscriber):
- subscriberPipe.append(os.popen("./Consumer -r " + str(repetitions) + " " + options + " " + ior))
+# for i in range(0, nSubscriber):
+# subscriberPipe.append(os.popen("./Consumer -r " + str(repetitions) + " " + options + " " + ior))
- publisherPipe = os.popen("./Supplier -r " + str(repetitions) + " -p " + str(period) + " " + pOpts + " " + ior)
- publisherPipe.close()
+# publisherPipe = os.popen("./Supplier -r " + str(repetitions) + " -p " + str(period) + " " + pOpts + " " + ior)
+# publisherPipe.close()
- subscribers = [ ]
- for i in range(0, nSubscriber):
- subscribers.append([float(x) for x in subscriberPipe[i].read().split()])
- subscriberPipe[i].close()
+# subscribers = [ ]
+# for i in range(0, nSubscriber):
+# subscribers.append([float(x) for x in subscriberPipe[i].read().split()])
+# subscriberPipe[i].close()
- os.chdir("../..")
+# os.chdir("../..")
- r = calcResults(subscribers)
- addResults(name, r)
- printResults(r)
+# r = calcResults(subscribers)
+# addResults(name, r)
+# printResults(r)
-nconsumers = 1
+def runIceStormPerfs(expr, results, i):
-iter = 1
-while 1:
- try:
+ test = IceStormTest(expr, results, i, "IceStorm", True, 1, 1)
+ test.run("oneway", "", "-t")
+ test.run("twoway", "-t", "-t")
+ test.run("twoway ordered", "-o", "-t")
+
+ test = IceStormTest(expr, results, i, "IceStorm", False, 1, 1)
+ test.run("oneway", "", "-t")
+ test.run("twoway", "-t", "-t")
+ test.run("twoway ordered", "-o", "-t")
+
+ test = IceStormTest(expr, results, i, "IceStorm", True, 1, 25)
+ test.run("oneway", "", "-t")
+ test.run("twoway", "-t", "-t")
+ test.run("twoway ordered", "-o", "-t")
+
+ test = IceStormTest(expr, results, i, "IceStorm", False, 1, 25)
+ test.run("oneway", "", "-t")
+ test.run("twoway", "-t", "-t")
+ test.run("twoway ordered", "-o", "-t")
+
+
+def runCosEventPerfs(expr, results, i):
+ return
+# test = CosEventTest(expr, results, i, "CosEvent", "latency 1-1")
+# test.run("twoway", );
+# test.run("twoway buffered", );
# runPerfCosEvent(iter, "CosEvent twoway -> twoway", nconsumers, reactive)
# runPerfCosEvent(iter, "CosEvent twoway -> twoway (buffered)", nconsumers, mt)
- runPerfIceStorm(iter, "IceStorm twoway -> oneway", nconsumers, "", "-t")
- runPerfIceStorm(iter, "IceStorm twoway -> twoway", nconsumers, "-t", "-t")
- runPerfIceStorm(iter, "IceStorm twoway -> twoway ordered", nconsumers, "-o", "-t")
- iter += 1
+
+try:
+ opts, pargs = getopt.getopt(sys.argv[1:], 'hi:o:n:', ['help', 'iter=', 'output=', 'hostname=']);
+except getopt.GetoptError:
+ usage()
+
+niter = max
+printResults = False
+hostname = ""
+outputFile = ""
+for o, a in opts:
+ if o == '-i' or o == "--iter":
+ niter = int(a)
+ elif o == '-h' or o == "--help":
+ usage()
+ elif o == '-o' or o == "--output":
+ outputFile = a
+ elif o == '-n' or o == "--hostname":
+ hostname = a
+
+if outputFile == "":
+ if hostname == "":
+ import socket
+ hostname = socket.gethostname()
+ outputFile = "results.icestorm." + sys.platform + "." + hostname
+
+expr = [ ]
+if len(pargs) > 0:
+ for e in pargs:
+ expr.append(re.compile(e))
+
+if not os.environ.has_key('ICE_HOME'):
+ if os.path.exists(os.path.join(toplevel, "..", "ice")):
+ os.environ['ICE_HOME'] = os.path.join(toplevel, "..", "ice")
+
+if not os.environ.has_key('ICE_HOME') and not os.environ.has_key('TAO_ROOT'):
+ print "You need to set at least ICE_HOME or TAO_ROOT!"
+ sys.exit(1)
+
+results = TestUtil.HostResults(hostname, outputFile)
+
+i = 1
+while i <= niter:
+ try:
+ if os.environ.has_key('ICE_HOME'):
+ runIceStormPerfs(expr, results, i)
+ if os.environ.has_key('TAO_ROOT'):
+ runCosEventPerfs(expr, results, i)
+ i += 1
except KeyboardInterrupt:
- printAllResults()
break
+
+print "\n"
+print "All results:"
+all = TestUtil.AllResults()
+all.add(results)
+all.printAll(TestUtil.ValuesMeanAndBest(), False)
diff --git a/perf/src/IceStorm/PerfI.cpp b/perf/src/IceStorm/PerfI.cpp
index 0cc200ba819..413168cdd0c 100644
--- a/perf/src/IceStorm/PerfI.cpp
+++ b/perf/src/IceStorm/PerfI.cpp
@@ -26,7 +26,7 @@ PingI::PingI(int nExpectedTicks, int nPublishers) :
void
PingI::tick(long long time, Perf::AEnum, int, const Perf::AStruct&, const Perf::IntfPrx&, const Ice::Current& current)
{
- if(time > 0)
+ if(time > 0 && _nStartedPublishers == _nPublishers)
{
add(time);
}
@@ -46,7 +46,7 @@ PingI::tick(long long time, Perf::AEnum, int, const Perf::AStruct&, const Perf::
void
PingI::tickVoid(long long time, const Ice::Current& current)
{
- if(time > 0)
+ if(time > 0 && _nStartedPublishers == _nPublishers)
{
add(time);
}
@@ -76,7 +76,7 @@ PingI::stopped()
{
if(_nStartedPublishers < _nPublishers)
{
- // TODO: ERROR
+ cerr << "Some publishers are already finished while others aren't even started" << endl;
}
_stopTime = IceUtil::Time::now();
}
@@ -114,10 +114,12 @@ PingI::calc()
total = (*p - mean) * (*p - mean);
}
deviation = sqrt(total / (_results.size() - 1));
-
+
cout << mean << " " << deviation << " "
<< static_cast<double>(_results.size()) / (_stopTime - _startTime).toMicroSeconds() * 1000000.0
<< " " << flush;
_results.clear();
+ _nStartedPublishers = 0;
+ _nStoppedPublishers = 0;
}
diff --git a/perf/src/IceStorm/Publisher.cpp b/perf/src/IceStorm/Publisher.cpp
index 77b697e4300..d166a52939d 100644
--- a/perf/src/IceStorm/Publisher.cpp
+++ b/perf/src/IceStorm/Publisher.cpp
@@ -106,7 +106,10 @@ Publisher::run(int argc, char* argv[])
for(int i = 0; i < repetitions; ++i)
{
ping->tickVoid(IceUtil::Time::now().toMicroSeconds());
- IceUtil::ThreadControl::sleep(IceUtil::Time::milliSeconds(period));
+ if(period > 0)
+ {
+ IceUtil::ThreadControl::sleep(IceUtil::Time::milliSeconds(period));
+ }
}
ping->tickVoid(-1);
@@ -116,7 +119,10 @@ Publisher::run(int argc, char* argv[])
AStruct s;
s.s = "TEST";
ping->tick(IceUtil::Time::now().toMicroSeconds(), A, 10, s, 0);
- IceUtil::ThreadControl::sleep(IceUtil::Time::milliSeconds(period));
+ if(period > 0)
+ {
+ IceUtil::ThreadControl::sleep(IceUtil::Time::milliSeconds(period));
+ }
}
ping->tick(-1, A, 10, AStruct(), 0);
diff --git a/perf/src/IceStorm/Subscriber.cpp b/perf/src/IceStorm/Subscriber.cpp
index 17308579c6e..07bd754c3a9 100644
--- a/perf/src/IceStorm/Subscriber.cpp
+++ b/perf/src/IceStorm/Subscriber.cpp
@@ -60,7 +60,7 @@ Subscriber::run(int argc, char* argv[])
{
ordered = true;
}
- if(strcmp(argv[i], "-p") == 0)
+ if(strcmp(argv[i], "-c") == 0)
{
nPublishers = atoi(argv[++i]);
}
diff --git a/perf/src/IceStorm/db/.dummy b/perf/src/IceStorm/db/.dummy
new file mode 100644
index 00000000000..e69de29bb2d
--- /dev/null
+++ b/perf/src/IceStorm/db/.dummy