diff options
41 files changed, 739 insertions, 633 deletions
diff --git a/perf/IceETests.py b/perf/IceETests.py new file mode 100644 index 00000000000..af54db88067 --- /dev/null +++ b/perf/IceETests.py @@ -0,0 +1,73 @@ +# ********************************************************************** +# +# Copyright (c) 2003-2006 ZeroC, Inc. All rights reserved. +# +# This copy of Ice is licensed to you under the terms described in the +# ICE_LICENSE file included in this distribution. +# +# ********************************************************************** + +productName = "IceE" + +blocking = " --Ice.Blocking " + +testDefinitions = [ + (productName, "latency twoway", "latency", [ + ("tpc", "twoway", ""), + ("tpc blocking", "twoway" + blocking, ""), + ] + ), + (productName, "latency oneway", "latency", [ + ("tpc", "oneway", ""), + ("tpc blocking", "oneway" + blocking, ""), + ] + ), + (productName, "latency oneway (batch)", "latency", [ + ("tpc (batch)", "batch", ""), + ("tpc blocking (batch)", "batch" + blocking, ""), + ] + ), + (productName, "throughput byte", "throughput", [ + ("tpc", "byte", ""), + ("tpc blocking", "byte" + blocking, ""), + ] + ), + (productName, "throughput string seq", "throughput", [ + ("tpc", "stringSeq", ""), + ("tpc blocking", "stringSeq" + blocking, ""), + ] + ), + (productName, "throughput long string seq", "throughput", [ + ("tpc", "longStringSeq", ""), + ("tpc blocking", "longStringSeq" + blocking, ""), + ] + ), + (productName, "throughput struct seq", "throughput", [ + ("tpc", "structSeq", ""), + ("tpc blocking", "structSeq" + blocking, ""), + ] + ), + (productName, "throughput byte (receive)", "throughput", [ + ("tpc", "receive byte", ""), + ("tpc blocking", "receive byte" + blocking, ""), + ] + ), + (productName, "throughput string seq (receive)", "throughput", [ + ("tpc", "receive stringSeq", ""), + ("tpc blocking", "receive stringSeq" + blocking, ""), + ] + ), + (productName, "throughput long string seq (receive)", "throughput", [ + ("tpc", "receive longStringSeq", ""), + ("tpc blocking", "receive longStringSeq" + blocking, ""), + ] + ), + (productName, "throughput struct seq (receive)", "throughput", [ + ("tpc", "receive structSeq", ""), + ("tpc blocking", "receive structSeq" + blocking, ""), + ] + ), + ] + +def getDefinitions(): + return testDefinitions diff --git a/perf/IceTests.py b/perf/IceTests.py new file mode 100644 index 00000000000..8b98e5a3d36 --- /dev/null +++ b/perf/IceTests.py @@ -0,0 +1,69 @@ +# ********************************************************************** +# +# Copyright (c) 2003-2006 ZeroC, Inc. All rights reserved. +# +# This copy of Ice is licensed to you under the terms described in the +# ICE_LICENSE file included in this distribution. +# +# ********************************************************************** + + +threadPoolOne = " --Ice.ThreadPool.Server.Size=1 --Ice.ThreadPool.Server.SizeMax=1 --Ice.ThreadPool.Server.SizeWarn=2" +threadPoolFour = " --Ice.ThreadPool.Server.Size=4 --Ice.ThreadPool.Server.SizeMax=4 --Ice.ThreadPool.Server.SizeWarn=5" +threadPerConnection = " --Ice.ThreadPerConnection" +blocking = " --Ice.Blocking" +productName = "Ice" + +testDefinitions = [ + (productName, "latency twoway", "latency", [ + ("1tp", "twoway", threadPoolOne), + ("4tp", "twoway", threadPoolFour), + ("tpc", "twoway " + threadPerConnection, threadPerConnection), + ] + ), + (productName, "latency oneway", "latency", [ + ("1tp", "oneway", threadPoolOne), + ("4tp", "oneway", threadPoolFour), + ("tpc", "oneway " + threadPerConnection, threadPerConnection), + ] + ), + (productName, "latency oneway batch", "latency", [ + ("1tp (batch)", "batch", threadPoolOne), + ("4tp (batch)", "batch", threadPoolFour), + ("tpc (batch)", "batch " + threadPerConnection, threadPerConnection), + ] + ), + (productName, "latency twoway AMI", "latency", [ + ("1tp (batch)", "twoway ami", threadPoolOne), + ("4tp (batch)", "twoway ami", threadPoolFour), + ("tpc (batch)", "twoway ami " + threadPerConnection, threadPerConnection), + ] + ), + (productName, "throughput byte", "throughput", [ + ("1tp", "byte", threadPoolOne), + ("4tp", "byte", threadPoolFour), + ("tpc", "byte " + threadPerConnection, threadPerConnection), + ] + ), + (productName, "throughput string sequence", "throughput", [ + ("1tp", "stringSeq", threadPoolOne), + ("4tp", "stringSeq", threadPoolFour), + ("tpc", "stringSeq " + threadPerConnection, threadPerConnection), + ] + ), + (productName, "throughput long string sequence", "throughput", [ + ("1tp", "longStringSeq", threadPoolOne), + ("4tp", "longStringSeq", threadPoolFour), + ("tpc", "longStringSeq " + threadPerConnection, threadPerConnection), + ] + ), + (productName, "throughput struct sequence", "throughput", [ + ("1tp", "structSeq", threadPoolOne), + ("4tp", "structSeq", threadPoolFour), + ("tpc", "structSeq " + threadPerConnection, threadPerConnection), + ] + ), + ] + +def getDefinitions(): + return testDefinitions diff --git a/perf/TAOTests.py b/perf/TAOTests.py new file mode 100644 index 00000000000..89409c0c23a --- /dev/null +++ b/perf/TAOTests.py @@ -0,0 +1,79 @@ +# ********************************************************************** +# +# Copyright (c) 2003-2006 ZeroC, Inc. All rights reserved. +# +# This copy of Ice is licensed to you under the terms described in the +# ICE_LICENSE file included in this distribution. +# +# ********************************************************************** + +# +# The test cases for TAO +# + +taoTPConf = " -ORBSvcConf svc.threadPool.conf" +taoTCConf = " -ORBSvcConf svc.threadPerConnection.conf" +taoReactiveConf = " -ORBSvcConf svc.reactive.conf" +taoBlockingConf = " -ORBSvcConf svc.blocking.conf" + +productName = "TAO" + +# Form +# (productName, (group name, directory, (cases...))) +# +# case form (simple descriptor, unknown, client configuration, server configuration) + +testDefinitions = [ + (productName, "latency twoway", "", [ + ("1tp", taoReactiveConf + " latency twoway", taoTPConf + " threadPool 1"), + ("4tp", taoReactiveConf + " latency twoway", taoTPConf + " threadPool 4"), + ("tpc", taoReactiveConf + " latency twoway", taoTCConf), + ("tpc blocking", taoBlockingConf + " latency twoway", taoTCConf), + ] + ), + (productName, "latency oneway", "", [ + ("1tp", taoReactiveConf + " latency oneway", taoTPConf + " threadPool 1"), + ("4tp", taoReactiveConf + " latency oneway", taoTPConf + " threadPool 4"), + ("tpc", taoReactiveConf + " latency oneway", taoTCConf), + ("tpc blocking", taoBlockingConf + " latency oneway", taoTCConf), + ] + ), + (productName, "latency twoway AMI", "", [ + ("1tp", taoReactiveConf + " latency twoway ami", taoTPConf + " threadPool 1"), + ("4tp", taoReactiveConf + " latency twoway ami", taoTPConf + " threadPool 4"), + ("tpc", taoReactiveConf + " latency twoway ami", taoTCConf), + #("tpc blocking", taoBlockingConf + " latency twoway ami", taoTCConf), + ] + ), + (productName, "throughput byte", "", [ + ("1tp", taoReactiveConf + " throughput byte", taoTPConf + " threadPool 1"), + ("4tp", taoReactiveConf + " throughput byte", taoTPConf + " threadPool 4"), + ("tpc", taoReactiveConf + " throughput byte", taoTCConf), + ("tpc blocking", taoBlockingConf + " latency throughput byte", taoTCConf), + ] + ), + (productName, "throughput string seq", "", [ + ("1tp", taoReactiveConf + " throughput string", taoTPConf + " threadPool 1"), + ("4tp", taoReactiveConf + " throughput string", taoTPConf + " threadPool 4"), + ("tpc", taoReactiveConf + " throughput string", taoTCConf), + ("tpc blocking", taoBlockingConf + " throughput string", taoTCConf), + ] + ), + (productName, "throughput long string seq", "", [ + ("1tp", taoReactiveConf + " throughput longString", taoTPConf + " threadPool 1"), + ("4tp", taoReactiveConf + " throughput longString", taoTPConf + " threadPool 4"), + ("tpc", taoReactiveConf + " throughput longString", taoTCConf), + ("tpc blocking", taoBlockingConf + " throughput longString", taoTCConf), + ] + ), + (productName, "throughput struct seq", "", [ + ("1tp", taoReactiveConf + " throughput struct", taoTPConf + " threadPool 1"), + ("4tp", taoReactiveConf + " throughput struct", taoTPConf + " threadPool 4"), + ("tpc", taoReactiveConf + " throughput struct", taoTCConf), + ("tpc blocking", taoBlockingConf + " throughput struct", taoTCConf), + ] + ), + ] + +def getDefinitions(): + return testDefinitions diff --git a/perf/config/Make.ice.rules b/perf/config/Make.ice.rules index 74edba018e8..4d3199de249 100644 --- a/perf/config/Make.ice.rules +++ b/perf/config/Make.ice.rules @@ -7,6 +7,10 @@ # # ********************************************************************** +ifeq ($(ICE_HOME),) + $(error ICE_HOME must be defined to build Ice performance testing tools.) +endif + slicedir = $(ICE_HOME)/slice configdir = $(ICE_HOME)/config @@ -39,15 +43,12 @@ SLICE2CPP = $(ICE_HOME)/bin/slice2cpp .cc.o: $(CXX) -c $(CPPFLAGS) $(CXXFLAGS) $< +# +# XXX- Fix SLICE_SRCS depend rule. +# depend:: $(SRCS) $(SLICE_SRCS) -rm -f .depend if test -n "$(SRCS)" ; then \ - $(CXX) -DMAKEDEPEND -M $(CXXFLAGS) $(CPPFLAGS) $(SRCS) | \ + $(CXX) -DMAKEDEPEND -MM $(CXXFLAGS) $(CPPFLAGS) $(SRCS) | \ $(configdir)/makedepend.py >> .depend; \ fi - -ifneq ($(TEMPLATE_REPOSITORY),) -clean:: - rm -fr $(TEMPLATE_REPOSITORY) -endif - diff --git a/perf/config/Make.icee.rules b/perf/config/Make.icee.rules index f7976d6c190..b21cd536b5c 100644 --- a/perf/config/Make.icee.rules +++ b/perf/config/Make.icee.rules @@ -7,6 +7,10 @@ # # ********************************************************************** +ifeq ($(ICEE_HOME),) + $(error ICEE_HOME must be defined to build Ice performance testing tools.) +endif + slicedir = $(ICEE_HOME)/slice configdir = $(ICEE_HOME)/config diff --git a/perf/config/Make.rules b/perf/config/Make.rules index 2dab6e491ec..b46f399d338 100644 --- a/perf/config/Make.rules +++ b/perf/config/Make.rules @@ -11,7 +11,7 @@ # If you want to compile TAO performance tests, set TAO_HOME to the # TAO source distribution directory. # -#TAO_HOME ?= +#TAO_ROOT ?= # # If you want to compile Ice performance tests, set ICE_HOME to the @@ -40,21 +40,15 @@ # Don't change anything below this line! # ---------------------------------------------------------------------- +# +# Development tree check if ICE_HOME isn't set. +# ifeq ($(ICE_HOME),) ifeq ($(shell test -d $(top_srcdir)/../ice/slice && echo 0),0) ICE_HOME=$(top_srcdir)/../ice endif endif -ifeq ($(ICE_HOME),) - ifeq ($(TAO_HOME),) - ifeq ($(OMNIORB_HOME),) - $(error Please define ICE_HOME, OMNIORB_HOME or TAO_HOME! See config/Make.rules) - endif - endif -endif - - OPTIMIZE_SPEED = yes OPTIMIZE = yes diff --git a/perf/config/Make.tao.rules b/perf/config/Make.tao.rules new file mode 100644 index 00000000000..5d7c896ab1a --- /dev/null +++ b/perf/config/Make.tao.rules @@ -0,0 +1,54 @@ +# ********************************************************************** +# +# Copyright (c) 2003-2005 ZeroC, Inc. All rights reserved. +# +# This copy of Ice is licensed to you under the terms described in the +# ICE_LICENSE file included in this distribution. +# +# ********************************************************************** + +ifeq ($(TAO_ROOT),) + $(error Please define TAO_ROOT! See config/Make.rules) +endif + +ifeq ($(ICE_HOME),) + $(error Please define ICE_HOME! See config/Make.rules) +endif + +include $(ICE_HOME)/config/Make.rules.$(UNAME) + +CPPFLAGS := -I. -I$(TAO_ROOT)/include -I$(ICE_HOME)/include $(CPPFLAGS) +CXXFLAGS := -O3 -pthread -Wall -D_REENTRANT + +ifeq ($(DEBUG),yes) + CXXFLAGS := -g $(CXXFLAGS) +endif + +LDFLAGS := -L$(TAO_ROOT)/lib $(LDPLATFORMFLAGS) + +ICE_LIBS ?= -L$(ICE_HOME)/lib -lIce -lIceUtil + +.SUFFIXES: +.SUFFIXES: .cc .cpp .o .py + +%.h %.cpp: %.ice + rm -f $(*F).h $(*F).cpp + $(SLICE2CPP) $(SLICE2CPPFLAGS) $(*F).ice + +.cpp.o: + $(CXX) -c $(CPPFLAGS) $(CXXFLAGS) $< + +.cc.o: + $(CXX) -c $(CPPFLAGS) $(CXXFLAGS) $< + +depend:: $(SRCS) + -rm -f .depend + if test -n "$(SRCS)" ; then \ + $(CXX) -DMAKEDEPEND -MM $(CXXFLAGS) $(CPPFLAGS) $^ | \ + (ace=`echo "$$TAO_ROOT" | sed -e 's/\//\\\\\//g'` ; \ + icedir=`echo "$$ICE_HOME" | sed -e 's/\//\\\\\//g'` ; \ + while read line ; do \ + echo $$line | sed -e "s/$$ace/\$$(TAO_ROOT)/g" | \ + sed -e "s/$$icedir/\$$(ICE_HOME)/g" ; \ + done) >> .depend ;\ + fi diff --git a/perf/config/TestUtil.py b/perf/config/TestUtil.py index 95c766222f5..f1776aaf119 100644 --- a/perf/config/TestUtil.py +++ b/perf/config/TestUtil.py @@ -10,6 +10,9 @@ import os, sys, pickle, platform +# +# XXX Why do we need to do this? +# for toplevel in [".", "..", "../..", "../../..", "../../../.."]: toplevel = os.path.normpath(toplevel) if os.path.exists(os.path.join(toplevel, "config", "TestUtil.py")): @@ -294,6 +297,13 @@ class AllResults : def printAllAsCsv(self, results, tests, names, hosts, products): + # + # TODO: CSV's are occasionally imported into databases and + # spreadsheets. It would be better to have the CSV form more + # closely follow a raw table form then to break it up into + # groups. + # + print "Test, Configuration, ", for product in products: for host in hosts: @@ -390,8 +400,7 @@ class AllResults : class Test : - def __init__(self, expr, results, i, product, test, directory = ""): - self.expr = expr + def __init__(self, results, i, product, test, directory = ""): self.results = results self.iteration = i self.product = product @@ -403,15 +412,6 @@ class Test : def run(self, name, options): - match = len(self.expr) == 0 - for e in self.expr: - if e.match(self.product + " " + self.test + " " + name): - match = True - break; - - if not match: - return - print str(self.iteration) + ": " + self.product + " " + self.test + " " + name + "...", sys.stdout.flush() diff --git a/perf/runIcePerf.py b/perf/runIcePerf.py index 0cb96588c99..e3f227872d6 100755 --- a/perf/runIcePerf.py +++ b/perf/runIcePerf.py @@ -8,6 +8,12 @@ # # ********************************************************************** +# +# TODO: +# - should add appropriate lib directories to LD_LIBRARY_PATH or PATH as +# the platform warrants. +# + import os, sys, getopt, re, platform for toplevel in [".", "..", "../..", "../../..", "../../../.."]: @@ -33,23 +39,18 @@ def usage(): print "Command line options:" print "" print " -h | --help Print this help message." - print " -i | --iter Defines the number of the test will be run." + print " -i | --iter Defines the number of the test will be run (default once)." print " -n | -hostname Defines the hostname." print " -o | -output Defines the name of the output file." + print " -csv Create a CSV format data file" print "" sys.exit(2) - -# -# Ice configuration properties. -# -threadPoolOne = " --Ice.ThreadPool.Server.Size=1 --Ice.ThreadPool.Server.SizeMax=1 --Ice.ThreadPool.Server.SizeWarn=2" -threadPoolFour = " --Ice.ThreadPool.Server.Size=4 --Ice.ThreadPool.Server.SizeMax=4 --Ice.ThreadPool.Server.SizeWarn=5" -threadPerConnection = " --Ice.ThreadPerConnection" -blocking = " --Ice.Blocking" - class ClientServerTest(TestUtil.Test) : + def __init__(self, results, i, product, test, directory = ""): + TestUtil.Test.__init__(self, results, i, product, test, directory) + def run(self, name, directory, clientOptions, serverOptions): TestUtil.Test.run(self, name, { "client" : clientOptions, "server" : serverOptions, "directory" : directory }) @@ -59,10 +60,14 @@ class ClientServerTest(TestUtil.Test) : cwd = os.getcwd() os.chdir(os.path.join(toplevel, "src", self.directory, options["directory"])) - serverPipe = os.popen(os.path.join(".", "server") + " " + options["server"]) + redirectStdErr = " 2>/dev/null" + if TestUtil.isWin32(): + redirectStdErr = " 2>NUL" + + serverPipe = os.popen(os.path.join(".", "server") + " " + options["server"] + redirectStdErr) TestUtil.getAdapterReady(serverPipe) - clientPipe = os.popen(os.path.join(".", "client") + " " + options["client"]) + clientPipe = os.popen(os.path.join(".", "client") + " " + options["client"] + redirectStdErr) result = float(clientPipe.read()) clientPipe.close() @@ -72,201 +77,16 @@ class ClientServerTest(TestUtil.Test) : os.chdir(cwd) return result - -def runIcePerfs(expr, results, i): - - 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 = 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 = 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 = 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 = 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 = 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 = 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 = 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 runIceEPerfs(expr, results, i): - - test = ClientServerTest(expr, results, i, "IceE", "latency twoway") - test.run("tpc", "latency", "twoway ", "") - test.run("tpc blocking", "latency", "twoway " + blocking, "") - - test = ClientServerTest(expr, results, i, "IceE", "latency oneway") - test.run("tpc", "latency", "oneway ", "") - test.run("tpc blocking", "latency", "oneway " + blocking, "") - - test = ClientServerTest(expr, results, i, "IceE", "latency oneway") - test.run("tpc (batch)", "latency", "batch ", "") - test.run("tpc blocking (batch)", "latency", "batch " + blocking, "") - - test = ClientServerTest(expr, results, i, "IceE", "throughput byte") - test.run("tpc", "throughput", "byte ", "") - test.run("tpc blocking", "throughput", "byte " + blocking, "") - - test = ClientServerTest(expr, results, i, "IceE", "throughput string seq") - test.run("tpc", "throughput", "stringSeq ", "") - test.run("tpc blocking", "throughput", "stringSeq " + blocking, "") - - test = ClientServerTest(expr, results, i, "IceE", "throughput long string seq") - test.run("tpc", "throughput", "longStringSeq ", "") - test.run("tpc blocking", "throughput", "longStringSeq " + blocking, "") - - test = ClientServerTest(expr, results, i, "IceE", "throughput struct seq") - test.run("tpc", "throughput", "structSeq ", "") - test.run("tpc blocking", "throughput", "structSeq " + blocking, "") - - #test = ClientServerTest(expr, results, i, "IceE", "throughput byte (receive)") - #test.run("tpc", "throughput", "receive byte ", "") - #test.run("tpc blocking", "throughput", "receive byte " + blocking, "") - - #test = ClientServerTest(expr, results, i, "IceE", "throughput string seq (receive)") - #test.run("tpc", "throughput", "receive stringSeq ", "") - #test.run("tpc blocking", "throughput", "receive stringSeq " + blocking, "") - - #test = ClientServerTest(expr, results, i, "IceE", "throughput long string seq (receive)") - #test.run("tpc", "throughput", "receive longStringSeq ", "") - #test.run("tpc blocking", "throughput", "receive longStringSeq " + blocking, "") - - #test = ClientServerTest(expr, results, i, "IceE", "throughput struct seq (receive)") - #test.run("tpc", "throughput", "receive structSeq ", "") - #test.run("tpc blocking", "throughput", "receive structSeq " + blocking, "") - -def runTAOPerfs(expr, results, i): - - taoTPConf = " -ORBSvcConf svc.threadPool.conf" - taoTCConf = " -ORBSvcConf svc.threadPerConnection.conf" - taoReactiveConf = " -ORBSvcConf svc.reactive.conf" - taoBlockingConf = " -ORBSvcConf svc.blocking.conf" - - test = ClientServerTest(expr, results, i, "TAO", "latency twoway") - test.run("1tp", "", taoReactiveConf + " latency twoway", taoTPConf + " threadPool 1") - test.run("4tp", "", taoReactiveConf + " latency twoway", taoTPConf + " threadPool 4") - test.run("tpc", "", taoReactiveConf + " latency twoway", taoTCConf) - test.run("tpc blocking", "", taoBlockingConf + " latency twoway", taoTCConf) - - test = ClientServerTest(expr, results, i, "TAO", "latency oneway") - test.run("1tp", "", taoReactiveConf + " latency oneway", taoTPConf + " threadPool 1") - test.run("4tp", "", taoReactiveConf + " latency oneway", taoTPConf + " threadPool 4") - test.run("tpc", "", taoReactiveConf + " latency oneway", taoTCConf) - test.run("tpc blocking", "", taoBlockingConf + " latency oneway", taoTCConf) - - test = ClientServerTest(expr, results, i, "TAO", "latency twoway AMI") - test.run("1tp", "", taoReactiveConf + " latency twoway ami", taoTPConf + " threadPool 1") - test.run("4tp", "", taoReactiveConf + " latency twoway ami", taoTPConf + " threadPool 4") - test.run("tpc", "", taoReactiveConf + " latency twoway ami", taoTCConf) - - test = ClientServerTest(expr, results, i, "TAO", "throughput byte") - test.run("1tp", "", taoReactiveConf + " throughput byte", taoTPConf + " threadPool 1") - test.run("4tp", "", taoReactiveConf + " throughput byte", taoTPConf + " threadPool 4") - test.run("tpc", "", taoReactiveConf + " throughput byte", taoTCConf) - test.run("tpc blocking", "", taoBlockingConf + " throughput byte", taoTCConf) - - test = ClientServerTest(expr, results, i, "TAO", "throughput string seq") - test.run("1tp", "", taoReactiveConf + " throughput string", taoTPConf + " threadPool 1") - test.run("4tp", "", taoReactiveConf + " throughput string", taoTPConf + " threadPool 4") - test.run("tpc", "", taoReactiveConf + " throughput string", taoTCConf) - test.run("tpc blocking", "", taoBlockingConf + " throughput string", taoTCConf) - - test = ClientServerTest(expr, results, i, "TAO", "throughput long string seq") - test.run("1tp", "", taoReactiveConf + " throughput longString", taoTPConf + " threadPool 1") - test.run("4tp", "", taoReactiveConf + " throughput longString", taoTPConf + " threadPool 4") - test.run("tpc", "", taoReactiveConf + " throughput longString", taoTCConf) - test.run("tpc blocking", "", taoBlockingConf + " throughput longString", taoTCConf) - - test = ClientServerTest(expr, results, i, "TAO", "throughput struct seq") - test.run("1tp", "", taoReactiveConf + " throughput struct", taoTPConf + " threadPool 1") - test.run("4tp", "", taoReactiveConf + " throughput struct", taoTPConf + " threadPool 4") - test.run("tpc", "", taoReactiveConf + " throughput struct", taoTCConf) - test.run("tpc blocking", "", taoBlockingConf + " throughput struct", taoTCConf) - -def runOmniORBPerfs(expr, results, i, unixSockets): - - threadPerConnection = "-ORBthreadPerConnectionPolicy 1" - threadPoolWithOpt = "-ORBthreadPerConnectionPolicy 0" - threadPoolWithoutOpt = "-ORBthreadPerConnectionPolicy 0 -ORBthreadPoolWatchConnection 0" - product = "omniORB" - - if unixSockets: - threadPerConnection += " -ORBendPoint giop:unix::" - threadPoolWithOpt += " -ORBendPoint giop:unix::" - threadPoolWithoutOpt += " -ORBendPoint giop:unix::" - product = "omniORB (unix)" - - test = ClientServerTest(expr, results, i, product, "latency twoway", "omniORB") - if not TestUtil.isWin32(): - test.run("1tp", "", "latency twoway", threadPoolWithoutOpt) - test.run("1tp w/ opt", "", "latency twoway", threadPoolWithOpt) - test.run("tpc", "", "latency twoway", threadPerConnection) - - test = ClientServerTest(expr, results, i, product, "latency oneway", "omniORB") - if not TestUtil.isWin32(): - test.run("1tp", "", "latency oneway", threadPoolWithoutOpt) - test.run("1tp w/ opt", "", "latency oneway", threadPoolWithOpt) - test.run("tpc", "", "latency oneway", threadPerConnection) - - test = ClientServerTest(expr, results, i, product, "throughput byte", "omniORB") - if not TestUtil.isWin32(): - test.run("1tp", "", "throughput byte", threadPoolWithoutOpt) - test.run("1tp w/ opt", "", "throughput byte", threadPoolWithOpt) - test.run("tpc", "", "throughput byte", threadPerConnection) - - test = ClientServerTest(expr, results, i, product, "throughput string seq", "omniORB") - if not TestUtil.isWin32(): - test.run("1tp", "", "throughput string", threadPoolWithoutOpt) - test.run("1tp w/ opt", "", "throughput string", threadPoolWithOpt) - test.run("tpc", "", "throughput string", threadPerConnection) - - test = ClientServerTest(expr, results, i, product, "throughput long string seq", "omniORB") - if not TestUtil.isWin32(): - test.run("1tp", "", "throughput longString", threadPoolWithoutOpt) - test.run("1tp w/ opt", "", "throughput longString", threadPoolWithOpt) - test.run("tpc", "", "throughput longString", threadPerConnection) - - test = ClientServerTest(expr, results, i, product, "throughput struct seq", "omniORB") - if not TestUtil.isWin32(): - test.run("1tp", "", "throughput struct", threadPoolWithoutOpt) - test.run("1tp w/ opt", "", "throughput struct", threadPoolWithOpt) - test.run("tpc", "", "throughput struct", threadPerConnection) try: opts, pargs = getopt.getopt(sys.argv[1:], 'hi:o:n:', ['help', 'iter=', 'output=', 'hostname=']); except getopt.GetoptError: usage() -niter = max -printResults = False +niter = 1 hostname = "" outputFile = "" +csv = False for o, a in opts: if o == '-i' or o == "--iter": niter = int(a) @@ -276,6 +96,8 @@ for o, a in opts: outputFile = a elif o == '-n' or o == "--hostname": hostname = a + elif o == '-csv': + cvs = True if outputFile == "": (system, name, ver, build, machine, processor) = platform.uname() @@ -295,33 +117,51 @@ if not os.environ.has_key('ICE_HOME'): os.environ['ICE_HOME'] = os.path.join(toplevel, "..", "ice") if not os.environ.has_key('ICE_HOME') and \ - not os.environ.has_key('TAO_HOME') and \ - not os.environ.has_key('OMNIORB_HOME') and \ + not os.environ.has_key('TAO_ROOT') and \ not os.environ.has_key('ICEE_HOME'): - print "You need to set at least ICE_HOME, ICEE_HOME, OMNIORB_HOME or TAO_HOME!" + print "You need to set at least ICE_HOME, ICEE_HOME or TAO_ROOT!" sys.exit(1) results = TestUtil.HostResults(hostname, outputFile) +configs = [ ("IceTests", "ICE_HOME"), ("TAOTests", "TAO_ROOT"), ("IceETests", "ICEE_HOME")] -i = 1 +tests = [] +for f, e in configs: + if os.path.exists(f + ".py") and os.environ.has_key(e): + m = __import__(f) + tests.extend(m.getDefinitions()) + +# +# Filter tests for those that match our pattern. +# +if len(expr) > 0: + candidates = tests + tests = [] + for product, group, dir, cases in candidates: + allowedCases = [] + for e in expr: + for c in cases: + criteria = "%s %s %s" % (product, group, c[0]) + if e.match(criteria): + allowedCases.append(c) + if len(allowedCases) > 0: + tests.append((product, group, dir, allowedCases)) + +i = 1 while i <= niter: try: - if os.environ.has_key('ICE_HOME'): - runIcePerfs(expr, results, i) - if os.environ.has_key('ICEE_HOME'): - runIceEPerfs(expr, results, i) - if os.environ.has_key('TAO_HOME'): - runTAOPerfs(expr, results, i) - if os.environ.has_key('OMNIORB_HOME'): - runOmniORBPerfs(expr, results, i, 0) - if not TestUtil.isWin32(): - runOmniORBPerfs(expr, results, i, 1) - i += 1 + for product, group, dir, cases in tests: + test = ClientServerTest(results, i, product, group) + for name, clientargs, serverargs in cases: + test.run(name, dir, clientargs, serverargs) except KeyboardInterrupt: - break + break + i += 1 print "\n" print "All results:" all = TestUtil.AllResults() all.add(results) all.printAll(TestUtil.ValuesMeanAndBest(), False) +if csv: + all.printAll(TestUtil.ValuesMeanAndBest(), True) diff --git a/perf/src/CosEvent/Makefile b/perf/src/CosEvent/Makefile index d91c0cd32a9..d73206f8964 100644 --- a/perf/src/CosEvent/Makefile +++ b/perf/src/CosEvent/Makefile @@ -7,6 +7,15 @@ # # ********************************************************************** +# +# TODO: +# +# 1. We probably would like to take advantage of the Ice Make.rules +# files. +# + +top_srcdir = ../.. + TARGETS = Service \ Consumer \ Supplier \ @@ -36,26 +45,18 @@ DESTROYER_OBJS = Destroyer.o NOTIFIER_OBJS = Notifier.o \ SyncC.o -# -# XXX: These libraries need to be cleaned up! -# +SRCS = $(NOTIFIER_OBJS:.o=.cpp) $(DESTROYER_OBJS:.o=.cpp) $(SERVICE_OBJS:.o=.cpp) \ + $(CONSUMER_OBJS:.o=.cpp) $(SUPPLIER_OBJS:.o=.cpp) + +include $(top_srcdir)/config/Make.rules +include $(top_srcdir)/config/Make.tao.rules -LDFLAGS += -L$(ACE_ROOT)/lib TAO_CLIENTLIBS = -lTAO TAO_POALIBS = -lTAO_PortableServer EVENT_LIBS = -lTAO_CosEvent -lTAO_CosEvent_Skel -lTAO_Messaging SERVICE_LIBS = -lTAO_CosEvent_Serv -CPPFLAGS += -I. -I$(ACE_ROOT)/include - -# To build multiple executables in the same directory on AIX, it works -# best to wipe out any previously-created tempinc directory. -# The compiler/linker isn't too smart about instantiating templates... -ifdef TEMPINCDIR -COMPILE.cc := $(RM) -rf tempinc; $(COMPILE.cc) -endif - #---------------------------------------------------------------------------- # Local targets #---------------------------------------------------------------------------- @@ -93,3 +94,5 @@ PerfS.cpp PerfC.cpp: Perf.idl SyncC.cpp SyncS.cpp: Sync.idl $(TAO_ROOT)/bin/tao_idl -Ge 1 $^ + +include .depend diff --git a/perf/src/CosEvent/Service.cpp b/perf/src/CosEvent/Service.cpp index 5bef6ba75be..7004d6f07e6 100644 --- a/perf/src/CosEvent/Service.cpp +++ b/perf/src/CosEvent/Service.cpp @@ -15,36 +15,6 @@ const char *ior_output_file = "ec.ior"; -// -// Parse command line arguments, returning 0 on success, -1 on failure. -// -static int -parse_args(int argc, char *argv[]) -{ - ACE_Get_Opt get_opts(argc, argv, "n:o:"); - int c; - - while((c = get_opts()) != -1) - { - switch(c) - { - case 'o': - ior_output_file = get_opts.opt_arg(); - break; - - case '?': - default: - ACE_ERROR_RETURN ((LM_ERROR, - "usage: %s " - "-o <iorfile>" - "\n", - argv [0]), - -1); - } - } - return 0; -} - class EventChannel : public TAO_CEC_EventChannel { public: diff --git a/perf/src/Ice/dummy/Client.cpp b/perf/src/Ice/dummy/Client.cpp index e632762bbf6..4c71dffa9ab 100755 --- a/perf/src/Ice/dummy/Client.cpp +++ b/perf/src/Ice/dummy/Client.cpp @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2005 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2006 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/perf/src/Ice/dummy/Server.cpp b/perf/src/Ice/dummy/Server.cpp index 49b3bdbad3b..9874ead7e23 100755 --- a/perf/src/Ice/dummy/Server.cpp +++ b/perf/src/Ice/dummy/Server.cpp @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2005 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2006 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/perf/src/Ice/latency/Client.cpp b/perf/src/Ice/latency/Client.cpp index 94183b62c30..6985106e469 100755 --- a/perf/src/Ice/latency/Client.cpp +++ b/perf/src/Ice/latency/Client.cpp @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2005 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2006 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. @@ -21,7 +21,8 @@ public: { } - void waitFinished() + void + waitFinished() { IceUtil::Monitor<IceUtil::Mutex>::Lock sync(*this); while(!_finished) @@ -32,7 +33,8 @@ public: } private: - virtual void ice_response() + virtual void + ice_response() { IceUtil::Monitor<IceUtil::Mutex>::Lock sync(*this); assert(!_finished); @@ -40,7 +42,8 @@ private: notify(); } - virtual void ice_exception(const ::Ice::Exception&) + virtual void + ice_exception(const ::Ice::Exception&) { assert(false); } @@ -129,7 +132,7 @@ run(int argc, char* argv[], const Ice::CommunicatorPtr& communicator) { if(i != 0 && i % 100 == 0) { - batchprx->ice_connection()->flushBatchRequests(); + batchprx->ice_getConnection()->flushBatchRequests(); } } @@ -159,7 +162,7 @@ run(int argc, char* argv[], const Ice::CommunicatorPtr& communicator) { if(batch) { - batchprx->ice_connection()->flushBatchRequests(); + batchprx->ice_getConnection()->flushBatchRequests(); } latency->ping(); } @@ -180,9 +183,10 @@ main(int argc, char* argv[]) try { - Ice::PropertiesPtr properties = Ice::createProperties(); - properties->load("config"); - communicator = Ice::initializeWithProperties(argc, argv, properties); + Ice::InitializationData initData; + initData.properties = Ice::createProperties(); + initData.properties->load("config"); + communicator = Ice::initialize(argc, argv, initData); status = run(argc, argv, communicator); } catch(const Ice::Exception& ex) diff --git a/perf/src/Ice/latency/Latency.ice b/perf/src/Ice/latency/Latency.ice index c236f875e15..eca2b7a55cb 100755 --- a/perf/src/Ice/latency/Latency.ice +++ b/perf/src/Ice/latency/Latency.ice @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2005 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2006 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/perf/src/Ice/latency/Server.cpp b/perf/src/Ice/latency/Server.cpp index df8149a41a2..3995530b1ee 100755 --- a/perf/src/Ice/latency/Server.cpp +++ b/perf/src/Ice/latency/Server.cpp @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2005 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2006 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/perf/src/Ice/throughput/Client.cpp b/perf/src/Ice/throughput/Client.cpp index 772e82189a3..b429445622d 100755 --- a/perf/src/Ice/throughput/Client.cpp +++ b/perf/src/Ice/throughput/Client.cpp @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2005 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2006 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. @@ -70,7 +70,8 @@ run(int argc, char* argv[], const Ice::CommunicatorPtr& communicator) StringSeq stringSeq(StringSeqSize, "hello"); - StringSeq longStringSeq(LongStringSeqSize, "As far as the laws of mathematics refer to reality, they are not certain; and as far as they are certain, they do not refer to reality."); + StringSeq longStringSeq(LongStringSeqSize, "As far as the laws of mathematics refer to reality, " + "they are not certain; and as far as they are certain, they do not refer to reality."); StringDoubleSeq structSeq(StringDoubleSeqSize); for(i = 0; i < StringDoubleSeqSize; ++i) @@ -79,7 +80,10 @@ run(int argc, char* argv[], const Ice::CommunicatorPtr& communicator) structSeq[i].d = 3.14; } - throughput->ice_ping(); // Initial ping to setup the connection. + // + // Force the connection to be established by calling a ping. + // + throughput->ice_ping(); IceUtil::Time tm = IceUtil::Time::now(); const int repetitions = 1000; @@ -128,9 +132,10 @@ main(int argc, char* argv[]) try { - Ice::PropertiesPtr properties = Ice::createProperties(); - properties->load("config"); - communicator = Ice::initializeWithProperties(argc, argv, properties); + Ice::InitializationData initData; + initData.properties = Ice::createProperties(); + initData.properties->load("config"); + communicator = Ice::initialize(argc, argv, initData); status = run(argc, argv, communicator); } catch(const Ice::Exception& ex) diff --git a/perf/src/Ice/throughput/Makefile b/perf/src/Ice/throughput/Makefile index 7c93779f1de..e4dd1aba7f9 100644 --- a/perf/src/Ice/throughput/Makefile +++ b/perf/src/Ice/throughput/Makefile @@ -1,6 +1,6 @@ # ********************************************************************** # -# Copyright (c) 2003-2005 ZeroC, Inc. All rights reserved. +# Copyright (c) 2003-2006 ZeroC, Inc. All rights reserved. # # This copy of Ice is licensed to you under the terms described in the # ICE_LICENSE file included in this distribution. diff --git a/perf/src/Ice/throughput/Server.cpp b/perf/src/Ice/throughput/Server.cpp index b5b7a20fca8..07262635189 100755 --- a/perf/src/Ice/throughput/Server.cpp +++ b/perf/src/Ice/throughput/Server.cpp @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2005 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2006 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/perf/src/Ice/throughput/Throughput.ice b/perf/src/Ice/throughput/Throughput.ice index 7e6cc026b5f..849205d000f 100755 --- a/perf/src/Ice/throughput/Throughput.ice +++ b/perf/src/Ice/throughput/Throughput.ice @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2005 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2006 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/perf/src/Ice/throughput/ThroughputI.h b/perf/src/Ice/throughput/ThroughputI.h index bac1df37b2f..a8e34f69972 100755 --- a/perf/src/Ice/throughput/ThroughputI.h +++ b/perf/src/Ice/throughput/ThroughputI.h @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2005 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2006 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/perf/src/IceE/latency/Client.cpp b/perf/src/IceE/latency/Client.cpp index f2c8ce5e6d3..c84b91394a9 100755 --- a/perf/src/IceE/latency/Client.cpp +++ b/perf/src/IceE/latency/Client.cpp @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2005 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2006 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. @@ -86,7 +86,7 @@ run(int argc, char* argv[], const Ice::CommunicatorPtr& communicator) { if(i != 0 && i % 100 == 0) { - batchprx->ice_connection()->flushBatchRequests(); + batchprx->ice_getConnection()->flushBatchRequests(); } } @@ -108,7 +108,7 @@ run(int argc, char* argv[], const Ice::CommunicatorPtr& communicator) { if(batch) { - batchprx->ice_connection()->flushBatchRequests(); + batchprx->ice_getConnection()->flushBatchRequests(); } latency->ping(); } @@ -129,9 +129,10 @@ main(int argc, char* argv[]) try { - Ice::PropertiesPtr properties = Ice::createProperties(); - properties->load("config"); - communicator = Ice::initializeWithProperties(argc, argv, properties); + Ice::InitializationData initData; + initData.properties = Ice::createProperties(); + initData.properties->load("config"); + communicator = Ice::initialize(argc, argv, initData); status = run(argc, argv, communicator); } catch(const Ice::Exception& ex) diff --git a/perf/src/IceE/latency/Latency.ice b/perf/src/IceE/latency/Latency.ice index c236f875e15..eca2b7a55cb 100755 --- a/perf/src/IceE/latency/Latency.ice +++ b/perf/src/IceE/latency/Latency.ice @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2005 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2006 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/perf/src/IceE/latency/Server.cpp b/perf/src/IceE/latency/Server.cpp index c4cbabae3cb..90eeb304381 100755 --- a/perf/src/IceE/latency/Server.cpp +++ b/perf/src/IceE/latency/Server.cpp @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2005 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2006 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. @@ -34,7 +34,7 @@ run(int argc, char* argv[], const Ice::CommunicatorPtr& communicator) { Ice::ObjectAdapterPtr adapter = communicator->createObjectAdapter("Latency"); Ice::ObjectPtr object = new LatencyI; - adapter->add(object, Ice::stringToIdentity("latency")); + adapter->add(object, communicator->stringToIdentity("latency")); adapter->activate(); communicator->waitForShutdown(); return EXIT_SUCCESS; @@ -48,9 +48,10 @@ main(int argc, char* argv[]) try { - Ice::PropertiesPtr properties = Ice::createProperties(); - properties->load("config"); - communicator = Ice::initializeWithProperties(argc, argv, properties); + Ice::InitializationData initData; + initData.properties = Ice::createProperties(); + initData.properties->load("config"); + communicator = Ice::initialize(argc, argv, initData); status = run(argc, argv, communicator); } catch(const Ice::Exception& ex) diff --git a/perf/src/IceE/throughput/Client.cpp b/perf/src/IceE/throughput/Client.cpp index 5b3f2571ae3..8b88410d853 100755 --- a/perf/src/IceE/throughput/Client.cpp +++ b/perf/src/IceE/throughput/Client.cpp @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2005 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2006 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. @@ -181,9 +181,10 @@ main(int argc, char* argv[]) try { - Ice::PropertiesPtr properties = Ice::createProperties(); - properties->load("config"); - communicator = Ice::initializeWithProperties(argc, argv, properties); + Ice::InitializationData initData; + initData.properties = Ice::createProperties(); + initData.properties->load("config"); + communicator = Ice::initialize(argc, argv, initData); status = run(argc, argv, communicator); } catch(const Ice::Exception& ex) diff --git a/perf/src/IceE/throughput/Server.cpp b/perf/src/IceE/throughput/Server.cpp index a57b369d9e2..9f112f9e7db 100755 --- a/perf/src/IceE/throughput/Server.cpp +++ b/perf/src/IceE/throughput/Server.cpp @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2005 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2006 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. @@ -18,7 +18,7 @@ run(int argc, char* argv[], const Ice::CommunicatorPtr& communicator) { Ice::ObjectAdapterPtr adapter = communicator->createObjectAdapter("Throughput"); Ice::ObjectPtr object = new ThroughputI; - adapter->add(object, Ice::stringToIdentity("throughput")); + adapter->add(object, communicator->stringToIdentity("throughput")); adapter->activate(); communicator->waitForShutdown(); return EXIT_SUCCESS; @@ -31,10 +31,10 @@ main(int argc, char* argv[]) Ice::CommunicatorPtr communicator; try - { - Ice::PropertiesPtr properties = Ice::createProperties(); - properties->load("config"); - communicator = Ice::initializeWithProperties(argc, argv, properties); + { Ice::InitializationData initData; + initData.properties = Ice::createProperties(); + initData.properties->load("config"); + communicator = Ice::initialize(argc, argv, initData); status = run(argc, argv, communicator); } catch(const Ice::Exception& ex) diff --git a/perf/src/IceE/throughput/Throughput.ice b/perf/src/IceE/throughput/Throughput.ice index ad500f4538e..0d2f761f59e 100755 --- a/perf/src/IceE/throughput/Throughput.ice +++ b/perf/src/IceE/throughput/Throughput.ice @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2005 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2006 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/perf/src/IceE/throughput/ThroughputI.h b/perf/src/IceE/throughput/ThroughputI.h index a8b8dd05b77..27fe1b8b2c3 100755 --- a/perf/src/IceE/throughput/ThroughputI.h +++ b/perf/src/IceE/throughput/ThroughputI.h @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2005 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2006 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/perf/src/IceStorm/Publisher.cpp b/perf/src/IceStorm/Publisher.cpp index 8db13df76ba..742202760cd 100644 --- a/perf/src/IceStorm/Publisher.cpp +++ b/perf/src/IceStorm/Publisher.cpp @@ -13,6 +13,7 @@ #include <Perf.h> #include <sys/time.h> + using namespace std; using namespace Perf; diff --git a/perf/src/TAO/Makefile b/perf/src/TAO/Makefile index 04e893d11dd..4dbdd2a21c0 100644 --- a/perf/src/TAO/Makefile +++ b/perf/src/TAO/Makefile @@ -19,32 +19,30 @@ OBJS = TestC.o \ COBJS = client.o \ Roundtrip_Handler.o \ - Worker_Thread.o + WorkerThread.o SOBJS = server.o \ Roundtrip.o \ - Worker_Thread.o + WorkerThread.o SRCS = $(OBJS:.o=.cpp) \ $(COBJS:.o=.cpp) \ $(SOBJS:.o=.cpp) include $(top_srcdir)/config/Make.rules +include $(top_srcdir)/config/Make.tao.rules -CPPFLAGS := -I. -I$(TAO_HOME)/include -I$(ICE_HOME)/include $(CPPFLAGS) -CXXFLAGS := -O3 -pthread -Wall -D_REENTRANT -LDFLAGS := -L$(TAO_HOME)/lib -L$(ICE_HOME)/lib -LIBS := -lTAO_Messaging -lTAO_Strategies -lTAO_PortableServer -lIceUtil -lpthread +LIBS := -lTAO_Messaging -lTAO_Strategies -lTAO_PortableServer -lpthread $(CLIENT): $(OBJS) $(COBJS) rm -f $@ - $(CXX) $(LDFLAGS) -o $@ $(OBJS) $(COBJS) $(LIBS) + $(CXX) $(LDFLAGS) -o $@ $(OBJS) $(COBJS) $(ICE_LIBS) $(LIBS) $(SERVER): $(OBJS) $(SOBJS) rm -f $@ - $(CXX) $(LDFLAGS) -o $@ $(OBJS) $(SOBJS) $(LIBS) + $(CXX) $(LDFLAGS) -o $@ $(OBJS) $(SOBJS) $(ICE_LIBS) $(LIBS) -TestS.cpp: Test.idl - $(TAO_HOME)/bin/tao_idl -Ge 1 -GC Test.idl +TestS.cpp TestC.cpp: Test.idl + $(TAO_ROOT)/bin/tao_idl -Ge 1 -GC Test.idl include .depend diff --git a/perf/src/TAO/Roundtrip.cpp b/perf/src/TAO/Roundtrip.cpp index db593b81485..a3f9b192245 100644 --- a/perf/src/TAO/Roundtrip.cpp +++ b/perf/src/TAO/Roundtrip.cpp @@ -1,50 +1,52 @@ +// ********************************************************************** // -// Roundtrip.cpp,v 1.4 2004/01/11 05:06:02 bala Exp +// Copyright (c) 2003-2006 ZeroC, Inc. All rights reserved. // -#include "Roundtrip.h" - -#include <iostream> +// This copy of Ice is licensed to you under the terms described in the +// ICE_LICENSE file included in this distribution. +// +// ********************************************************************** -ACE_RCSID(Thread_Pool_Latency, Roundtrip, "Roundtrip.cpp,v 1.4 2004/01/11 05:06:02 bala Exp") +#include <Roundtrip.h> -Roundtrip::Roundtrip (CORBA::ORB_ptr orb) - : orb_ (CORBA::ORB::_duplicate (orb)) +Roundtrip::Roundtrip(CORBA::ORB_ptr orb) : + _orb(CORBA::ORB::_duplicate(orb)) { } void -Roundtrip::sendByteSeq (const Test::ByteSeq & ACE_ENV_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException)) +Roundtrip::sendByteSeq(const Test::ByteSeq & ACE_ENV_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC((CORBA::SystemException)) { } void -Roundtrip::sendStringSeq (const Test::StringSeq & ACE_ENV_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException)) +Roundtrip::sendStringSeq(const Test::StringSeq & ACE_ENV_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC((CORBA::SystemException)) { } void -Roundtrip::sendStringDoubleSeq (const Test::StringDoubleSeq & ACE_ENV_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException)) +Roundtrip::sendStringDoubleSeq(const Test::StringDoubleSeq & ACE_ENV_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC((CORBA::SystemException)) { } void -Roundtrip::test_method (ACE_ENV_SINGLE_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException)) +Roundtrip::test_method(ACE_ENV_SINGLE_ARG_DECL) + ACE_THROW_SPEC((CORBA::SystemException)) { } void -Roundtrip::test_oneway (ACE_ENV_SINGLE_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException)) +Roundtrip::test_oneway(ACE_ENV_SINGLE_ARG_DECL) + ACE_THROW_SPEC((CORBA::SystemException)) { } void -Roundtrip::shutdown (ACE_ENV_SINGLE_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException)) +Roundtrip::shutdown(ACE_ENV_SINGLE_ARG_DECL) + ACE_THROW_SPEC((CORBA::SystemException)) { - this->orb_->shutdown (0 ACE_ENV_ARG_PARAMETER); + _orb->shutdown(0 ACE_ENV_ARG_PARAMETER); } diff --git a/perf/src/TAO/Roundtrip.h b/perf/src/TAO/Roundtrip.h index 3131acf4c28..c13b58344b2 100644 --- a/perf/src/TAO/Roundtrip.h +++ b/perf/src/TAO/Roundtrip.h @@ -1,57 +1,63 @@ +// ********************************************************************** // -// Roundtrip.h,v 1.4 2003/07/21 23:51:34 dhinton Exp +// Copyright (c) 2003-2006 ZeroC, Inc. All rights reserved. // +// This copy of Ice is licensed to you under the terms described in the +// ICE_LICENSE file included in this distribution. +// +// ********************************************************************** #ifndef ROUNDTRIP_H #define ROUNDTRIP_H -#include /**/ "ace/pre.h" -#include "TestS.h" +#include <TestS.h> -#if defined (_MSC_VER) -# if (_MSC_VER >= 1200) -# pragma warning(push) -# endif /* _MSC_VER >= 1200 */ -# pragma warning (disable:4250) +#if defined(_MSC_VER) +# if (_MSC_VER >= 1200) +# pragma warning(push) +# endif /* _MSC_VER >= 1200 */ +# pragma warning (disable:4250) #endif /* _MSC_VER */ -/// Implement the Test::Roundtrip interface -class Roundtrip - : public virtual POA_Test::Roundtrip - , public virtual PortableServer::RefCountServantBase +// +// Implement the Test::Roundtrip interface +// +class Roundtrip : public virtual POA_Test::Roundtrip, + public virtual PortableServer::RefCountServantBase { public: - /// Constructor - Roundtrip (CORBA::ORB_ptr orb); - // = The skeleton methods - virtual void sendByteSeq (const Test::ByteSeq & seq ACE_ENV_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException)); + Roundtrip(CORBA::ORB_ptr orb); + + // = The skeleton methods + virtual void sendByteSeq(const Test::ByteSeq & seq ACE_ENV_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC((CORBA::SystemException)); - virtual void sendStringSeq (const Test::StringSeq & seq ACE_ENV_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException)); + virtual void sendStringSeq(const Test::StringSeq & seq ACE_ENV_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC((CORBA::SystemException)); - virtual void sendStringDoubleSeq (const Test::StringDoubleSeq & seq ACE_ENV_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException)); + virtual void sendStringDoubleSeq(const Test::StringDoubleSeq & seq ACE_ENV_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC((CORBA::SystemException)); - virtual void test_method (ACE_ENV_SINGLE_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException)); + virtual void test_method(ACE_ENV_SINGLE_ARG_DECL) + ACE_THROW_SPEC((CORBA::SystemException)); - virtual void test_oneway (ACE_ENV_SINGLE_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException)); + virtual void test_oneway(ACE_ENV_SINGLE_ARG_DECL) + ACE_THROW_SPEC((CORBA::SystemException)); - virtual void shutdown (ACE_ENV_SINGLE_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException)); + virtual void shutdown(ACE_ENV_SINGLE_ARG_DECL) + ACE_THROW_SPEC((CORBA::SystemException)); private: - /// Use an ORB reference to conver strings to objects and shutdown - /// the application. - CORBA::ORB_var orb_; + // + // Use an ORB reference to conver strings to objects and shutdown + // the application. + // + CORBA::ORB_var _orb; }; #if defined(_MSC_VER) && (_MSC_VER >= 1200) # pragma warning(pop) #endif /* _MSC_VER */ -#include /**/ "ace/post.h" #endif /* ROUNDTRIP_H */ diff --git a/perf/src/TAO/Roundtrip_Handler.cpp b/perf/src/TAO/Roundtrip_Handler.cpp index 715a79add98..0d286b3f787 100644 --- a/perf/src/TAO/Roundtrip_Handler.cpp +++ b/perf/src/TAO/Roundtrip_Handler.cpp @@ -1,16 +1,16 @@ +// ********************************************************************** // -// Roundtrip_Handler.cpp,v 1.4 2003/11/01 11:15:10 dhinton Exp +// Copyright (c) 2003-2006 ZeroC, Inc. All rights reserved. // -#include "Roundtrip_Handler.h" -#include "ace/OS_NS_time.h" - -#include <iostream> - -using namespace std; +// This copy of Ice is licensed to you under the terms described in the +// ICE_LICENSE file included in this distribution. +// +// ********************************************************************** -ACE_RCSID(AMI_Latency, Roundtrip, "Roundtrip_Handler.cpp,v 1.4 2003/11/01 11:15:10 dhinton Exp") +#include <Roundtrip_Handler.h> +#include <ace/OS_NS_time.h> -Roundtrip_Handler::Roundtrip_Handler () : +Roundtrip_Handler::Roundtrip_Handler() : _finished(false) { } @@ -27,77 +27,77 @@ Roundtrip_Handler::waitFinished() } void -Roundtrip_Handler::sendByteSeq (ACE_ENV_SINGLE_ARG_DECL_NOT_USED) - ACE_THROW_SPEC ((CORBA::SystemException)) +Roundtrip_Handler::sendByteSeq(ACE_ENV_SINGLE_ARG_DECL_NOT_USED) + ACE_THROW_SPEC((CORBA::SystemException)) { } void -Roundtrip_Handler::sendByteSeq_excep (Messaging::ExceptionHolder *holder +Roundtrip_Handler::sendByteSeq_excep(Messaging::ExceptionHolder *holder ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException)) + ACE_THROW_SPEC((CORBA::SystemException)) { - ACE_TRY + ACE_TRY { - holder->raise_exception (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_TRY_CHECK; + holder->raise_exception(ACE_ENV_SINGLE_ARG_PARAMETER); + ACE_TRY_CHECK; } - ACE_CATCHANY + ACE_CATCHANY { - ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, "sendByteSeq:"); + ACE_PRINT_EXCEPTION(ACE_ANY_EXCEPTION, "sendByteSeq:"); } - ACE_ENDTRY; + ACE_ENDTRY; } void -Roundtrip_Handler::sendStringSeq (ACE_ENV_SINGLE_ARG_DECL_NOT_USED) - ACE_THROW_SPEC ((CORBA::SystemException)) +Roundtrip_Handler::sendStringSeq(ACE_ENV_SINGLE_ARG_DECL_NOT_USED) + ACE_THROW_SPEC((CORBA::SystemException)) { } void -Roundtrip_Handler::sendStringSeq_excep (Messaging::ExceptionHolder *holder +Roundtrip_Handler::sendStringSeq_excep(Messaging::ExceptionHolder *holder ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException)) + ACE_THROW_SPEC((CORBA::SystemException)) { - ACE_TRY + ACE_TRY { - holder->raise_exception (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_TRY_CHECK; + holder->raise_exception(ACE_ENV_SINGLE_ARG_PARAMETER); + ACE_TRY_CHECK; } - ACE_CATCHANY + ACE_CATCHANY { - ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, "sendStringSeq:"); + ACE_PRINT_EXCEPTION(ACE_ANY_EXCEPTION, "sendStringSeq:"); } - ACE_ENDTRY; + ACE_ENDTRY; } void -Roundtrip_Handler::sendStringDoubleSeq (ACE_ENV_SINGLE_ARG_DECL_NOT_USED) - ACE_THROW_SPEC ((CORBA::SystemException)) +Roundtrip_Handler::sendStringDoubleSeq(ACE_ENV_SINGLE_ARG_DECL_NOT_USED) + ACE_THROW_SPEC((CORBA::SystemException)) { } void -Roundtrip_Handler::sendStringDoubleSeq_excep (Messaging::ExceptionHolder *holder +Roundtrip_Handler::sendStringDoubleSeq_excep(Messaging::ExceptionHolder *holder ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException)) + ACE_THROW_SPEC((CORBA::SystemException)) { - ACE_TRY + ACE_TRY { - holder->raise_exception (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_TRY_CHECK; + holder->raise_exception(ACE_ENV_SINGLE_ARG_PARAMETER); + ACE_TRY_CHECK; } - ACE_CATCHANY + ACE_CATCHANY { - ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, "sendStringDoubleSeq:"); + ACE_PRINT_EXCEPTION(ACE_ANY_EXCEPTION, "sendStringDoubleSeq:"); } - ACE_ENDTRY; + ACE_ENDTRY; } void -Roundtrip_Handler::test_method (ACE_ENV_SINGLE_ARG_DECL_NOT_USED) - ACE_THROW_SPEC ((CORBA::SystemException)) +Roundtrip_Handler::test_method(ACE_ENV_SINGLE_ARG_DECL_NOT_USED) + ACE_THROW_SPEC((CORBA::SystemException)) { IceUtil::Monitor<IceUtil::Mutex>::Lock sync(*this); _finished = true; @@ -105,25 +105,25 @@ Roundtrip_Handler::test_method (ACE_ENV_SINGLE_ARG_DECL_NOT_USED) } void -Roundtrip_Handler::test_method_excep (Messaging::ExceptionHolder *holder +Roundtrip_Handler::test_method_excep(Messaging::ExceptionHolder *holder ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException)) + ACE_THROW_SPEC((CORBA::SystemException)) { - ACE_TRY + ACE_TRY { - holder->raise_exception (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_TRY_CHECK; + holder->raise_exception(ACE_ENV_SINGLE_ARG_PARAMETER); + ACE_TRY_CHECK; } - ACE_CATCHANY + ACE_CATCHANY { - ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, "test_method:"); + ACE_PRINT_EXCEPTION(ACE_ANY_EXCEPTION, "test_method:"); } - ACE_ENDTRY; + ACE_ENDTRY; } void -Roundtrip_Handler::shutdown (ACE_ENV_SINGLE_ARG_DECL_NOT_USED) - ACE_THROW_SPEC ((CORBA::SystemException)) +Roundtrip_Handler::shutdown(ACE_ENV_SINGLE_ARG_DECL_NOT_USED) + ACE_THROW_SPEC((CORBA::SystemException)) { IceUtil::Monitor<IceUtil::Mutex>::Lock sync(*this); _finished = true; @@ -131,18 +131,18 @@ Roundtrip_Handler::shutdown (ACE_ENV_SINGLE_ARG_DECL_NOT_USED) } void -Roundtrip_Handler::shutdown_excep (Messaging::ExceptionHolder *holder +Roundtrip_Handler::shutdown_excep(Messaging::ExceptionHolder *holder ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException)) + ACE_THROW_SPEC((CORBA::SystemException)) { - ACE_TRY + ACE_TRY { - holder->raise_exception (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_TRY_CHECK; + holder->raise_exception(ACE_ENV_SINGLE_ARG_PARAMETER); + ACE_TRY_CHECK; } - ACE_CATCHANY + ACE_CATCHANY { - ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, "shutdown:"); + ACE_PRINT_EXCEPTION(ACE_ANY_EXCEPTION, "shutdown:"); } - ACE_ENDTRY; + ACE_ENDTRY; } diff --git a/perf/src/TAO/Roundtrip_Handler.h b/perf/src/TAO/Roundtrip_Handler.h index a80b5855c3e..4fdba01b7c0 100644 --- a/perf/src/TAO/Roundtrip_Handler.h +++ b/perf/src/TAO/Roundtrip_Handler.h @@ -1,77 +1,81 @@ +// ********************************************************************** // -// Roundtrip_Handler.h,v 1.4 2003/07/21 23:51:34 dhinton Exp +// Copyright (c) 2003-2006 ZeroC, Inc. All rights reserved. // +// This copy of Ice is licensed to you under the terms described in the +// ICE_LICENSE file included in this distribution. +// +// ********************************************************************** #ifndef ROUNDTRIP_HANDLER_H #define ROUNDTRIP_HANDLER_H -#include /**/ "ace/pre.h" +#include <ace/pre.h> -#include "TestS.h" -#include "ace/Basic_Stats.h" +#include <TestS.h> +#include <ace/Basic_Stats.h> #if defined (_MSC_VER) -# if (_MSC_VER >= 1200) -# pragma warning(push) -# endif /* _MSC_VER >= 1200 */ -# pragma warning (disable:4250) +# if (_MSC_VER >= 1200) +# pragma warning(push) +# endif /* _MSC_VER >= 1200 */ +# pragma warning (disable:4250) #endif /* _MSC_VER */ #include <IceUtil/Mutex.h> #include <IceUtil/Monitor.h> -/// Implement the Test::Roundtrip interface -class Roundtrip_Handler - : public virtual POA_Test::AMI_RoundtripHandler - , public virtual PortableServer::RefCountServantBase - , public IceUtil::Monitor<IceUtil::Mutex> +// +// Implement the Test::Roundtrip interface +// +class Roundtrip_Handler : public virtual POA_Test::AMI_RoundtripHandler, + public virtual PortableServer::RefCountServantBase, + public IceUtil::Monitor<IceUtil::Mutex> { public: - /// Constructor - Roundtrip_Handler(); - - void waitFinished(); - - // = The skeleton methods - virtual void sendByteSeq (ACE_ENV_SINGLE_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException)); - virtual void sendByteSeq_excep(Messaging::ExceptionHolder *holder - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException)); - - virtual void sendStringSeq (ACE_ENV_SINGLE_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException)); - virtual void sendStringSeq_excep(Messaging::ExceptionHolder *holder - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException)); - - virtual void sendStringDoubleSeq (ACE_ENV_SINGLE_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException)); - virtual void sendStringDoubleSeq_excep(Messaging::ExceptionHolder *holder - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException)); - - virtual void test_method (ACE_ENV_SINGLE_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException)); - virtual void test_method_excep (Messaging::ExceptionHolder *holder - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException)); - - virtual void shutdown (ACE_ENV_SINGLE_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException)); - - virtual void shutdown_excep (Messaging::ExceptionHolder *holder - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException)); + Roundtrip_Handler(); + + void waitFinished(); + + // = The skeleton methods + virtual void sendByteSeq(ACE_ENV_SINGLE_ARG_DECL) + ACE_THROW_SPEC ((CORBA::SystemException)); + virtual void sendByteSeq_excep(Messaging::ExceptionHolder *holder + ACE_ENV_ARG_DECL) + ACE_THROW_SPEC ((CORBA::SystemException)); + + virtual void sendStringSeq(ACE_ENV_SINGLE_ARG_DECL) + ACE_THROW_SPEC ((CORBA::SystemException)); + virtual void sendStringSeq_excep(Messaging::ExceptionHolder *holder + ACE_ENV_ARG_DECL) + ACE_THROW_SPEC ((CORBA::SystemException)); + + virtual void sendStringDoubleSeq(ACE_ENV_SINGLE_ARG_DECL) + ACE_THROW_SPEC ((CORBA::SystemException)); + virtual void sendStringDoubleSeq_excep(Messaging::ExceptionHolder *holder + ACE_ENV_ARG_DECL) + ACE_THROW_SPEC ((CORBA::SystemException)); + + virtual void test_method(ACE_ENV_SINGLE_ARG_DECL) + ACE_THROW_SPEC ((CORBA::SystemException)); + virtual void test_method_excep(Messaging::ExceptionHolder *holder + ACE_ENV_ARG_DECL) + ACE_THROW_SPEC ((CORBA::SystemException)); + + virtual void shutdown(ACE_ENV_SINGLE_ARG_DECL) + ACE_THROW_SPEC ((CORBA::SystemException)); + + virtual void shutdown_excep(Messaging::ExceptionHolder *holder + ACE_ENV_ARG_DECL) + ACE_THROW_SPEC ((CORBA::SystemException)); private: - bool _finished; - + bool _finished; + }; #if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma warning(pop) +# pragma warning(pop) #endif /* _MSC_VER */ -#include /**/ "ace/post.h" #endif /* ROUNDTRIP_H */ diff --git a/perf/src/TAO/WorkerThread.cpp b/perf/src/TAO/WorkerThread.cpp new file mode 100644 index 00000000000..a58f6897c32 --- /dev/null +++ b/perf/src/TAO/WorkerThread.cpp @@ -0,0 +1,28 @@ +// ********************************************************************** +// +// Copyright (c) 2003-2006 ZeroC, Inc. All rights reserved. +// +// This copy of Ice is licensed to you under the terms described in the +// ICE_LICENSE file included in this distribution. +// +// ********************************************************************** + +#include <WorkerThread.h> + +WorkerThread::WorkerThread(CORBA::ORB_ptr orb): + _orb(CORBA::ORB::_duplicate(orb)) +{ +} + +int +WorkerThread::svc() +{ + ACE_DECLARE_NEW_CORBA_ENV; + ACE_TRY + { + _orb->run(ACE_ENV_SINGLE_ARG_PARAMETER); + ACE_TRY_CHECK; + } + ACE_CATCHANY {} ACE_ENDTRY; + return 0; +} diff --git a/perf/src/TAO/WorkerThread.h b/perf/src/TAO/WorkerThread.h new file mode 100644 index 00000000000..874551de001 --- /dev/null +++ b/perf/src/TAO/WorkerThread.h @@ -0,0 +1,27 @@ +// ********************************************************************** +// +// Copyright (c) 2003-2006 ZeroC, Inc. All rights reserved. +// +// This copy of Ice is licensed to you under the terms described in the +// ICE_LICENSE file included in this distribution. +// +// ********************************************************************** + +#ifndef WORKER_THREAD_H +#define WORKER_THREAD_H + +#include <tao/ORB.h> +#include <ace/Task.h> + +class WorkerThread : public ACE_Task_Base +{ +public: + WorkerThread(CORBA::ORB_ptr orb); + + virtual int svc(); + +private: + CORBA::ORB_var _orb; +}; + +#endif /* WORKER_THREAD_H */ diff --git a/perf/src/TAO/Worker_Thread.cpp b/perf/src/TAO/Worker_Thread.cpp deleted file mode 100644 index 670463036e0..00000000000 --- a/perf/src/TAO/Worker_Thread.cpp +++ /dev/null @@ -1,24 +0,0 @@ -// -// Worker_Thread.cpp,v 1.3 2002/01/30 20:16:57 okellogg Exp -// -#include "Worker_Thread.h" - -ACE_RCSID(Thread_Pool_Latency, Worker_Thread, "Worker_Thread.cpp,v 1.3 2002/01/30 20:16:57 okellogg Exp") - -Worker_Thread::Worker_Thread (CORBA::ORB_ptr orb) - : orb_ (CORBA::ORB::_duplicate (orb)) -{ -} - -int -Worker_Thread::svc (void) -{ - ACE_DECLARE_NEW_CORBA_ENV; - ACE_TRY - { - this->orb_->run (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_TRY_CHECK; - } - ACE_CATCHANY {} ACE_ENDTRY; - return 0; -} diff --git a/perf/src/TAO/Worker_Thread.h b/perf/src/TAO/Worker_Thread.h deleted file mode 100644 index b35f11fb525..00000000000 --- a/perf/src/TAO/Worker_Thread.h +++ /dev/null @@ -1,27 +0,0 @@ -// -// Worker_Thread.h,v 1.3 2003/10/28 18:34:33 bala Exp -// - -#ifndef WORKER_THREAD_H -#define WORKER_THREAD_H -#include /**/ "ace/pre.h" - -#include "tao/ORB.h" -#include "ace/Task.h" - -/// Implement the Test::Worker_Thread interface -class Worker_Thread : public ACE_Task_Base -{ -public: - /// Constructor - Worker_Thread (CORBA::ORB_ptr orb); - - // = The service method - virtual int svc (void); - -private: - CORBA::ORB_var orb_; -}; - -#include /**/ "ace/post.h" -#endif /* WORKER_THREAD_H */ diff --git a/perf/src/TAO/client.cpp b/perf/src/TAO/client.cpp index a5a0d26166b..bb5089d398f 100644 --- a/perf/src/TAO/client.cpp +++ b/perf/src/TAO/client.cpp @@ -1,16 +1,23 @@ -// client.cpp,v 1.6 2003/11/02 23:27:22 dhinton Exp - -#include "Roundtrip.h" -#include "Roundtrip_Handler.h" -#include "Worker_Thread.h" -#include "ace/Get_Opt.h" -#include "ace/High_Res_Timer.h" -#include "ace/Sched_Params.h" -#include "ace/Stats.h" -#include "ace/OS_NS_errno.h" - -#include "tao/Strategies/advanced_resource.h" -#include "tao/Messaging/Messaging.h" +// ********************************************************************** +// +// Copyright (c) 2003-2006 ZeroC, Inc. All rights reserved. +// +// This copy of Ice is licensed to you under the terms described in the +// ICE_LICENSE file included in this distribution. +// +// ********************************************************************** + +#include <Roundtrip.h> +#include <Roundtrip_Handler.h> +#include <WorkerThread.h> +#include <ace/Get_Opt.h> +#include <ace/High_Res_Timer.h> +#include <ace/Sched_Params.h> +#include <ace/Stats.h> +#include <ace/OS_NS_errno.h> + +#include <tao/Strategies/advanced_resource.h> +#include <tao/Messaging/Messaging.h> #include <iostream> #ifdef _WIN32 @@ -18,30 +25,17 @@ # include <time.h> #endif -using namespace std; +// +// TODO: Move time functions into a OSLayer type header. +// -ACE_RCSID(Thread_Per_Connection_Latency, client, "client.cpp,v 1.6 2003/11/02 23:27:22 dhinton Exp") +using namespace std; -const char *ior = "file://test.ior"; int do_shutdown = 1; int main(int argc, char *argv[]) { -// int priority = (ACE_Sched_Params::priority_min(ACE_SCHED_FIFO) + -// ACE_Sched_Params::priority_max(ACE_SCHED_FIFO)) / 2; -// if(ACE_OS::sched_params(ACE_Sched_Params(ACE_SCHED_FIFO, priority, ACE_SCOPE_PROCESS)) != 0) -// { -// if(ACE_OS::last_error() == EPERM) -// { -// ACE_DEBUG((LM_DEBUG, "client(%P|%t): user is not superuser, ""test runs in time-shared class\n")); -// } -// else -// { -// ACE_ERROR((LM_ERROR, "client(%P|%t): sched_params failed\n")); -// } -// } - ACE_TRY_NEW_ENV { CORBA::ORB_var orb = CORBA::ORB_init(argc, argv, "" ACE_ENV_ARG_PARAMETER); @@ -148,7 +142,7 @@ main(int argc, char *argv[]) } } - object = orb->string_to_object(ior ACE_ENV_ARG_PARAMETER); + object = orb->string_to_object("file://test.ior" ACE_ENV_ARG_PARAMETER); ACE_TRY_CHECK; Test::Roundtrip_var roundtrip = Test::Roundtrip::_narrow(object.in() ACE_ENV_ARG_PARAMETER); @@ -156,7 +150,7 @@ main(int argc, char *argv[]) if(CORBA::is_nil(roundtrip.in())) { - ACE_ERROR_RETURN((LM_ERROR, "Nil Test::Roundtrip reference <%s>\n", ior), 1); + ACE_ERROR_RETURN((LM_ERROR, "Nil Test::Roundtrip reference <%s>\n", "file://test.ior"), 1); } roundtrip->test_method(ACE_ENV_SINGLE_ARG_PARAMETER); @@ -177,7 +171,7 @@ main(int argc, char *argv[]) if(ami) { - Worker_Thread *worker = new Worker_Thread(orb.in()); + WorkerThread *worker = new WorkerThread(orb.in()); worker->activate(THR_NEW_LWP | THR_JOINABLE, 1, 1); } @@ -254,7 +248,9 @@ main(int argc, char *argv[]) longStringSeq.length(5000); for(i = 0; i < 5000; ++i) { - longStringSeq[i] = CORBA::string_dup("As far as the laws of mathematics refer to reality, they are not certain; and as far as they are certain, they do not refer to reality."); + longStringSeq[i] = CORBA::string_dup("As far as the laws of mathematics refer to reality, " + "they are not certain; and as far as they are certain, " + "they do not refer to reality."); } Test::StringDoubleSeq stringDoubleSeq; diff --git a/perf/src/TAO/server.cpp b/perf/src/TAO/server.cpp index 8c225e4ab57..64987e0f044 100644 --- a/perf/src/TAO/server.cpp +++ b/perf/src/TAO/server.cpp @@ -1,54 +1,37 @@ -// server.cpp,v 1.5 2003/11/02 23:27:22 dhinton Exp - -#include "Roundtrip.h" -#include "Worker_Thread.h" -#include "ace/Get_Opt.h" -#include "ace/Sched_Params.h" -#include "ace/OS_NS_errno.h" - -#include "tao/Strategies/advanced_resource.h" - +// ********************************************************************** +// +// Copyright (c) 2003-2006 ZeroC, Inc. All rights reserved. +// +// This copy of Ice is licensed to you under the terms described in the +// ICE_LICENSE file included in this distribution. +// +// ********************************************************************** + +#include <Roundtrip.h> +#include <WorkerThread.h> #include <iostream> -ACE_RCSID(Thread_Pool_Latency, server, "server.cpp,v 1.5 2003/11/02 23:27:22 dhinton Exp") - -const char *ior_output_file = "test.ior"; int main(int argc, char *argv[]) { -// int priority = (ACE_Sched_Params::priority_min(ACE_SCHED_FIFO) + -// ACE_Sched_Params::priority_max(ACE_SCHED_FIFO)) / 2; -// priority = ACE_Sched_Params::next_priority(ACE_SCHED_FIFO, priority); -// if(ACE_OS::sched_params(ACE_Sched_Params(ACE_SCHED_FIFO, priority, ACE_SCOPE_PROCESS)) != 0) -// { -// if(ACE_OS::last_error() == EPERM) -// { -// ACE_DEBUG((LM_DEBUG, "server(%P|%t): user is not superuser, ""test runs in time-shared class\n")); -// } -// else -// { -// ACE_ERROR((LM_ERROR, "server(%P|%t): sched_params failed\n")); -// } -// } - ACE_TRY_NEW_ENV { CORBA::ORB_var orb = CORBA::ORB_init(argc, argv, "" ACE_ENV_ARG_PARAMETER); ACE_TRY_CHECK; - CORBA::Object_var poa_object = orb->resolve_initial_references("RootPOA" ACE_ENV_ARG_PARAMETER); + CORBA::Object_var poaObject = orb->resolve_initial_references("RootPOA" ACE_ENV_ARG_PARAMETER); ACE_TRY_CHECK; - if(CORBA::is_nil(poa_object.in())) + if(CORBA::is_nil(poaObject.in())) { ACE_ERROR_RETURN((LM_ERROR, "(%P|%t) Unable to initialize the POA.\n"), 1); } - PortableServer::POA_var root_poa = PortableServer::POA::_narrow(poa_object.in() ACE_ENV_ARG_PARAMETER); + PortableServer::POA_var rootPOA = PortableServer::POA::_narrow(poaObject.in() ACE_ENV_ARG_PARAMETER); ACE_TRY_CHECK; - PortableServer::POAManager_var poa_manager = root_poa->the_POAManager(ACE_ENV_SINGLE_ARG_PARAMETER); + PortableServer::POAManager_var poaManager = rootPOA->the_POAManager(ACE_ENV_SINGLE_ARG_PARAMETER); ACE_TRY_CHECK; int i; @@ -66,29 +49,32 @@ main(int argc, char *argv[]) } } - Roundtrip *roundtrip_impl; - ACE_NEW_RETURN(roundtrip_impl, Roundtrip(orb.in()), 1); - PortableServer::ServantBase_var owner_transfer(roundtrip_impl); + Roundtrip *roundtripImpl; + ACE_NEW_RETURN(roundtripImpl, Roundtrip(orb.in()), 1); + PortableServer::ServantBase_var ownerTransfer(roundtripImpl); - Test::Roundtrip_var roundtrip = roundtrip_impl->_this(ACE_ENV_SINGLE_ARG_PARAMETER); + Test::Roundtrip_var roundtrip = roundtripImpl->_this(ACE_ENV_SINGLE_ARG_PARAMETER); ACE_TRY_CHECK; CORBA::String_var ior = orb->object_to_string(roundtrip.in() ACE_ENV_ARG_PARAMETER); ACE_TRY_CHECK; - // If the ior_output_file exists, output the ior to it - FILE *output_file= ACE_OS::fopen(ior_output_file, "w"); + // + // If the iorFile exists, output the ior to it + // + FILE *output_file= ACE_OS::fopen("test.ior", "w"); if(output_file == 0) { - ACE_ERROR_RETURN((LM_ERROR, "Cannot open output file for writing IOR: %s", ior_output_file), 1); + ACE_ERROR_RETURN((LM_ERROR, "Cannot open output file for writing IOR: %s", "test.ior"), 1); } + ACE_OS::fprintf(output_file, "%s", ior.in()); ACE_OS::fclose(output_file); - poa_manager->activate(ACE_ENV_SINGLE_ARG_PARAMETER); + poaManager->activate(ACE_ENV_SINGLE_ARG_PARAMETER); ACE_TRY_CHECK; - Worker_Thread worker(orb.in()); + WorkerThread worker(orb.in()); std::cout << "POA ready" << std::endl; @@ -103,7 +89,7 @@ main(int argc, char *argv[]) ACE_TRY_CHECK; } - root_poa->destroy(1, 1 ACE_ENV_ARG_PARAMETER); + rootPOA->destroy(1, 1 ACE_ENV_ARG_PARAMETER); ACE_TRY_CHECK; orb->destroy(ACE_ENV_SINGLE_ARG_PARAMETER); diff --git a/perf/src/omniORB/ping.idl b/perf/src/omniORB/ping.idl index 3cced3c1c65..6d28cef4c18 100644 --- a/perf/src/omniORB/ping.idl +++ b/perf/src/omniORB/ping.idl @@ -1,3 +1,12 @@ +// ********************************************************************** +// +// Copyright (c) 2003-2006 ZeroC, Inc. All rights reserved. +// +// This copy of Ice is licensed to you under the terms described in the +// ICE_LICENSE file included in this distribution. +// +// ********************************************************************** + #ifndef __PING_IDL__ #define __PING_IDL__ @@ -15,6 +24,7 @@ struct StringDouble string str; double d; }; + typedef sequence<StringDouble> StringDoubleSeq; const long StringDoubleSeqSize = 50000; |