def method(self): ''' void method(); ''' profiler = Profiler() tString = "" for i in range(0, self.size): tString = tString + "*" for i in range(0, self.count): profiler.start() self.getLogger().logInfo(tString) profiler.stop() self.waitAwhile() if environ.has_key("ACS_LOG_STDOUT"): profiler.addData("ACS_LOG_STDOUT", environ["ACS_LOG_STDOUT"]) else: profiler.addData("ACS_LOG_STDOUT", "None") profiler.fullDescription( "ACS Log of Size '" + str(self.size) + "' Bytes from within a CharacteristicComponent") return
def method(self): ''' void method(); ''' profiler = Profiler() tString="" for i in range(0, self.size): tString = tString + "*" joe = perftest.charSeqStruct(tString) for i in range(0, self.count): profiler.start() self.supplier.publishEvent(joe) profiler.stop() self.waitAwhile() profiler.fullDescription("Event Channel Event of Size '" + str(self.size) + "' Bytes from within a CharacteristicComponent") return
def method(self): ''' void method(); ''' profiler = Profiler() tString = "" for i in range(0, self.size): tString = tString + "*" joe = perftest.charSeqStruct(tString) for i in range(0, self.count): profiler.start() self.supplier.publishEvent(joe) profiler.stop() self.waitAwhile() profiler.fullDescription( "Event Channel Event of Size '" + str(self.size) + "' Bytes from within a CharacteristicComponent") return
def method(self): ''' void method(); ''' profiler = Profiler() tString="" for i in range(0, self.size): tString = tString + "*" for i in range(0, self.count): profiler.start() self.getLogger().logInfo(tString) profiler.stop() self.waitAwhile() if environ.has_key("ACS_LOG_STDOUT"): profiler.addData("ACS_LOG_STDOUT", environ["ACS_LOG_STDOUT"]) else: profiler.addData("ACS_LOG_STDOUT", "None") profiler.fullDescription("ACS Log of Size '" + str(self.size) + "' Bytes from within a CharacteristicComponent") return
''' from sys import argv from Acspy.Clients.SimpleClient import PySimpleClient from Acspy.Util.Profiler import Profiler compName = argv[1] invocations = int(argv[2]) compMethod = argv[3] msg = argv[4] # Make an instance of the PySimpleClient profiler = Profiler() simpleClient = PySimpleClient() comp = simpleClient.getComponent(compName) for i in range(0, invocations): try: profiler.start() exec "comp." + compMethod profiler.stop() except Exception, e: profiler.stop() print "An exception occured:", e profiler.fullDescription(msg) simpleClient.releaseComponent(compName) simpleClient.disconnect()
#------------------------------------------------------------------------------ ''' Sample usage: componentsMethodTestPy FRIDGE1 1000 100 ''' from sys import argv from Acspy.Clients.SimpleClient import PySimpleClient from Acspy.Util.Profiler import Profiler compName = argv[1] count = long(argv[2]) size = long(argv[3]) waitTime = long(argv[4]) msg = argv[5] # Make an instance of the PySimpleClient profiler = Profiler() simpleClient = PySimpleClient() comp = simpleClient.getComponent(compName) comp.setup(count, size, waitTime) for i in range(0, count): profiler.start() comp.testReturnSize() profiler.stop() profiler.fullDescription(msg) simpleClient.releaseComponent(compName) simpleClient.disconnect()