跟踪JMeter中正则表达式提取器的结果 [英] Track results of a regular expression extractor in JMeter

查看:284
本文介绍了跟踪JMeter中正则表达式提取器的结果的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们的服务器返回一个自定义的X-Execution-TimeHTTP响应头,它以毫秒为单位返回服务器获取请求和返回页面的代码之间的时间,即代码运行的时间。我正在使用JMeter进行一些测试和测试我希望能够随着时间的推移报告这个数字。我已经设置了这个正则表达式提取器: X-Execution-Time:\s(\d +)但是我不知道如何让JMeter报告这个每个请求的数量,所以我可以得到一个随时间变化的趋势

Our server returns a custom 'X-Execution-Time' HTTP response header that returns in miliseconds the time between the server getting a request and our code returning a page, ie how long our code takes to run. I'm using JMeter to do some testing & I'd like to be able to report on this number of over time. I've setup this regular expression extractor: X-Execution-Time:\s(\d+) but I don't know how to get JMeter to report on this number per request so i can get a trend over time

推荐答案

这无论如何都不优雅,但它确实有效:

This isn't elegant by any means, but it certainly works:

将调试采样器添加到测试计划中,并为其指定与正则表达式引用相同的名称。这会将时间值写入结果文件。

Add a debug sampler into your test plan, and give it the same name as your regex reference. This will write out the time value into the results file.

如果您有不同的页面示例:

Example if you have different pages:

正则表达式reference = X-Execution-Time
Debug Sampler Name = PageName - 执行:$ {X-Execution-Time}

regex reference = X-Execution-Time Debug Sampler Name = PageName - Execution: ${X-Execution-Time}

这篇关于跟踪JMeter中正则表达式提取器的结果的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