Load Testing with JMeter and JMeter Plugins- PerfMon Server Agent

By using the JMeter and JMeter Plugins, we test the load of the application step by step.

Plugins for JMeter-

Jmeter Has the following plugins as Standard Set, PerfMon Agent to use with Standard Set, Extras Set, Extras with Libs Set, WebDriver Set, Hadoop Set.

Basically, the JP@GC set contains two types of plugins: graph plugins and JMeter functionality extensions.

  • Download the JMeter Plugin from the Jmeter. 
  • After Downloading the extract the zip file.
  • Copy the library of the plugins and paste into the JMeter – lib>ext>paste .
  • Now Start the server Agent by click on the startAgent.

Start 0

Plugin 01

Let’s move on…..

1. Add the Thread Group-

Test_Plan.1

Add Thread 2

  • Number of Threads: 50 (Number of users to hit on website)
  • Ramp-Up Period: 50 (After 1 sec next user is hit on the server)
  • Loop Count: 1 (Number of time to execute this plan)

Thread Group 22. Add the Http Request-

  • Right-click on Thread Group> Add >Sampler> HTTP Request
  • Now enter the url on which page you want to test the load. 

Http Request 3

3. Add the Listener:

  • To show the Result in the table and graph format we use the listener.
  • Right-click on Thread Group> Add >Listener>……..

Listener 4

4. After adding the listener now save the test plan. Click on the start button to test the load on the application.

5. After completing the Test, you can see the result in the below graph and report.what is the status of our application.

6. Aggregate Report-

Here you can see the report of the tested application.

Aggregate Report

7. Aggregate Graph-

Aggregate Graph

8. Summary Report-

Summary Report

Label – The label of the sample.
Samples – The number of samples with the same label
Average – The average time of a set of results
Median – The Median is the time in the middle of a set of results. 50% of the samples took no more than this time; the remainder took at least as long.
90% Line – 90% of the samples took no more than this time. The remaining samples at least as long as this. (90 th percentile)
Min – The shortest time for the samples
Max – The longest time for the samples
Error % – Percent of requests with errors

Throughput – the Throughput is measured in requests per second/minute/hour. The time unit is chosen so that the displayed rate is at least 1.0. When the throughput is saved to a CSV file, it is expressed in requests/second, i.e. 30.0 requests/minute is saved as 0.5.

Kb/sec – The throughput measured in Kilobytes per second

9. View Result Tree –

View Results Tree

10. View Result in Table-

View Results in Table

11. Graph Result-

Graph Results

Data – plot the actual data values
Average – plot the Average
Median – plot the Median (midway value)
Deviation – plot the Standard Deviation (a measure of the variation)
Throughput – plot the number of samples per unit of time

Black: The total number of current samples sent.
Blue: The current average of all samples sent.
Red: The current standard deviation.
Green: Throughput rate that represents the number of requests per minute the server handled

To analyze the performance of the web server under test, you should focus on 2 parameters

  • Throughput
  • Deviation

High Throughput: better is the server performance
Low Deviation: better
 is the server performance

12. jp@gc – Active Threads Over Time

It is showing how many active threads are there in each thread group during test run.

jp@gc - Active Threads Over Time

13. jp@gc – Bytes Throughput Over Time

This graph will display the amount of bytes sent and received by JMeter during the load test-

jp@gc - Bytes Throughput Over Time

14. jp@gc – Composite Graph

jp@gc - Composite Graph

15. jp@gc – Hits per Second

This graph shows the number of transactions per second for each sampler. It counts for each seconds the number of finished transactions.

jp@gc - Hits per Second

16. jp@gc – PerfMon Metrics Collector

jp@gc - PerfMon Metrics Collector

17. jp@gc – Response Codes per Second

This graph will display the response code per second returned during the test.

jp@gc - Response Codes per Second

18. jp@gc – Response Latencies Over Time

A latency is the duration between the end of the request and the beginning of the server response.This graph will display the response latencies during the load test-

jp@gc - Response Latencies Over Time

19. jp@gc – Response Times Over Time

This graph will display for each sampler the average response time in milliseconds

jp@gc - Response Times Over Time

20. jp@gc – Response Times vs Threads

This graph shows how Response Time changes with amount of parallel threads. Naturally, server takes longer to respond when a lot of users requests it simultaneously. This graph visualizes such dependencies.

jp@gc - Response Times vs Threads

21. jp@gc – Transactions per Second

This graph shows the number of transactions per second for each sampler. It counts for each seconds the number of finished transactions.

jp@gc - Transactions per Second22. Response Time Graph

Response Time Graph

 

^^^^^^^^^^^^^^^^^^^^^COMPLETED^^^^^^^^^^^^^^^^^^^^^^
Please share your views—

Advertisements

JMeter Interview Basic Question Answers

1.What is JMeter?

Ans: JMeter is an Open Source testing software.It is 100% pure Java application for load and performance testing.

2. How JMeter Works?

Ans: JMeter sends the no of request to the target server and returns the statistics that show the performance/functionality of the target server/application via tables, graphs, etc.

