Skip to content

Commit

Permalink
Merge pull request #610 from yandex/release
Browse files Browse the repository at this point in the history
Release 1.10.0
  • Loading branch information
fomars committed Jun 7, 2018
2 parents e0565d0 + eb8d236 commit 1024c72
Show file tree
Hide file tree
Showing 21 changed files with 488 additions and 107 deletions.
9 changes: 9 additions & 0 deletions Dockerfile-TankBAT
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
FROM ubuntu:16.04
WORKDIR /yandextank
RUN apt-get update && \
apt-get install -y python-pip
RUN pip install --upgrade setuptools
RUN pip install --upgrade pip
RUN pip install pytest
CMD pip install . && pytest -s
# docker run -v /path/to/yandextank:/yandextank --name my_container my_image
46 changes: 45 additions & 1 deletion docs/config_reference.rst
Original file line number Diff line number Diff line change
Expand Up @@ -731,6 +731,10 @@ Phantom
--------------------------
*\- Object's type, that has a functionality to create test requests. Default:* ``method_stream``

``name`` (string)
-----------------
*\- Name of a part in multi config.* **Required.**

``phantom_http_entity`` (string)
--------------------------------
*\- Limits the amount of bytes Phantom reads from response. Default:* ``8M``
Expand Down Expand Up @@ -924,4 +928,44 @@ Telegraf
``10s``
10 seconds
``2m``
2 minutes
2 minutes

YASM
====

``panels`` (dict)
-----------------
*\- (no description).* **Required.**

:valueschema:
:schema:
:default_signals:
:default:
True
:type:
boolean
:host:
:required:
True
:type:
string
:signals:
:required:
False
:type:
list
:tags:
:required:
True
:type:
string
:type:
dict

``timeout`` (integer)
---------------------
*\- (no description). Default:* ``120``

``verbose_logging`` (boolean)
-----------------------------
*\- (no description). Default:* ``False``
6 changes: 2 additions & 4 deletions docs/core_and_modules.rst
Original file line number Diff line number Diff line change
Expand Up @@ -435,8 +435,7 @@ Example:
- /
autocases: 1
multi:
- phantom-1:
address: hostname1:port1
- address: hostname1:port1
load_profile:
load_type: rps
schedule: const(1,10s)
Expand All @@ -445,8 +444,7 @@ Example:
- /321
ssl: 1
autocases: 1
- phantom-2:
address: hostname2:port2
- address: hostname2:port2
load_profile:
load_type: rps
schedule: const(1,10s)
Expand Down
6 changes: 3 additions & 3 deletions docs/tutorial.rst
Original file line number Diff line number Diff line change
Expand Up @@ -381,9 +381,9 @@ Now, our basic config looks like that:
phantom:
address: 203.0.113.1:443
load_profile:
load_type: rps
schedule: line(1, 10, 10m)
load_profile:
load_type: rps
schedule: line(1, 10, 10m)
ssl: true
.. note::
Expand Down
1 change: 1 addition & 0 deletions pytest.ini
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
[pytest]
norecursedirs = build dist .eggs .tox .env tmp .env3
;testpaths = yandextank/validator
7 changes: 4 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

