Yandex-tank - 有不同http头的几个请求

问题描述:

有没有人试过使用Yandex-tank作为http加载测试工具?Yandex-tank - 有不同http头的几个请求

我有一个用于测试包含不同路径和查询参数和不同http headear的多个请求的http服务的用例。

E.G.第一请求类型 -/test/user1?param1 = 1 [X-Forwarded-For:192.168.0.1],第二请求类型 -/test/user2?param1 = 2 [X-Forwarded-For:192.168.0.2]

问题是如何配置ammo.txt文件以拥有不同的http标头。

我想:

# load.conf  
[phantom] 
address=myservice.loC#Target's address and port . 
rps_schedule=line(1, 50, 1m) ## 1 minute, from 1 to 50 requests per second 

# ammo.txt  
[X-Forwarded-For: 192.168.0.1] 
/test/user1?param1=1  

[X-Forwarded-For: 192.168.0.2] 
/test/user2?param1=2 

测试进行确定,但所有的requestd有X - 转发,对于:192.168.0.1

我wounder如何ammo.txt配置,以适应我的用例(有不同的标题)? 也可以请你建议一些替代工具来做到这一点?

使用URI格式时,不能有不同的标头。

UPD:我们增加了一个新功能,现在你可以在uri风格的弹药中做到这一点,请参阅docs。一个URI式弹药页眉修改的一个例子:

[Connection: close] 
[Host: target.example.com] 
[Cookies: None] 
/?drg tag1 
/
/buy tag2 
[Cookies: test] 
/buy/?rt=0&station_to=7&station_from=9 

你也可以在请求式的描述here产生弹药。 一种请求式弹药具有不同“主机”报头的示例:

34 good 
GET/HTTP/1.0 
Host: xxx.tanks1.example.com 
User-Agent: xxx (shell 1) 

78 bad 
GET /abra HTTP/1.0 
Host: xxx.tanks2.example.com 
User-Agent: xxx (shell 1) 

79 unknown 
GET /ab/ra HTTP/1.0 
Host: xxx.tanks3.example.com 
User-Agent: xxx (shell 1) 

34 good - 这是报头,数目在字节(包括行尾)下面的请求的大小。而good是一个标记。

+0

你能举一些例子吗? –

+1

现在允许使用URI格式的不同标题 – r2d2