3. What is the difference between the Test Plan and Workbench?

Test Plan: where the real test plan is saved.
Workbench: It simply provides a place to temporarily store test elements. When you save your test plan, Workbench items are not saved with it.

4. How many types of controller in Jmeter?

Ans: JMeter has two types of Controllers-

  1. Sampler
  2. Logic controllers

Sampler: Samplers allow JMeter to send specific types of requests to a server. They simulate a user request for a page from the target server.

Some useful samplers are −

  • HTTP Request
  • FTP Request
  • JDBC Request
  • Java Request
Logic Controllers:  Logic Controllers control the order of processing of Samplers in a Thread. 

The following list consists of all the Logic Controllers JMeter provides −

  • Simple Controller
  • Loop Controller
  • Random Controller
  • Random Order Controller
  • Throughput Controller
  • If Controller
  • While Controller
  • Switch Controller
  • ForEach Controller
  • Recording Controller

5. What is Listener in JMeter?

Ans: With the help of listeners you can view the results of Samplers in the form of tables, graphs, trees, or simple text in some log files.

JMeter provides the following types of listener −

  • Sample Result Save Configuration
  • Graph Full Results
  • Graph Results
  • Spline Visualizer
  • Assertion Results
  • View Results Tree
  • Aggregate Report
  • View Results in Table
  • Simple Data Writer
  • Monitor Results
  • Distribution Graph (alpha)
  • Aggregate Graph
  • Mailer Visualizer
  • BeanShell Listener
  • Summary Report

6. What is timer in JMeter?

Ans: JMeter thread sends requests without pausing between each sampler. Here you can add a timer as per your requirement which allows you to define a period to wait between each request.

JMeter provides the following types of timers −

  • Constant Timer
  • Gaussian Random Timer
  • Uniform Random Timer
  • Constant Throughput Timer
  • Synchronizing Timer
  • JSR223 Time
  • BeanShell Time
  • BSF Time
  • Poisson Random Time

7. What is the assertion in the Jmeter?

Ans: It allow you to include some validation test on the response of your request made using a Sampler. Using assertions you can prove that your application is returning the correct data. JMeter highlights when an assertion fails.

The following list consists of all the assertions JMeter provides −

  • Beanshell Assertion
  • BSF Assertion
  • Compare Assertion
  • JSR223 Assertion
  • Response Assertion
  • Duration Assertion
  • Size Assertion
  • XML Assertion
  • BeanShell Assertion
  • MD5Hex Assertion
  • HTML Assertion
  • XPath Assertion
  • XML Schema Assertion

 8. What is the configuration elements in the JMeter?Ans:Configuration Elements allow you to create defaults and variables to be used by Samplers. They are used to add or modify requests made by Samplers. Configuration Element is accessed only from inside the branch where it is placed.

JMeter provides the following Configuration Elements −

  • Counter
  • CSV Data Set Config
  • FTP Request Defaults
  • HTTP Authorization Manager
  • HTTP Cache Manager
  • HTTP Cookie Manager
  • HTTP Proxy Server
  • HTTP Request Defaults
  • HTTP Header Manager
  • Java Request Defaults
  • Keystore Configuration
  • JDBC Connection Configuration
  • Login Config Element
  • LDAP Request Defaults
  • LDAP Extended Request Defaults
  • TCP Sampler Config
  • User Defined Variables
  • Simple Config Element
  • Random Variable

9. What is the difference between throughput and the deviation?

Throughput: 
The Throughput is the most important parameter. It represents the ability of the server to handle heavy load.  The higher the Throughput is, the better is the server performance.

For example– Throughput of Google server is 1,491.193/minute. It means Google server can handle 1,491.193 requests per minute. This value is quiet high so we can conclude that Google server has good performance.

Deviation: a measure of the variation

High Throughput: better is the server performance
Low Deviation: better
 is the server performance

 

 

How to setup the environment for JMeter

1. Need Java Installation-

  • 1st requirement for JMeter to install the java in your machine.
  • Download the JDK and install in your machine.
  • To check that JDK is installed in your system or not
    – Window- c:\> java –version
    – Linux- $ java -version

2. Download JMeter

3. Now start the work with JMeter

  • For Windows – To run the jmeter.bat file from the bin folder.
  • For Linux – To run the jmeter.sh file from the bin folder.

After run the file it should be shown like as-

Test Plan 1

*********Now enjoy the load and performance testing with JMeter**********

How to use the Recording Controller in Jmeter to record the test script

Using the JMeter HTTP(S) Test Script Recorder:

By using the Recording Controller we can easily record the website navigation script and use it for the load testing. Now we see that step by step how you can use it-

Step 1: Need below software

Apache JMeter – Download and run the .bat/.sh file from the bin folder. (.bat for window & .sh for Linux)

Java 6 or later – Download and proper installation of Java.

Mozilla Firefox – Download and proper installation of Mozilla.

Step 2: Run the .bat/.sh file from the bin folder.

Step 3: Now build a test plan

  • Add the Thread Group to Test Plan
    Right-click on Test Plan > Add > Threads (Users)

Test Plan 1