setup(
name='yandextank',
version='1.9.13',
version='1.10.0',
description='a performance measurement tool',
longer_description='''
Yandex.Tank is a performance measurement and load testing automatization tool.
Expand All @@ -19,8 +19,8 @@
'psutil>=1.2.1', 'requests>=2.5.1', 'paramiko>=1.16.0',
'pandas>=0.18.0', 'numpy>=1.12.1', 'future>=0.16.0',
'pip>=8.1.2',
'pyyaml>=3.12', 'cerberus==1.1', 'influxdb>=5.0.0',
'netort>=0.0.11'
'pyyaml>=3.12', 'cerberus==1.2', 'influxdb>=5.0.0',
'netort>=0.0.11', 'pyopenssl>=17.5.0'
],
setup_requires=[
'pytest-runner', 'flake8',
Expand Down Expand Up @@ -64,6 +64,7 @@
'yandextank.plugins.Influx': ['config/*'],
'yandextank.plugins.JMeter': ['config/*'],
'yandextank.plugins.JsonReport': ['config/*'],
'yandextank.plugins.YASM': ['config/*'],
'yandextank.plugins.Pandora': ['config/*'],
'yandextank.plugins.Phantom': ['config/*'],
'yandextank.plugins.RCAssert': ['config/*'],
Expand Down
12 changes: 11 additions & 1 deletion yandextank/common/interfaces.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ def close(self):


class MonitoringDataListener(object):
""" Monitoring interface
""" Monitoring listener interface
parent class for Monitoring data listeners"""

def __init__(self):
Expand Down Expand Up @@ -244,3 +244,13 @@ def stats_item(ts, instances, rps):
'reqps': rps
}
}


class MonitoringPlugin(AbstractPlugin):

def __init__(self, core, cfg):
super(MonitoringPlugin, self).__init__(core, cfg)
self.listeners = []

def add_listener(self, plugin):
self.listeners.append(plugin)
2 changes: 1 addition & 1 deletion yandextank/common/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -516,7 +516,7 @@ def resolve(self, address_str, do_test=False, explicit_port=False):
resolved = self.lookup_fn(address_str, port)
logger.debug("Lookup result: %s", resolved)
except Exception:
logger.debug("Exception trying to resolve hostname %s : %s", address_str, exc_info=True)
logger.debug("Exception trying to resolve hostname %s :", address_str, exc_info=True)
raise

for (family, socktype, proto, canonname, sockaddr) in resolved:
Expand Down
2 changes: 2 additions & 0 deletions yandextank/config_converter/converter.py
Original file line number Diff line number Diff line change
Expand Up @@ -274,6 +274,8 @@ def converter(self):
return self._converter

def _get_scheme_converter(self):
if self.name == 'enabled':
return self.TYPE_CASTERS['boolean']
if self.schema.get(self.name) is None:
logger.warning('Unknown option {}:{}'.format(self.plugin, self.name))
raise UnknownOption
Expand Down
9 changes: 9 additions & 0 deletions yandextank/core/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,14 @@ def main():
'--verbose',
action='store_true',
help="More console output, +debug messages")
parser.add_option(
'-p',
'--patch-cfg',
action='append',
help='Patch config with yaml snippet (similar to -o, but has full compatibility to\
and the exact scheme of yaml format config)',
dest='patches'
)

completion_helper = CompletionHelperOptionParser()
completion_helper.handle_request(parser)
Expand All @@ -94,6 +102,7 @@ def main():
rc = worker.perform_test()
sys.exit(rc)
except Exception as ex:
worker.core._collect_artifacts()
logging.error("Exception: %s", ex)
logging.debug("Exception: %s", traceback.format_exc(ex))
sys.exit(1)
Expand Down
25 changes: 16 additions & 9 deletions yandextank/core/consoleworker.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ def parse_options(options):
return [
convert_single_option(key.strip(), value.strip())
for key, value
in [option.split('=') for option in options]
in [option.split('=', 1) for option in options]
]


Expand Down Expand Up @@ -245,17 +245,24 @@ def patch_ini_config_with_monitoring(ini_config, mon_section_name):
raise ex


def load_tank_core(config_files, cmd_options, no_rc, depr_options, *other_opts):
other_opts = list(other_opts) if other_opts else []
def load_tank_core(config_files, cmd_options, no_rc, depr_options, other_opts, patches=None):
if patches is None:
patches = []
other_opts = [other_opts] if other_opts else []
config_files = config_files if len(config_files) > 0 else [DEFAULT_CONFIG]
if no_rc:
configs = [load_cfg(cfg) for cfg in config_files] + other_opts + parse_options(cmd_options)
configs = [load_cfg(cfg) for cfg in config_files] +\
other_opts +\
parse_options(cmd_options) +\
[yaml.load(p) for p in patches]
else:
configs = [load_core_base_cfg()] +\
load_local_base_cfgs() +\
[load_cfg(cfg) for cfg in config_files] + other_opts + parse_options(cmd_options)
return TankCore(configs,
cfg_depr=get_depr_cfg(config_files, no_rc, cmd_options, depr_options))
[load_cfg(cfg) for cfg in config_files] +\
other_opts +\
parse_options(cmd_options) +\
[yaml.load(p) for p in patches]
return TankCore(configs)


class ConsoleTank:
Expand All @@ -266,7 +273,6 @@ class ConsoleTank:
def __init__(self, options, ammofile):
overwrite_options = {'core': {'lock_dir': options.lock_dir}} if options.lock_dir else {}
self.options = options
# self.lock_dir = options.lock_dir if options.lock_dir else '/var/lock'
self.baseconfigs_location = '/etc/yandex-tank'
self.init_logging()
self.log = logging.getLogger(__name__)
Expand All @@ -282,7 +288,8 @@ def __init__(self, options, ammofile):
options.option,
options.no_rc,
[],
overwrite_options)
overwrite_options,
options.patches)

raw_cfg_file, raw_cfg_path = tempfile.mkstemp(suffix='_pre-validation-config.yaml')
os.close(raw_cfg_file)
Expand Down

0 comments on commit 1024c72

Please sign in to comment.