mirror of
https://github.com/valitydev/yandex-tank.git
synced 2024-11-06 10:25:17 +00:00
25 lines
655 B
Python
25 lines
655 B
Python
from yandextank.api.apiworker import ApiWorker
|
|
import logging
|
|
|
|
logger = logging.getLogger('')
|
|
logger.setLevel(logging.DEBUG)
|
|
|
|
# not mandatory options below:
|
|
options = dict()
|
|
options['config'] = '/path/to/config/load.ini'
|
|
options['manual_start'] = "1"
|
|
options['user_options'] = [
|
|
'phantom.ammofile=/path/to/ammofile',
|
|
'phantom.rps_schedule=const(1,2m)',
|
|
]
|
|
log_filename = '/path/to/log/tank.log'
|
|
# ======================================
|
|
|
|
apiworker = ApiWorker()
|
|
apiworker.init_logging(log_filename)
|
|
try:
|
|
apiworker.configure(options)
|
|
apiworker.perform_test()
|
|
except Exception as ex:
|
|
logger.error('Error trying to perform a test: %s', ex)
|