How to exclude unnecessary requests from JMeter log file in NonGUI mode

ぐ巨炮叔叔 提交于 2019-12-13 02:50:15

问题


I am running JMeter 4.0 r1823414.

In my test suite, I have the following structure:

When I run this TestPlan in non gui mode with the following command:

.\jmeter -t $testplan -l $testlog -e -o $reportFolder

I get a CSV file with all debug steps and requests (Authentication for example).
I am interested only in Query requests.
How can I exclude all requests from the CSV file and leave only Query requests in there?


回答1:


I figured out what I did wrong. by providing -l with a file path, I created a listener for the whole test session:

12.2 non-GUI (batch) test runs
When running in non-GUI mode, the -l flag can be used to create a top-level listener for the test run. This is in addition to any Listeners defined in the test plan. The configuration of this listener is controlled by entries in the file jmeter.properties as described in the previous section.

If I run jmeter -n -t $testplan i get just the logs from the listeners I have specified




回答2:


This is exact match for Filter Results Tool jmeter plugin

It should also filter queries that are not calls to the application but debug samplers or intermediate calculation samplers as beanshell samplers.

In your case you search for Query:

 jmeter\lib\ext\FilterResults.bat --output-file filteredout.csv --input-file inputfile.jtl --include-label-regex true --include-labels "Query.*"



回答3:


If you want to exclude from CSV , then go for Filter Results Tool as per @ser7294900 answer.

But if you only want to exclude in HTML report then :

  • First apply Naming Convention on your Transaction Controllers by right clicking on them and selecting "Apply Naming Convention"

- Second, use menu Help > "Export Transactions for report" and replace this in user.properties



来源:https://stackoverflow.com/questions/48810486/how-to-exclude-unnecessary-requests-from-jmeter-log-file-in-nongui-mode

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!