one more test: n instances in zero time

This commit is contained in:
Alexey Lavrenuke (load testing) 2013-07-15 16:27:04 +04:00
parent 3d0e6de745
commit 19a2133988
2 changed files with 12 additions and 2 deletions

View File

@ -165,13 +165,19 @@ def create(instances_schedule):
Creates load plan timestamps generator
>>> from itertools import islice
>>> from util import take
>>> lp = create(['ramp(5, 5s)'])
>>> list(islice(lp, 0, 7))
>>> take(7, lp)
[0, 5000, 10000, 15000, 20000, 0, 0]
>>> lp = create(['ramp(5, 5s)', 'wait(5s)', 'ramp(5,5s)'])
>>> list(islice(lp, 0, 12))
>>> take(12, lp)
[0, 5000, 10000, 15000, 20000, 30000, 35000, 40000, 45000, 50000, 0, 0]
>>> lp = create(['wait(5s)', 'ramp(5, 0)'])
>>> take(7, lp)
[5000, 5000, 5000, 5000, 5000, 0, 0]
'''
if len(instances_schedule) > 1:
steps = [StepFactory.produce(step_config)

View File

@ -6,6 +6,10 @@ from itertools import islice
from module_exceptions import StepperConfigurationError
def take(number, iter):
return list(islice(iter, 0, number))
def parse_duration(duration):
'''
Parse duration string, such as '3h2m3s'