diff --git a/docs/tutorial.rst b/docs/tutorial.rst index 6201f12..feac01f 100644 --- a/docs/tutorial.rst +++ b/docs/tutorial.rst @@ -488,7 +488,7 @@ So, if we want to stop test when all answers in 1 second period are 5xx plus som port=80 ;target's port rps_schedule=const(10, 10m) ;load scheme [autostop] - autostop=time(1000,10) + autostop=time(1s,10s) http(5xx,100%,1s) net(xx,1,30) diff --git a/yandextank/core/util.py b/yandextank/core/util.py index e7bdf84..f115e96 100644 --- a/yandextank/core/util.py +++ b/yandextank/core/util.py @@ -323,7 +323,6 @@ NET = { } - def log_stdout_stderr(log, stdout, stderr, comment=""): """ This function polls stdout and stderr streams and writes their contents @@ -356,12 +355,14 @@ def expand_to_milliseconds(str_time): """ return expand_time(str_time, 'ms', 1000) + def expand_to_seconds(str_time): """ converts 1d2s into seconds """ return expand_time(str_time, 's', 1) + def expand_time(str_time, default_unit='s', multiplier=1): """ helper for above functions @@ -398,6 +399,7 @@ def expand_time(str_time, default_unit='s', multiplier=1): (unit, str_time)) return int(result * multiplier) + def pid_exists(pid): """Check whether pid exists in the current process table.""" if pid < 0: @@ -411,6 +413,7 @@ def pid_exists(pid): p = psutil.Process(pid) return p.status != psutil.STATUS_ZOMBIE + def execute(cmd, shell=False, poll_period=1.0, catch_out=False): """ Wrapper for Popen @@ -443,6 +446,7 @@ def execute(cmd, shell=False, poll_period=1.0, catch_out=False): log.debug("Process exit code: %s", returncode) return returncode, stdout, stderr + def splitstring(string): """ >>> string = 'apple orange "banana tree" green' @@ -457,12 +461,14 @@ def splitstring(string): else: return string.split() + def pairs(lst): """ Iterate over pairs in the list """ return itertools.izip(lst[::2], lst[1::2]) + def update_status(status, multi_key, value): if len(multi_key) > 1: update_status(