【发布时间】:2019-01-24 18:04:11
【问题描述】:
如何在 jmeter 采样器结果的响应头中提取一个值并获取计数。
我正在运行负载测试,例如 100 个线程。我的请求将通过负载均衡器到达 4 台服务器。
我需要获取到 ABCHeader 的请求计数:Staging 01,Staging 02,Staging 03,Staging 04。(我从每个请求的响应头中获取)
检查请求是否被平均分配到每个服务器。有什么可能的方法?
我尝试使用正则表达式提取器并提取了值。但我不确定如何获得计数
请检查下面的响应标头:检查 ABCHeader: Staging 04
> HTTP/1.1 200 OK
> Date: Thu, 24 Jan 2019 17:13:29 GMT
> Server: Apache
> Cache-Control: no-cache, max-age=0
> Vary: Accept-Encoding
> Expires: Thu, 24 Jan 2019 17:13:29 GMT
> X-Content-Type-Options: nosniff
> X-XSS-Protection: 1; mode=block
> Strict-Transport-Security: max-age=31536000
> Set-Cookie: XSRF-TOKEN=fd; expires=Thu, 24-Jan-2019 19:13:29 GMT; Max-Age=7200; path=/;HttpOnly;Secure
> Set-Cookie: laravelsession=df; expires=Thu, 24-Jan-2019 19:13:29 GMT; Max-Age=7200; path=/; HttpOnly;HttpOnly;Secure
> ABCHeader: Staging 04
> Keep-Alive: timeout=5, max=100
> Connection: Keep-Alive
> Content-Type: text/html; charset=UTF-8
> Set-Cookie: abcLB-Staging=df; path=/; Httponly; Secure
> Content-Length: 2193
> Content-Encoding: gzip
【问题讨论】:
标签: jmeter