In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-15 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/03 Report--
The listener is one of the components of JMETER and is used to display test results. But they do more than that. The diversity of JMeter listeners enables performance engineers to monitor requests sent from JMeter and analyze responses received from the system under test.
The listener collects information about time and capacity through JMeter requests and responses, or processes statistics such as distribution and percentage. Senior testers can even use BeanShell or JSR223 listeners to customize set consolidation performance test metrics. Almost all listeners can write results to a file, allowing performance engineers to convert them to the desired format.
This blog series will discuss different types of listeners. This time we will discuss listeners that collect and display sample data in a basic format without any complex calculations or operations. But first, we'll explain where you put Listener in a test script.
Placing Listeners in a Test Script
You can find all listeners by clicking add-> listeners. The JMeter listener will only collect data from JMeter elements at or above its level. If the listener is added to the script as a child element, it will display only the data related to its parent element. If you add a listener under a thread group of scripts with several thread groups, the listener displays data from all samplers that belong to that thread group. If you need to view reports for all samplers in the script, place the listener at the same level as all thread groups in the script.
Look at the picture more directly:
View Results Tree
The view result tree listener shows the generation of sample samples for JMeter and the associated assertion results. This listener displays these samples in the order in which the JMeter script is generated, and provides parameters and data for each sample.
For example, for each sample generated by the HTTP sampler, the view result tree listener provides request parameters, response parameters, and response data. These are displayed under the appropriate tabs: sampler results, request and response data.
The Sampler results tab contains the response code, header, Cookies, and information about time, delay, response size (in bytes)-for headers, text, and error counts, respectively.
The request tab contains header files, URL,HTTP methods, and cookie information about JMeter script additions.
The response data tab contains the response body of the sample.
One of the most useful elements of the view result tree listener is a tab that converts the information transferred in the sample body into the desired format: simple text, HTML, or XML. It also filters substrings by using RegExp mode, a specific XPath,JSON path, or CSS. This helps to build and validate the corresponding post processor in the script.
An example of using the RegExp tester in the View result Tree listener is shown in the screenshot below.
The view result tree listener also displays failed assertions and compares the expected and actual results. However, if the assertion is passed, the success is not displayed. The screenshot below shows an example.
View Results in Table
To view the results with a table the listener displays information about each sample in tabular form. The table displays time-related data, such as each sample, payload data, number of threads and sample execution results. The results in the table are sorted in the order of time samples. This listener is useful for quickly evaluating the behavior of the system under test.
Response Time Graph
The additional listener that draws the sample response time graph during the test is the response time graph listener. This listener can draw the graphics of all samples or selected samples. This is shown in the screenshot below
Assertion Results
The assertion results listener displays the results of all assertions in its scope. This listener displays the assertions displayed by the sample. Passed assertions are not displayed. This listener is shown in the following screenshot:
But there is a problem with the listeners we have mentioned so far-they are elements of resource consumption. Therefore, it is sometimes best to write the data to a file during the test and then process the saved data after the test is complete. In the case of large data, this should be the case.
To do this, some listeners only write data to files and JMeter logs, and do not display them in tables and graphs. The data in the sample can then be saved in two formats: CSV and XML. The format and saved data are defined in the JMeter properties file.
Simple Data Writer
A simple data writer is such a listener. This listener can write the results to the file name provided. The contents and format of the file are determined in the jmeter.properties file, and the jmeter.properties file is located in the 'bin' folder of JMeter. In the screenshot below, you can see the contents of the JMeter properties file and the saved data.
Flexible File Writer
Flexible file writers are more advanced than simple data writers. It allows you to configure sample data to print to a file, including configuration file headers and footers. The listener is shown in the following screenshot:
Save Responses to a File
The Save response to File listener saves the information for each specific response to a separate file and then indexes it. The file name consists of the basic part of the file name and the index. Developers using this listener should consider that multiple files may be created.
Translated to: BlazeMeter:JMeter Listeners-Part 1: Listeners with Basic Displays
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.