This project contains performance testing scripts using Apache JMeter for various testing scenarios. This portfolio demonstrates comprehensive capabilities in designing and executing performance tests.
- Installation
- Project Structure
- Test Scenarios
- How to Run
- Test Results
- Understanding Test Reports
- Technologies
- Java 8 or higher
- Apache JMeter 5.5 or higher
# 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/binjmeter-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
- Purpose: Test application performance under normal load conditions
- Virtual Users: 50-100 users
- Duration: 10 minutes
- Ramp-up: 2 minutes
- Target: API endpoints
- Purpose: Determine application breaking point
- Virtual Users: 200-500 users
- Duration: 15 minutes
- Ramp-up: 5 minutes
- Target: Web application
- Purpose: Test handling of sudden traffic spikes
- Virtual Users: 10 β 200 β 10 users
- Duration: 10 minutes
- Pattern: Sudden spike and recovery
- Purpose: Test long-term stability
- Virtual Users: 50 users
- Duration: 60 minutes
- Focus: Memory leaks, performance degradation
# Open JMeter GUI
./jmeter.sh
# Load test plan from test-plans/ folder
# Run test and view results in View Results Tree# 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# 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- Response Time: Average, 90th, 95th, 99th percentile
- Throughput: Requests per second
- Error Rate: Percentage of failed requests
- Resource Utilization: CPU, Memory, Network
- Response time < 2 seconds for 95% of requests
- Error rate < 1%
- Minimum throughput of 100 requests/second
- No memory leaks during endurance test
- Apache JMeter 5.6: Performance testing tool
- Java: Runtime environment
- CSV: Test data format
- HTML: Report generation
- Shell Scripts: Automation scripts
Tests are performed against:
- JSONPlaceholder API (https://jsonplaceholder.typicode.com/)
- HTTPBin (https://httpbin.org/)
- ReqRes API (https://reqres.in/)
- Average Response Time: 245ms
- 95th Percentile: 890ms
- Throughput: 245.6 req/sec
- Error Rate: 0.12%
- Breaking Point: 350 concurrent users
- Max Response Time: 5.2 seconds
- Error Rate at Peak: 2.8%
After running tests, JMeter generates comprehensive HTML reports with multiple sections:
- 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
- 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
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
- Errors: Complete list of all failures
- Top 5 Errors by Sampler: Most frequent failures
- Error Details: Stack traces and error messages
# Reports are automatically generated when using scripts
./scripts/run-load-test.sh
# Opens browser automatically on macOS# Generate report from .jtl file
./scripts/generate-report.sh
# Select from available result files# Generate HTML report manually
jmeter -g results/load-test-20241201_143022.jtl -o results/reports/my-report/- 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
- Requests/Second: System capacity
- Transactions/Second: Business operation rate
- Bytes/Second: Network utilization
- Error Rate %: System reliability
- Error Distribution: Failure patterns
- Error Types: Root cause analysis
Average Response Time: < 1 second
95th Percentile: < 2 seconds
Error Rate: < 1%
Throughput: > Target capacity
Average Response Time: 1-3 seconds
95th Percentile: 2-5 seconds
Error Rate: 1-5%
Declining throughput over time
Average Response Time: > 3 seconds
95th Percentile: > 5 seconds
Error Rate: > 5%
Memory leaks (increasing response time)
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/
- Share
index.htmlfile or host on web server - Focus on Dashboard and key metrics
- Provide executive summary with KPIs
- Analyze detailed statistics tables
- Review error logs and patterns
- Examine resource utilization trends
- Compare multiple test runs
- 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
- Open .jmx files in JMeter GUI
- Modify Thread Group properties:
- Number of Threads (Virtual Users)
- Ramp-up Period
- Loop Count or Duration
- Update HTTP Request samplers according to target application
- Edit CSV files in
test-data/folder - Update CSV Data Set Config in test plan
- Reference variables in HTTP requests
- Fork repository
- Create feature branch (
git checkout -b feature/new-test-scenario) - Commit changes (
git commit -am 'Add new test scenario') - Push to branch (
git push origin feature/new-test-scenario) - Create Pull Request
Aditya Dwi Cahyono
- GitHub: @adityadwic
- LinkedIn: Aditya Dwi Cahyono
Performance testing is not just about finding bottlenecks, it's about understanding your application's behavior under various conditions.