Skip to content

Repository for conducting performance tests using Apache JMeter to analyze scalability, stress, and load capacity of web applications.

Notifications You must be signed in to change notification settings

adityadwic/JMETER-performance-test

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

2 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

JMeter Web Performance Testing Portfolio

This project contains performance testing scripts using Apache JMeter for various testing scenarios. This portfolio demonstrates comprehensive capabilities in designing and executing performance tests.

πŸ“‹ Table of Contents

πŸš€ Installation

Prerequisites

  • Java 8 or higher
  • Apache JMeter 5.5 or higher

Download JMeter

# Download JMeter
wget https://downloads.apache.org//jmeter/binaries/apache-jmeter-5.6.3.zip
unzip apache-jmeter-5.6.3.zip
cd apache-jmeter-5.6.3/bin

πŸ“ Project Structure

jmeter-web-performance-test/
β”œβ”€β”€ test-plans/
β”‚   β”œβ”€β”€ api-load-test.jmx           # Load testing for API
β”‚   β”œβ”€β”€ web-stress-test.jmx         # Stress testing for web application
β”‚   β”œβ”€β”€ spike-test.jmx              # Spike testing
β”‚   └── endurance-test.jmx          # Endurance/Soak testing
β”œβ”€β”€ test-data/
β”‚   β”œβ”€β”€ user-credentials.csv        # User data for testing
β”‚   └── test-scenarios.csv          # Testing scenarios
β”œβ”€β”€ results/
β”‚   β”œβ”€β”€ load-test-results/          # Load testing results
β”‚   β”œβ”€β”€ stress-test-results/        # Stress testing results
β”‚   └── reports/                    # HTML reports
β”œβ”€β”€ scripts/
β”‚   β”œβ”€β”€ run-load-test.sh           # Script to run load test
β”‚   β”œβ”€β”€ run-stress-test.sh         # Script to run stress test
β”‚   β”œβ”€β”€ run-spike-test.sh          # Script to run spike test
β”‚   β”œβ”€β”€ run-endurance-test.sh      # Script to run endurance test
β”‚   └── generate-report.sh         # Script to generate report
└── README.md

πŸ§ͺ Test Scenarios

1. Load Testing (api-load-test.jmx)

  • Purpose: Test application performance under normal load conditions
  • Virtual Users: 50-100 users
  • Duration: 10 minutes
  • Ramp-up: 2 minutes
  • Target: API endpoints

2. Stress Testing (web-stress-test.jmx)

  • Purpose: Determine application breaking point
  • Virtual Users: 200-500 users
  • Duration: 15 minutes
  • Ramp-up: 5 minutes
  • Target: Web application

3. Spike Testing (spike-test.jmx)

  • Purpose: Test handling of sudden traffic spikes
  • Virtual Users: 10 β†’ 200 β†’ 10 users
  • Duration: 10 minutes
  • Pattern: Sudden spike and recovery

4. Endurance Testing (endurance-test.jmx)

  • Purpose: Test long-term stability
  • Virtual Users: 50 users
  • Duration: 60 minutes
  • Focus: Memory leaks, performance degradation

πŸƒβ€β™‚οΈ How to Run

Running Tests via GUI

# Open JMeter GUI
./jmeter.sh

# Load test plan from test-plans/ folder
# Run test and view results in View Results Tree

Running Tests via Command Line

# Load Test
./scripts/run-load-test.sh

# Stress Test
./scripts/run-stress-test.sh

# Spike Test
./scripts/run-spike-test.sh

# Endurance Test
./scripts/run-endurance-test.sh

# Generate HTML Report
./scripts/generate-report.sh

Command Line Details

# Example of running load test
jmeter -n -t test-plans/api-load-test.jmx -l results/load-test-results.jtl -e -o results/reports/load-test-report/

# Parameters:
# -n: non-GUI mode
# -t: test plan file
# -l: result file (.jtl)
# -e: generate report
# -o: output folder for report

πŸ“Š Test Results

jmeter-performance-report

Metrics Monitored

  • Response Time: Average, 90th, 95th, 99th percentile
  • Throughput: Requests per second
  • Error Rate: Percentage of failed requests
  • Resource Utilization: CPU, Memory, Network

Acceptance Criteria

  • Response time < 2 seconds for 95% of requests
  • Error rate < 1%
  • Minimum throughput of 100 requests/second
  • No memory leaks during endurance test

πŸ›  Technologies

  • Apache JMeter 5.6: Performance testing tool
  • Java: Runtime environment
  • CSV: Test data format
  • HTML: Report generation
  • Shell Scripts: Automation scripts

🎯 Test Applications

Tests are performed against:

πŸ“ˆ Sample Results

Load Test Results

  • Average Response Time: 245ms
  • 95th Percentile: 890ms
  • Throughput: 245.6 req/sec
  • Error Rate: 0.12%

