1

我不知道yandex-tank-api-client示例是如何工作的。我在tank-example.py中进行了以下更正:已替换(否则错误)

84: tsk = tankapi.shoot(*cfg)

84: tsk = tankapi.shoot(*cfg, f)

其中f - 是函数:

def f(status, t):
    print "Status: %s" % status

我已经用我的文件替换了示例的 load.yaml 文件:

- tanks: ['localhost']
  config: ./load.ini
  log_name: task-A
  download: ['*.log','*.ini']
  upload: ['*.ammo']
  expected_codes: [0]

其中load.ini是:

[DEFAULT]
use_caching = 0

[phantom]
phantom_path = /home/krylov/prj/yandex/phantom/bin/phantom
phantom_modules_path = /home/krylov/prj/yandex/phantom/lib/phantom
address=localhost:8000
rps_schedule=const(10, 10s)
; Headers and URIs for GET requests

header_http = 1.1
headers = /
          [Host: 127.0.0.1]
          [Connection: close]
uris = /
       /instances
       /datastore
       /datastore-indexes

在我在localhost上运行yandex-tank-api-server并且tank-example.py 脚本测试开始后,但它无法离开配置阶段:

    2016-04-19 12:44:10,263 [DEBUG] Tank localhost: API returned code 200, contents:
{
    "status": "running", 
    "retcode": null, 
    "stage_completed": true, 
    "break": "configure", 
    "current_stage": "lock", 
    "tank_status": {}, 
    "failures": []
}
Status: 0

tank.log文件以行结尾(您可以在此处完整tank.log):

2016-04-19 12:44:00,287 [INFO] yandex_tank_api.worker Changing the next break from lock to configure
2016-04-19 12:44:00,288 [WARNING] yandextank.core.tankcore Lock file present: /var/lock/lunapark_1WgKl6.lock
2016-04-19 12:44:00,288 [DEBUG] root No process[3]: [Errno 3] No such process
2016-04-19 12:44:00,288 [DEBUG] yandextank.core.tankcore Lock PID 13895 not exists, ignoring and trying to remove

我想了解为什么 PID 不存在。示例是否有错误?

4

0 回答 0