Beispiel #1
0
    def runAllMethodsConcurrently(self):

        # print("Running all commands concurrently...\n")
        processes = []

        client = LepDClient(self.server)
        commands = client.listAllMethods()

        timeStarts = datetime.utcnow().replace()

        for command in commands:
            # print(command)

            lepdRequestor = LepDRequestor(command, self.server)
            processes.append(lepdRequestor)
            lepdRequestor.start()
        
        # print('\nRunning and checking status...\n')
        self.checkAndReportThreads(processes)

        timeEnds = datetime.utcnow().replace()
        duration = timeEnds - timeStarts

        durationInSeconds = duration.seconds + duration.microseconds / 1000000
        timeUsed = "{:.3f}".format(durationInSeconds)
        
        print("\nAll done in " + timeUsed + " Seconds\n")
Beispiel #2
0
    def runAllMethodsRepeatedly(self):
        client = LepDClient(self.server)
        commands = client.listAllMethods()

        for command in commands:
            print("Running command: " + command)
            
            i = 1
            while( i <= 3 ):
                self.runMethodConcurrently(command, 1)
                i += 1