In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/03 Report--
1) introduction to Jmeter4.0
Jmeter is an open source stress testing tool written by pure java. Apache's open source software was designed for web testing at first. Due to the rapid development, it can now test many protocols such as http, https, soap, ftp, database database, LDAP lightweight directory access protocol, TCP, SOMP (simple mail protocol), etc. Because it is written by pure java, it can run under Apple, window or Linux and test IDE with full function. Allows you to quickly build test plans (from browsers or local applications, the official website address: http://jmeter.apache.org) dint Jmeter is a tool that middle and senior developers or testers must master.
Comparison of commonly used testing tools:
1. Loadrunner: stable performance, large pressure test results and fine granularity, you can customize the script for stress test, but it has too many functions. 2. Apache ab (single interface stress test is the most convenient): simulate multithreaded concurrent requests. Ab commands require very low requirements on computers that issue loads, and will not take up much CPU or too much memory. However, it will cause a huge load to the target server, simple DDOS*** and other 3, webbench:webbench first fork a number of sub-processes, each child process cycle to do web access testing. The child process tells the parent process the result of the visit through pipe, and the parent process makes the final statistical result.
2) characteristics
Provide GUI graphical interface and non-GUI interface for stress test, develop test stress test script under windows, and then execute it directly on linux
Complete dynamic HTML stress test report can be provided.
Pure java writing, once writing, pressure testing everywhere
The multithreaded framework allows simultaneous sampling and stress testing through multiple threads and simultaneous sampling of different functions through separate thread groups.
Provides highly scalable features, custom plug-ins:
Providing functions can be used to provide dynamic input or data manipulation for tests.
Easy and continuous integration through third-party open source libraries of Maven,Graddle and Jenkins
3) preparation work
Need to install java running environment, it is recommended to install JDK environment, although JRE is also possible, but stress testing https requires keytool tools in JDK
The new version of Jmeter4.0 requires a version of JDK8 or above, either JDK9 or JDK10, and configure the JDK environment (let's not configure the JDK environment here)
Download the corresponding Jmeter4.0 version and decompress it (official website address: http://jmeter.apache.org/)
Windows system: http://mirrors.tuna.tsinghua.edu.cn/apache//jmeter/binaries/apache-jmeter-4.0.zip
Mac or Linux: http://mirrors.tuna.tsinghua.edu.cn/apache//jmeter/binaries/apache-jmeter-4.0.tgz
4) explain how to extract the directory file from jmeter4.0.
Bin: core executable file Contains configuration jmeter.bat: windows startup file: jmeter: mac or linux startup file: jmeter-server:mac or Liunx distributed stress test startup file jmeter-server.bat:mac or Liunx distributed stress test startup file jmeter.properties: core configuration file examples: pressure test foot this article JMX and dynamic reading csv parameter file case result-template: visual HTML template:JMX template file docs:Jmeter API document extras: plug-in extension package lib: core dependency package ext: core package junit: unit test package 5) introduction to Jmeter core components
What is a test plan (Test plan)?
It is a process of stress testing, such as what interface to test, how many users, protocols, etc., and configure thread groups, samplers, listeners and other components under the test plan.
What is a Thread Group?
Thread group is to simulate how many users access your application concurrently, and how many users there are in this group. The creation method is shown in the figure above and now "add-> threads- > thread group" parameter description: number of threads: number of virtual users. Time taken by a virtual user to prepare a process or thread (Ramp-Up Period (in seconds)): the time it takes for all threads to start, such as 100 threads, 20 seconds, means that all 100 threads have to be started within 20 seconds, starting 5 thread cycles per second: the number of times each thread is sent, if the value is 5100 threads 500 requests will be sent, and you can check the permanent loop.
What is a Sampler?
Real working components. You can create various samplers with the interfaces, protocols, and parameters you want to stress test in the sampler, such as Http request, FTP request, JDBC stress test database request, JMS, etc. The corresponding sampler has different configurations. Take the http request sampler as an example name: sampler name, generally interface name, to facilitate subsequent distinction, such as "login interface" comment: sampler description. For others to understand, similar pressure test interfaces describe the web server configuration protocol: the pressure test protocol, such as "http" or "https" server name or IP: the port of the pressure test target machine or the server IP address For example, www.xdclass.net port number: the port number of the pressure test target machine, such as 8080 HTTP request configuration method: http request method, commonly used are GET,POST,PUT,DELETE,PATCH and other paths: URL of the pressure test API For example, / api/v1/users Content encoding: whether to redirect content encoding automatically: http redirects when a 302 status code is returned, but no record is generated. You cannot make an association request, for example, if the data of the first request is used in the second request, you cannot do the association follow redirection if you choose automatic redirection: a record will be generated and the association can be made. This Use multipart/from-data for HTTP POST is checked by default: when a POST request is sent, it is sent using the Use multipart/from-data method. It is unchecked by default. Parameters: parameter configuration Files Upload: file upload configuration
What is a result tree?
To view the results of the stress test, you can see the url,http parameters sent by the test, return the result and the entire response. Then, if there is an assertion or debugging, you can see whether the assertion is added through the path such as: thread group-> add-> listener-> View the result tree. If you do not add the number of results, click the start button of the test. We cannot know the specific response of the test, so we need to add the number of results. On the one hand, it is convenient to debug the stress test script to see whether the request parameters and paths are normally switched to the results view page. Click the pressure test button to enter the pressure test, and you can see the requested results at the same time.
An additional tip is to switch between Chinese and English in the GUI graphical interface language version:
1. Modify menu-> options-> choose language in the console and select the corresponding language version. 2. Modify the bin directory in the configuration file-> jmeter.properties default # language=en to language=zh_CN.
This is the first place to get started in the first season of OK,Jmeter4.0 stress test.
The next chapter will share the advanced knowledge of Jmeter, such as assertion usage, dynamic reading of CSV parameters, stress testing Mysql, non-GUI interface stress testing in Aliyun Linux environment, distributed pressure testing, etc.
Video tutorial reference: http://edu.51cto.com/course/13251.html
Https://www.xdclass.net/#/coursecatalogue?video_id=3
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.