Skip to content

Commit

Permalink
Merge pull request #766 from yandex/release
Browse files Browse the repository at this point in the history
Release 1.12.3
  • Loading branch information
fomars committed Jul 4, 2019
2 parents 5de7ad3 + 49c3705 commit bf3c353
Show file tree
Hide file tree
Showing 35 changed files with 1,262 additions and 584 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ install:
- "pip install ."
script:
- "flake8 --config .flake8 ."
- "pytest -s"
- "python setup.py test"
11 changes: 7 additions & 4 deletions docs/ammo_generators.rst
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,17 @@ Line format: ``GET||/url||case_tag||body(optional)``
import sys
def make_ammo(method, url, headers, case, body):
""" makes phantom ammo """
#http request w/o entity body template
# http request w/o entity body template
req_template = (
"%s %s HTTP/1.1\r\n"
"%s\r\n"
"\r\n"
)
#http request with entity body template
# http request with entity body template
req_template_w_entity_body = (
"%s %s HTTP/1.1\r\n"
"%s\r\n"
Expand All @@ -38,20 +39,21 @@ Line format: ``GET||/url||case_tag||body(optional)``
else:
req = req_template_w_entity_body % (method, url, headers, len(body), body)
#phantom ammo template
# phantom ammo template
ammo_template = (
"%d %s\n"
"%s"
)
return ammo_template % (len(req), case, req)
def main():
for stdin_line in sys.stdin:
try:
method, url, case, body = stdin_line.split("||")
body = body.strip()
except:
except ValueError:
method, url, case = stdin_line.split("||")
body = None
Expand All @@ -64,6 +66,7 @@ Line format: ``GET||/url||case_tag||body(optional)``
sys.stdout.write(make_ammo(method, url, headers, case, body))
if __name__ == "__main__":
main()
Expand Down
34 changes: 29 additions & 5 deletions docs/core_and_modules.rst
Original file line number Diff line number Diff line change
Expand Up @@ -848,6 +848,8 @@ InfluxDB

InfluxDB uploader.

yaml file section: **influx**

Options
-------

Expand All @@ -862,15 +864,15 @@ Options
:password:
(Optional) InfluxDB password. (Default: 'root')
:labeled:
(Optional) Send labels (ammo tags) to influx. (Default: false)
(Optional) Send per-label (ammo tags) stats to influxdb. (Default: false)
:histograms:
(Optional) Send response time histograms to influxdb. (Default: false)
:prefix_measurement:
(Optional) Add prefix to measurement name. (Default: '')
:tank_tag:
(Optional) Tank tag. (Default: 'unknown')
:grafana_root:
(Optional) Grafana root path. Used to generate link to grafana dashboard.
:grafana_dashboard:
(Optional) Grafana dashboard name. Used to generate link to grafana dashboard.
:custom_tags:
(Optional) Dict of custom tags, added to every sample row.

Example:

Expand All @@ -883,6 +885,7 @@ Example:
tank_tag: 'mytank'
prefix_measurement: 'your_test_prefix_'
labeled: true
histograms: true
***********
Expand Down Expand Up @@ -1010,6 +1013,27 @@ Advanced criteria types

Exit code - 30

Сriteria for specific tag
^^^^^^^^^^^^^^^^^^^^^^^^^

All criteria except ``limit`` could be used not for all test, but for a specially tagged uri.

Example: ``time(1s, 5s, /latest/index/)``
Stop test if average response time is higher than 1s ONLY from uri with tag ``/latest/index/`` for 5s.

It can be used for developing specific test success criteria for each uri.

Example:

.. code-block:: yaml
autostop:
autostop:
- http(4xx, 20%, 15s, GET /weff?id=1)
- http(4xx, 5%, 5s, POST /authorize)
Stop test if there're more than 5% of 4xx codes for uri with tag ``POST /authorize`` or if there're more than 20% of 4xx codes for uri with tag ``GET /weff?id=1``.


Telegraf
========
Expand Down
125 changes: 125 additions & 0 deletions docs/tutorial.rst
Original file line number Diff line number Diff line change
Expand Up @@ -517,6 +517,131 @@ Phout example:
.. note::
contents of phout depends on phantom version installed on your Yandex.Tank system.

net codes are system codes from errno.h, on most Debian-based systems those are:

::

1 EPERM Operation not permitted
2 ENOENT No such file or directory
3 ESRCH No such process
4 EINTR Interrupted system call
5 EIO Input/output error
6 ENXIO No such device or address
7 E2BIG Argument list too long
8 ENOEXEC Exec format error
9 EBADF Bad file descriptor
10 ECHILD No child processes
11 EAGAIN Resource temporarily unavailable
12 ENOMEM Cannot allocate memory
13 EACCES Permission denied
14 EFAULT Bad address
15 ENOTBLK Block device required
16 EBUSY Device or resource busy
17 EEXIST File exists
18 EXDEV Invalid cross-device link
19 ENODEV No such device
20 ENOTDIR Not a directory
21 EISDIR Is a directory
22 EINVAL Invalid argument
23 ENFILE Too many open files in system
24 EMFILE Too many open files
25 ENOTTY Inappropriate ioctl for device
26 ETXTBSY Text file busy
27 EFBIG File too large
28 ENOSPC No space left on device
29 ESPIPE Illegal seek
30 EROFS Read-only file system
31 EMLINK Too many links
32 EPIPE Broken pipe
33 EDOM Numerical argument out of domain
34 ERANGE Numerical result out of range
35 EDEADLOCK Resource deadlock avoided
36 ENAMETOOLONG File name too long
37 ENOLCK No locks available
38 ENOSYS Function not implemented
39 ENOTEMPTY Directory not empty
40 ELOOP Too many levels of symbolic links
42 ENOMSG No message of desired type
43 EIDRM Identifier removed
44 ECHRNG Channel number out of range
45 EL2NSYNC Level 2 not synchronized
46 EL3HLT Level 3 halted
47 EL3RST Level 3 reset
48 ELNRNG Link number out of range
49 EUNATCH Protocol driver not attached
50 ENOCSI No CSI structure available
51 EL2HLT Level 2 halted
52 EBADE Invalid exchange
53 EBADR Invalid request descriptor
54 EXFULL Exchange full
55 ENOANO No anode
56 EBADRQC Invalid request code
57 EBADSLT Invalid slot
59 EBFONT Bad font file format
60 ENOSTR Device not a stream
61 ENODATA No data available
62 ETIME Timer expired
63 ENOSR Out of streams resources
64 ENONET Machine is not on the network
65 ENOPKG Package not installed
66 EREMOTE Object is remote
67 ENOLINK Link has been severed
68 EADV Advertise error
69 ESRMNT Srmount error
70 ECOMM Communication error on send
71 EPROTO Protocol error
72 EMULTIHOP Multihop attempted
73 EDOTDOT RFS specific error
74 EBADMSG Bad message
75 EOVERFLOW Value too large for defined data type
76 ENOTUNIQ Name not unique on network
77 EBADFD File descriptor in bad state
78 EREMCHG Remote address changed
79 ELIBACC Can not access a needed shared library
80 ELIBBAD Accessing a corrupted shared library
81 ELIBSCN .lib section in a.out corrupted
82 ELIBMAX Attempting to link in too many shared libraries
83 ELIBEXEC Cannot exec a shared library directly
84 EILSEQ Invalid or incomplete multibyte or wide character
85 ERESTART Interrupted system call should be restarted
86 ESTRPIPE Streams pipe error
87 EUSERS Too many users
88 ENOTSOCK Socket operation on non-socket
89 EDESTADDRREQ Destination address required
90 EMSGSIZE Message too long
91 EPROTOTYPE Protocol wrong type for socket
92 ENOPROTOOPT Protocol not available
93 EPROTONOSUPPORT Protocol not supported
94 ESOCKTNOSUPPORT Socket type not supported
95 ENOTSUP Operation not supported
96 EPFNOSUPPORT Protocol family not supported
97 EAFNOSUPPORT Address family not supported by protocol
98 EADDRINUSE Address already in use
99 EADDRNOTAVAIL Cannot assign requested address
100 ENETDOWN Network is down
101 ENETUNREACH Network is unreachable
102 ENETRESET Network dropped connection on reset
103 ECONNABORTED Software caused connection abort
104 ECONNRESET Connection reset by peer
105 ENOBUFS No buffer space available
106 EISCONN Transport endpoint is already connected
107 ENOTCONN Transport endpoint is not connected
108 ESHUTDOWN Cannot send after transport endpoint shutdown
109 ETOOMANYREFS Too many references: cannot splice
110 ETIMEDOUT Connection timed out
111 ECONNREFUSED Connection refused
112 EHOSTDOWN Host is down
113 EHOSTUNREACH No route to host
114 EALREADY Operation already in progress
115 EINPROGRESS Operation now in progress
116 ESTALE Stale file handle
117 EUCLEAN Structure needs cleaning
118 ENOTNAM Not a XENIX named type file
119 ENAVAIL No XENIX semaphores available
120 EISNAM Is a named type file
121 EREMOTEIO Remote I/O error
122 EDQUOT Disk quota exceeded

Graph and statistics
====================

Expand Down
10 changes: 5 additions & 5 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

setup(
name='yandextank',
version='1.12.2',
version='1.12.3',
description='a performance measurement tool',
longer_description='''
Yandex.Tank is a performance measurement and load testing automatization tool.
Expand All @@ -20,13 +20,13 @@
'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.13', 'cerberus==1.2', 'influxdb>=5.0.0', 'netort>=0.4.2',
'retrying==1.3.3', 'pytest-benchmark==3.2.2'
'pyyaml>=4.2b1', 'cerberus==1.2', 'influxdb>=5.0.0', 'netort>=0.6.3',
'retrying>=1.3.3', 'pytest-runner'
],
setup_requires=[
],
tests_require=[
'pytest', 'pytest-runner', 'flake8', 'pytest-benchmark'
'pytest==4.6.3', 'flake8', 'pytest-benchmark'
],
license='LGPLv2',
classifiers=[
Expand Down Expand Up @@ -60,7 +60,7 @@
'yandextank.plugins.Bfg': ['config/*'],
'yandextank.plugins.Console': ['config/*'],
'yandextank.plugins.DataUploader': ['config/*'],
'yandextank.plugins.Influx': ['config/*'],
'yandextank.plugins.InfluxUploader': ['config/*'],
'yandextank.plugins.JMeter': ['config/*'],
'yandextank.plugins.JsonReport': ['config/*'],
'yandextank.plugins.Pandora': ['config/*'],
Expand Down
8 changes: 6 additions & 2 deletions yandextank/common/interfaces.py
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,10 @@ def explain(self):
""" long explanation to show after test stop """
raise NotImplementedError("Abstract methods requires overriding")

def get_criterion_parameters(self):
""" returns dict with all criterion parameters """
raise NotImplementedError("Abstract methods requires overriding")

def widget_explain(self):
""" short explanation to display in right panel """
return self.explain(), 0
Expand Down Expand Up @@ -271,7 +275,7 @@ class MonitoringPlugin(AbstractPlugin):

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

def add_listener(self, plugin):
self.listeners.append(plugin)
self.listeners.add(plugin)
2 changes: 1 addition & 1 deletion yandextank/config_converter/converter.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ def parse_package_name(package_path):
'RCAssert': 'rcassert',
'JsonReport': 'json_report|jsonreport',
'Pandora': 'pandora',
'Influx': 'influx',
'InfluxUploader': 'influx',

}

Expand Down
2 changes: 1 addition & 1 deletion yandextank/config_converter/tests/test_converter.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ def test_parse_package(package_path, expected):
])
def test_convert_ini_phantom(ini_file, yaml_file):
with open(os.path.join(os.path.dirname(__file__), yaml_file), 'r') as f:
assert convert_ini(os.path.join(os.path.dirname(__file__), ini_file)) == yaml.load(f)
assert convert_ini(os.path.join(os.path.dirname(__file__), ini_file)) == yaml.load(f, Loader=yaml.FullLoader)


@pytest.mark.parametrize('ini_file, msgs', [
Expand Down
6 changes: 4 additions & 2 deletions yandextank/core/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import pkg_resources
from netort.resource import manager as resource_manager
from yandextank.core.consoleworker import TankWorker
from yandextank.core.tankcore import LockError
from yandextank.validator.validator import ValidationError


Expand Down Expand Up @@ -129,8 +130,8 @@ def main():
ammo_file=ammofile if ammofile else None,
log_handlers=handlers
)
except ValidationError as e:
logging.error('Config validation error:\n{}'.format(e.errors))
except (ValidationError, LockError) as e:
logging.error('Config validation error:\n{}'.format(e.message))
return
worker.start()
try:
Expand All @@ -141,6 +142,7 @@ def main():
except KeyboardInterrupt:
worker.stop()
worker.join()
sys.exit(worker.retcode)


def init_logging(events_log_fname, verbose, quiet):
Expand Down
2 changes: 1 addition & 1 deletion yandextank/core/config/00-base.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,4 +39,4 @@ overload:
package: yandextank.plugins.DataUploader
influx:
enabled: false
package: yandextank.plugins.Influx
package: yandextank.plugins.InfluxUploader

0 comments on commit bf3c353

Please sign in to comment.