In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/03 Report--
This article mainly introduces the example analysis of engine startup in JMeter, which has a certain reference value, and interested friends can refer to it. I hope you will gain a lot after reading this article.
I. brief introduction
Some of the main things and contents that jmeter does at the bottom after clicking execute in the console, because it is convenient for breakpoint debugging to operate in GUI mode.
II. Brief introduction to configuration
For the convenience of debugging, use single thread to access Baidu (if the breakpoint of multi-thread may be dizzy, which will be discussed later)
Third, begin to explain the principle
First, click execute under GUI, and execute the performAction () method under the ActionRouter class, which is the entry for executing the subsequent process.
ActionRouter is a listener that listens for changes in the flow of GUI events to operate accordingly
two。 When you enter the doAction method in the Start class, the startEngine function is called to open the jmeter engine. Of course, it is not enabled inside, and a series of pre-processing will be performed in the function.
Next, go to the StandardJMeterEngine class, which is the entrance to really start jmeter engine. Next, let's take a look at what has been done in the runTest function.
What does the run () method do?
From these two pictures, we understand that the jmeter startup process will first run the configuration in the setup thread group, then run the configuration in the thread group, and finally run the configuration in the teardown thread group.
Next, let's explain how the thread group works. In the figure above, while (running & & iter.hasNext ()) {} code block
Now let's get into the ThreadGroup process and see what it does.
After newThread.start (), we start to go into the run method in the JMeterThread class, see what it does, and start to get closer and closer to the point.
The sampler.sample (null) code is executed in the doSampling () function, which executes the sample () method and receives the return result.
After typing in the above figure, you will enter the HTTPSampleProxy class and call the sample function to obtain the request category through the HTTPSamplerFactory factory method.
Through the impl.sample (u, method, areFollowingRedirect, depth) function, you will enter the sample method of the HTTPHC4Impl implementation class and find the execution part of httpResponse = executeRequest (httpClient, httpRequest, localContext, url)
A httpclient request to get the response data occurs in this executeRequest () method
Then the response data and some parameter data of the request configuration are passed into the HTTPSampleResult class object, and the parent class of HTTPSampleResult is SampleResult, where the request response processing ends.
After the doSampling () function is finished, the resulting HTTPSampleResult object does some processing.
After the processSampler () function is executed, it will go to sam = threadGroupLoopController.next (); code block
The code block will get a LoopController loop controller, get the next sampler Sampler, and if not, it will jump out of the while loop
Finally, do some cleaning actions.
The end of the run method of the StandardJMeterEngine class, which ends when the entire jmeter engine starts to finish.
Fourth, JMeter engine start-up link diagram
Thank you for reading this article carefully. I hope the article "sample Analysis initiated by engine in JMeter" shared by the editor will be helpful to you. At the same time, I also hope you will support us and pay attention to the industry information channel. More related knowledge is waiting for you to learn!
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.