mirror of
https://github.com/valitydev/yandex-tank.git
synced 2024-11-08 19:23:54 +00:00
convert TS to integer in Const
This commit is contained in:
parent
5e146a3f0b
commit
07edee7c8d
@ -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'''
|
||||
|
Loading…
Reference in New Issue
Block a user