Add Thread Group 2

Number of Threads– Total number of users which we want to hit on the server.
For example: – here we will hit the 10 users at a time on the server.

Ramp-Up Period– Time given the next user to hit on the server.
For example: – Suppose we have 10 users (Number of Thread) and Ramp up period is 10. Then we are giving each user 1 second to hit the server.

Loop Count– We want to execute the same operation two times continuously then we need to increase the loop count as 1. It means 10 people will hit the server one time.

Add Thread Group 3

Step 4: Add the Recording Controller

  • Right-click on Thread Group > Add > Logic controller > Recording Controller

Recording Controller  4

Step 5: Add HTTP Request Defaults

  • Right Click on Workbench –> Add–> Config Elements –> HTTP Request Defaults
  • We are added the HTTP Request Defaults causes we will send the multiple request to the same web server.

Http Request default 5

HTTP Request Defaults contain the two important parts-

  1. Server Name or IP
  2. Port Number

Server Name or IP: Enter the url or IP address of the site on which you want to perform the load testing.

Port Number: Enter the default port number 8080.

Http Request default 6

Step 6: Add HTTP Test Script Recorder 

  • Right Click on Workbench–> Add–> Non-Test Elements –> HTTP Test Script Recorder.

Proxy server 7

Port: Fill the 9090 sometimes 8080 port is busy.

Target Controller:  Add the place where you want to record the script. Here we choose –use recording controller.

URL Pattern to Include/Exclude: When the page is loaded then images are loaded, some are restricted so allow the all. URL Patterns to Include”. This will create a blank entry.

Proxy server 8

Step 7: Setting of the browser proxy

  1. Open Firefox Browser.
  2. Click on Tools shown at the top menu.
  3. Click on Options shown under Tools
  4. Click on Network tab shown on the window after clicking Options.
  5. Click on Settings Button.

Mozila

Mozila 1

6. Click on Manual proxy configuration
7. Enter localhost and Port 9090.

Mozila 2

Mozila 3

8. Click ok button.

Step 8: Installation of the CA Certificate in the browser-

  • When you click on the start button on the HTTP(S) Test Script Recorder then the below screen is appeared-

Certificate 10

  • Click on the ok button.
  • Open the Mozilla Browser.
  • Go to the tools > Option > Advanced > encryption > View certificate

Certificate 11

  • Click on the view certificates then below screen appear-

Certificate 12

  • Click on the import button and go to the bin folder and install the CA certificate-

Certificate 13

  • View the certificate and select the check box and click on the ok button.
  • Click the all ok button.

Step 9: Now Record the Script

  •  Now enter the url in the browser and navigate the screen according you.
  • After completion the navigation stop the recording from the HTTP Test Script Recorder.

Step 10: Add the Listener

Listerner14

Step 11: Now save the Test Plan

Sve 15

Step 12: Now Run the Test Plan

Start run 16

Step 13: After completed the process check the result-

  •  Aggregate Graph

Aggregate Graph 17

  • Aggregate Report

Aggregate Report 18

  • Graph Result

Graph Results 19

  • Summary Report

Summary Report 20

*************************************E*N*D***********************************

Please share your views….

How to Use Apache JMeter To Perform Load Testing on your web application

Performance and Load testing with Jmeter

Here we will perform the load and stress testing with the help of Jmeter on the web application. Here we apply the concurrent no of user on the web application and check the performance of the application. First of all we create the testing environment-

Now create the environment as step by step-

Step 1: Need below software

  • Apache JMeter – Download and run the .bat/.sh file from the bin folder.(.bat for window & .sh for Linux)
  • Java 6 or later – Download and proper installation of Java.

 Step 2: Add the Thread Group to Test Plan

  •  Right-click on Test Plan> Add > Threads (Users)

Test plan

Add Thread Group

Thread Group Thread Group -1

  • Number of Threads: 100 (Number of users to hit on website)
  • Ramp-Up Period: 100 (After 1 sec next user is hit on the server)
  • Loop Count: 1 (Number of time to execute this plan)

Thread Group -2

we have 100 users and a 100 second Ramp-Up period, then the delay between starting users would be 1 second (100 users /100 seconds)

Step 3: Add the HTTP Request Default

  • Right-click on Thread Group> Add > Config Element> HTTP Request Defaults
  • Enter the server Name or IP on which site you want to test the load and performance with the concurrent users.

HTTP Request Default
Step 4: Add the HTTP Request

  • Right-click on Thread Group> Add >Sampler> HTTP Request
  • Now enter the url on which page you want to navigate. 

HTTP RequestStep 5: Add the Listener as you want-

  • Aggregate Graph
  • Aggregate Report
  • View Result Tree
  • View Result in Table
  • Graph Result

 Step 6: Now save the Test Plan and Run it.

Save

RunStep 7: Now view the result from the listener-

Aggregate Graph
 Aggregate Graph

Aggregate Report-
 Aggregate Report

View Result Tree-

View Results Tree

View Result in Table-
 View Results in Table

Graph Result-

Graph Result

**************************************Complete*******************************

This article is useful for you …..