From 000426c9d890ba2a71625a7454f9c573f10b9bae Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Tue, 12 May 2015 02:17:30 +0200 Subject: 'from time' -> 'import time' and so on... --- tests/APIExerciser.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'tests/APIExerciser.py') diff --git a/tests/APIExerciser.py b/tests/APIExerciser.py index 25eb666d7..02bfef20d 100644 --- a/tests/APIExerciser.py +++ b/tests/APIExerciser.py @@ -7,10 +7,10 @@ import gc import random import string import threading +import time import traceback from math import floor -from time import time from pyload.remote.thriftbackend.ThriftClient import ThriftClient, Destination @@ -48,7 +48,7 @@ class APIExerciser(threading.Thread): self.setDaemon(True) self.core = core self.count = 0 #: number of methods - self.time = time() + self.time = time.time() self.api = ThriftClient(user=user, password=pw) if thrift else core.api @@ -84,11 +84,11 @@ class APIExerciser(threading.Thread): if not sumCalled % 1000: #: not thread safe self.core.log.info("Exercisers tested %d api calls" % sumCalled) - persec = sumCalled / (time() - self.time) + persec = sumCalled / (time.time() - self.time) self.core.log.info("Approx. %.2f calls per second." % persec) self.core.log.info("Approx. %.2f ms per call." % (1000 / persec)) self.core.log.info("Collected garbage: %d" % gc.collect()) - # sleep(random() / 500) + # time.sleep(random() / 500) def testAPI(self): -- cgit v1.2.3