Stress Test Results

  • Breaking Point: 350 concurrent users
  • Max Response Time: 5.2 seconds
  • Error Rate at Peak: 2.8%

πŸ“Š Understanding Test Reports

HTML Report Structure

After running tests, JMeter generates comprehensive HTML reports with multiple sections:

1. Dashboard Overview

  • Test Summary: Total samples, success rate, error rate
  • APDEX (Application Performance Index): User satisfaction score
  • Statistics: Key metrics at a glance
  • Error Rate Over Time: Visual trend of failures

2. Charts Section

  • Response Times Over Time: Performance trends during test execution
  • Active Threads Over Time: User load visualization
  • Bytes Throughput Over Time: Data transfer rates
  • Latencies Over Time: Network latency trends
  • Connect Time Over Time: Connection establishment performance

3. Statistics Table

Detailed metrics for each HTTP request:

  • Sample Count: Number of executions
  • Average/Min/Max: Response time statistics
  • Std. Dev: Response time consistency
  • Error %: Failure rate per request
  • Throughput: Requests per second
  • Received/Sent KB/sec: Data transfer rates

4. Error Analysis

  • Errors: Complete list of all failures
  • Top 5 Errors by Sampler: Most frequent failures
  • Error Details: Stack traces and error messages

Report Access Methods

Method 1: Automatic Report Generation

# Reports are automatically generated when using scripts
./scripts/run-load-test.sh
# Opens browser automatically on macOS

Method 2: Generate from Existing Results

# Generate report from .jtl file
./scripts/generate-report.sh
# Select from available result files

Method 3: Manual JMeter Command

# Generate HTML report manually
jmeter -g results/load-test-20241201_143022.jtl -o results/reports/my-report/

Key Performance Indicators (KPIs)

Response Time Analysis

  • Average Response Time: Overall system performance
  • 90th Percentile: 90% of users experience this or better
  • 95th Percentile: Performance experienced by most users
  • 99th Percentile: Worst-case scenarios for most users

Throughput Metrics

  • Requests/Second: System capacity
  • Transactions/Second: Business operation rate
  • Bytes/Second: Network utilization

Error Analysis

  • Error Rate %: System reliability
  • Error Distribution: Failure patterns
  • Error Types: Root cause analysis

Sample Report Interpretation

βœ… Good Performance Indicators

Average Response Time: < 1 second
95th Percentile: < 2 seconds
Error Rate: < 1%
Throughput: > Target capacity

⚠️ Warning Signs

Average Response Time: 1-3 seconds
95th Percentile: 2-5 seconds
Error Rate: 1-5%
Declining throughput over time

❌ Performance Issues

Average Response Time: > 3 seconds
95th Percentile: > 5 seconds
Error Rate: > 5%
Memory leaks (increasing response time)

Report File Locations

results/
β”œβ”€β”€ reports/
β”‚   β”œβ”€β”€ load-test-report-20241201_143022/
β”‚   β”‚   β”œβ”€β”€ index.html              # Main dashboard
β”‚   β”‚   β”œβ”€β”€ content/
β”‚   β”‚   β”‚   β”œβ”€β”€ js/dashboard.js     # Interactive charts
β”‚   β”‚   β”‚   └── css/dashboard.css   # Styling
β”‚   β”‚   └── statistics.json         # Raw data
β”‚   β”œβ”€β”€ stress-test-report-20241201_150000/
β”‚   └── spike-test-report-20241201_153000/

Report Sharing and Analysis

For Stakeholders

  • Share index.html file or host on web server
  • Focus on Dashboard and key metrics
  • Provide executive summary with KPIs

For Technical Teams

  • Analyze detailed statistics tables
  • Review error logs and patterns
  • Examine resource utilization trends
  • Compare multiple test runs

For Performance Optimization

  • Identify slowest requests
  • Analyze error spike patterns
  • Monitor resource bottlenecks
  • Track improvement over time

πŸ“– For detailed report examples and analysis guide, see TEST_REPORTS.md

πŸ”§ Customization

Editing Test Parameters

  1. Open .jmx files in JMeter GUI
  2. Modify Thread Group properties:
    • Number of Threads (Virtual Users)
    • Ramp-up Period
    • Loop Count or Duration
  3. Update HTTP Request samplers according to target application

Adding Test Data

  1. Edit CSV files in test-data/ folder
  2. Update CSV Data Set Config in test plan
  3. Reference variables in HTTP requests

🀝 Contributing

  1. Fork repository
  2. Create feature branch (git checkout -b feature/new-test-scenario)
  3. Commit changes (git commit -am 'Add new test scenario')
  4. Push to branch (git push origin feature/new-test-scenario)
  5. Create Pull Request

β€πŸ’» Author

Aditya Dwi Cahyono


Performance testing is not just about finding bottlenecks, it's about understanding your application's behavior under various conditions.

About

Repository for conducting performance tests using Apache JMeter to analyze scalability, stress, and load capacity of web applications.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages