yandex / yandex-tank

Load and performance benchmark tool
Other
2.46k stars 278 forks source link

Installing tank on RHEL 6.6 caused ERROR: Import by filename is not supported. #145

Closed RocketRaccoon closed 6 years ago

RocketRaccoon commented 9 years ago

Hi, I have tried to install tank on RHEL 6.6 following these instructions 1 and 2. When launching yandex-tank got following exception:

# yandex-tank
18:28:52 INFO: No config passed via cmdline, using ./load.ini
18:28:52 INFO: Loading configs...
18:28:52 INFO: Loading plugins...
18:28:52 INFO: Exception: Traceback (most recent call last):
  File "/usr/lib/python2.6/site-packages/yandextank/core/consoleworker.py", line 224, in configure
    self.core.load_plugins()
  File "/usr/lib/python2.6/site-packages/yandextank/core/tankcore.py", line 242, in load_plugins
    plugin = il.import_module(plugin_path)
  File "/usr/lib/python2.6/site-packages/importlib/__init__.py", line 37, in import_module
    __import__(name)
ImportError: Import by filename is not supported.
18:28:52 ERROR: Import by filename is not supported.
18:28:52 ERROR: Exception: Import by filename is not supported.

I'm not good either in linux nor python so will be grateful for the help

My load.ini

[tank]
plugin_web=Tank/Plugins/WebOnline.py
plugin_console=Tank/Plugins/ConsoleOnline.py
plugin_ShellExec=Tank/Plugins/ShellExec.py
plugin_phantom=Tank/Plugins/Phantom.py
plugin_aggreg=Tank/Plugins/Aggregator.py

[phantom]
address=google.ru
port=80
rps_schedule=const(2, 2m)
headers = [Host: google.ru] [Connection: close] [Bloody: yes]
uris=/

[web]
port = 80
interval = 5
manualstop = 1

Without [tank] section it works with no errors.

doctornkz commented 9 years ago

Just try this method:

[tank] plugin_ShellExec=yandextank.plugins.ShellExec plugin_phantom=yandextank.plugins.Phantom plugin_aggreg=yandextank.plugins.Aggregator plugin_console=yandextank.plugins.ConsoleOnline

You use "direct" way to install Yandex.Tank - from git. So you have to use python-style adding.

RocketRaccoon commented 9 years ago

Cool. That worked. How do I should add Web Online plugin? It seems that it is not exist in plugins folder, was it renamed or moved?

doctornkz commented 9 years ago

As I know there is dedicated plugin for web online - nline https://github.com/yandex-load/yatank-online . Feel free to try and get support!

RocketRaccoon commented 9 years ago

Ok, I have installed yatank-online (at least i think so). Added plugin_web=yatank_OnlineReport to my [tank] section. Should I add [web] section or it have to be configurated in another way? Now my ini file looks like:

[tank]
plugin_ShellExec=yandextank.plugins.ShellExec
plugin_phantom=yandextank.plugins.Phantom
plugin_aggreg=yandextank.plugins.Aggregator
plugin_console=yandextank.plugins.ConsoleOnline
plugin_web=yatank_OnlineReport

[phantom]
address=google.ru:80
rps_schedule=const(2, 2m)
headers = [Host: google.ru] [Connection: close] [Bloody: yes]

[web]
port = 8001
interval = 5
manualstop = 1

I'm expected to see online reporting on adress [server_name]:8001. Am I right?

doctornkz commented 9 years ago

I assigned question to direvius@ He is mainteiner Online plugin

yarax commented 9 years ago

I have the same problem, but pointed tank section and installing via PyPI don't help:

19:43:15 INFO: No config passed via cmdline, using ./load.ini
19:43:15 INFO: Loading configs...
19:43:15 INFO: Loading plugins...
19:43:15 INFO: Exception: Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/yandextank/core/consoleworker.py", line 224, in configure
    self.core.load_plugins()
  File "/usr/local/lib/python2.7/dist-packages/yandextank/core/tankcore.py", line 242, in load_plugins
    plugin = il.import_module(plugin_path)
  File "/usr/lib/python2.7/importlib/__init__.py", line 37, in import_module
    __import__(name)
ImportError: Import by filename is not supported.

19:43:15 ERROR: Import by filename is not supported.

My load.ini:

[tank]
plugin_ShellExec=yandextank.plugins.ShellExec
plugin_phantom=yandextank.plugins.Phantom
plugin_aggreg=yandextank.plugins.Aggregator
plugin_console=yandextank.plugins.ConsoleOnline

[phantom]
address=google.ru:80
rps_schedule=const(2, 2m)
headers = [Host: google.ru] [Connection: close] [Bloody: yes]

[web]
port = 8001
interval = 5
manualstop = 1
maklaut commented 9 years ago

@yarax look for default yandex-tank ini, try these locations https://github.com/yandex-load/yandex-tank-api#tank-configuration