convert TS to integer in Const

This commit is contained in:
Alexey Lavrenuke (load testing) 2013-06-26 18:03:58 +04:00
parent 5e146a3f0b
commit 07edee7c8d

View File

@ -12,14 +12,14 @@ class Const(object):
'''Load plan with constant load'''
def __init__(self, rps, duration):
self.rps = rps
self.rps = float(rps)
self.duration = duration
def __iter__(self):
if self.rps == 0:
return iter([])
interval = 1000 / self.rps
return (i * interval for i in xrange(0, self.rps * self.duration))
return (int(i * interval) for i in xrange(0, int(self.rps * self.duration)))
def rps_at(self, t):
'''Return rps for second t'''