Using JMeter under Windows

Source: Internet
Author: User
Tags server port

Brief introduction

Apache JMeter is a 100% pure Java desktop application designed to test the C/s structure of software (such as Web applications). It can be used to test performance including static and dynamic resource programs, such as static files, Java Servlets,java objects, databases, FTP servers, and so on. The jmeter can be used to simulate a large load on a server, network, or object to test or analyze overall performance under different load types.
In addition, JMeter is able to use assertions to create test scripts to verify that the application returns the results we expect, thus helping us with regression testing. For maximum flexibility, JMeter allows us to create assertions using regular expressions.

Install the Windows version

Download the latest version
http://jmeter.apache.org/download_jmeter.cgi

JMeter 2.11 (requires Java 1.6 or higher)

Unzip the Zip/tar file to any directory.

Make sure the JRE/JDK is properly installed and set the environment variable java_home.

Avoid installing Jmeter on a path with a space, which will cause problems with the remote test.

Run user interface mode

Run JMeter (for Unix) or Jmeter.bat (for Windows) files in the bin directory.

Server mode

For distribution testing, you can run JMeter using server mode and then control each server through the user interface/or command line.

Run Jmeter-server (for Unix) or Jmeter-server.bat (for Windows) files in the bin directory.

Command line

Jmeter-n-T FILENAME.JMX
-n This is the specified JMeter run in non-user interface mode
-T [the name of the Jmx file containing the test plan]

Jmeter-server-h My.proxy.server-p 8000
-h [Proxy Server host name or IP address]
-p [Proxy server port, default 1099]
Jmeter-n-T Filename.jmx-r 192.168.101.116:1099,192.168.101.113:1099

Test Plan

A test plan describes a series of steps to be performed by the JMeter runtime. A complete test plan consists of one or more thread groups (thread groups), logical control (logic controllers), sampling occurrence control (sample generating Controllers), listener (listeners) Timers (timers), assertions (assertions), and configuration components (config elements).

Adding and removing components (Elements)

In a tree, right-click to add a component to a test plan and select a new component from the Add list. Or, load from a file by selecting the "Open" option.

Remove the component, make sure the component is selected, right-click on the component, and select the Remove option.

Loading and saving components

To load a component from a file, right-click the target symbol, select the "Open" option, and then select your symbol to save the file. JMeter will load all the components in the file.

To save the tree symbol, right-click on a component and select Save option. JMeter will save the selected component, plus all the following sub-components. In this way, you can save a section of the test tree, individual components, or the entire test plan.

Run a test plan

Run a test plan and select Start from the Run menu item. Stop your test plan and select "Stop" from the same menu.

Thread Group

A thread group is the starting point for any test plan. All the components in the test plan are in one thread group.

As the name suggests, the thread group controls a set of threads that JMeter use to perform your tests, and you can do the following:

    • Control Thread Group
    • Set the number of threads
    • Setting the ramp-up cycle
    • Set the number of cycles to test execution

Each thread executes the test plan completely and independently without affecting other threads. Multithreading can be used to simulate concurrent connections to your server programs.

Ramp-up period tells JMeter how long it takes to "ramp-up" to load all the threads, if 30 threads are used, and ramp-up period is 120 seconds, then JMeter will take 120 seconds to make all 30 threads run, Each thread will start 4 seconds after the last thread starts. Delay time =ramp-up period time/number of threads

By default, a thread group is set to an unqualified loop. You can set the number of thread group loops, and if set to one time, then JMeter will execute the test once and then stop.

Controllers

JMeter has two kinds of controller:samplers and logical Controllers

Samplers informs JMeter to send the request to the server. For example, if you want to jmeter send an HTTP request, add an HTTP Sampler. Of course you can also customize a request to add one or more configuration Elements in sampler.

Logical controllers enables you to customize the logic of JMeter sending requests. For example, you can add a interleave Logic controller to control the alternating use of two HTTP Request samplers. Similarly, a specific logic controller, as modification Manager, allows you to modify the results of the request.

Samplers

Sampler informs JMeter to send the request to the server side. JMeter now has the following samplers:

    • FTP Request
    • HTTP Request
    • JDBC Request
    • Java Object Request
    • LDAP Request
    • Soap/xml-rpc Request
    • Web Service (SOAP) Request (Alpha Code)

Each sampler has some properties that can be set. You can also add configuration elements in a sampler to make more settings. Of course, it is important to note that JMeter sends requests in the order in which they are added in the tree.

If you want to send multiple concurrent request of the same kind, such as HTTP request, to the same server. Consider using a defaults Configuration Element. Each controller has one or more default elements.

Listeners provides access to the information gathered during the JMeter run. The simplest listener,graph Results listener diagram shows the response time. Listeners provides a graphical way to view the data generated during the JMeter operation.

In addition, listeners is able to directly store the collected data in a file for later use. Any listener has a domain that sets the storage address of the file.

Listener can be added to any location in the test. They will only collect data from the same level and all low-grade elements.

Using JMeter under Windows

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.