How to use patch_ini_config_with_monitoring method in yandex-tank

Best Python code snippet using yandex-tank

consoleworker.py

Source:consoleworker.py Github

copy

Full Screen

...110 for config_file in config_files:111 all_config_files.append(config_file)112 cfg_ini = load_ini_cfgs([cfg_file for cfg_file in all_config_files if is_ini(cfg_file)])113 # substitute telegraf config114 def patch_ini_config_with_monitoring(ini_config, mon_section_name):115 """116 :type ini_config: ConfigParser117 """118 CONFIG = 'config'119 telegraf_cfg = ini_config.get(mon_section_name, CONFIG)120 if not telegraf_cfg.startswith('<') and not telegraf_cfg.lower() == 'auto':121 with open(resource_manager.resource_filename(telegraf_cfg), 'rb') as telegraf_cfg_file:122 config_contents = telegraf_cfg_file.read()123 ini_config.set(mon_section_name, CONFIG, config_contents)124 return ini_config125 try:126 cfg_ini = patch_ini_config_with_monitoring(cfg_ini, 'monitoring')127 except (NoSectionError, NoOptionError):128 try:129 patch_ini_config_with_monitoring(cfg_ini, 'telegraf')130 except (NoOptionError, NoSectionError):131 pass132 for section, key, value in depr_options:133 if not cfg_ini.has_section(section):134 cfg_ini.add_section(section)135 cfg_ini.set(section, key, value)136 return apply_shorthand_options(cfg_ini, cmd_options)137 except Exception as ex:138 sys.stderr.write(RealConsoleMarkup.RED)139 sys.stderr.write(RealConsoleMarkup.RESET)140 sys.stderr.write(RealConsoleMarkup.TOTAL_RESET)141 raise ex142class ConsoleWorker(Thread, TankWorker):143 def __init__(self, configs, cli_options=None, cfg_patches=None, cli_args=None, no_local=False,...

Full Screen

Full Screen

Automation Testing Tutorials

Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.

LambdaTest Learning Hubs:

YouTube

You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.

Run yandex-tank automation tests on LambdaTest cloud grid

Perform automation testing on 3000+ real desktop and mobile devices online.

Try LambdaTest Now !!

Get 100 minutes of automation test minutes FREE!!

Next-Gen App & Browser Testing Cloud

Was this article helpful?

Helpful

NotHelpful