如何在Jmeter中使用筛选结果插件工具 [英] How to use Filter results Plugin tool in Jmeter

查看:181
本文介绍了如何在Jmeter中使用筛选结果插件工具的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嘿,所有这些都是后续问题 此问题 我想从CSV文件中删除一些采样器结果. 我尝试逐步解释整个过程. 原始csv文件的位置为c://desktop//results.csv.我想创建另一个没有任何采样器结果的文件. 我得到了这个答案

Hey all this is a follow up question to this question I want to remove some sampler results from CSV file. I try to get a step by step explanation for the whole process. The origin csv file location is c://desktop//results.csv. and I want to create another file without some sampler results. I get this answer

jmeter\lib\ext\FilterResults.bat --output-file filteredout.csv --input-file inputfile.jtl
 --exclude-label-regex true --exclude-labels HTTP[1-3].*

有人可以详细说明吗 1.我应该把什么放在输出文件filteredout.csv下?放置位置还是只是文件名?

Can someone please elaborate 1. What shall I put under output-file filteredout.csv? to put location or just the name of file?

  1. 获取第一个文件后,我将运行一个不同的过程吗?

推荐答案

如我所见,您正在Windows上运行,是的,您应该提供文件的确切路径.我会给你一个例子,以便您了解它是如何工作的. 使用命令行时,要执行测试,请执行以下操作:

As I see you are running on windows, so yeah, you should provide the exact path to the file. I will give you an example so you can understand how it works.. When using command line, to execute the test you do something like this:

c:\>C:\apache-jmeter-3.3\apache-jmeter-3.3\bin\jmeter.bat -n -t c:\Projects\someproject.jmx -l results.jtl -Jvariable=1 

(-Jvariable = 1)->变量是可选的(仅在jmx配置中已设置)

所以现在您有了results.jtl文件.要过滤结果,请执行另一个如下所示的命令:

c:\>C:\apache-jmeter-3.3\apache-jmeter-3.3\bin\FilterResults.bat --output-file c:\path\to\results.jtl --input-file c:\path\to\results.jtl --exclude-labels "labels-to-be-excluded"

最后一条命令的作用,只是将旧的jtl文件替换为新的过滤后的jtl文件. 要准时回答您的问题:

What the last command does, it just replaces the old jtl file with the new filtered one. To answer your questions punctually:

1.是的,您需要输入完整的输出和输入路径,就像在cmd中一样. (您应该在cmd中测试命令)

2.是的,这是第二个不同的过程,您将在获取第一个文件后运行.

P.S.我已经在jenkins中建立了一个执行此操作的管道,对于过滤器部分,我添加了另一个步骤,如下所示:

stage ('Cleaning stuff up') {
            // Batch build step
bat """ 
c:\>C:\apache-jmeter-3.3\apache-jmeter-3.3\bin\FilterResults.bat --output-file c:\path\to\results.jtl --input-file c:\path\to\results.jtl --exclude-labels "labels-to-be-excluded"
 """ 
    }

这篇关于如何在Jmeter中使用筛选结果插件工具的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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