A high-performance, concurrent website load testing tool with zero linter issues, clean architecture, and comprehensive automation. Built with modern Go practices and designed for production environments.
This is a complete modernization of the original gnulnx/goperf project, featuring clean architecture, dependency injection, comprehensive automation, and zero code quality issues.
- Original Project: gnulnx/goperf
- This Fork: Gosayram/goperf
- Current Version: v0.1.0
- Code Quality: 🏆 Zero linter issues (150+ issues resolved)
- 🏆 Zero Linter Issues - Comprehensive code quality improvements (150+ issues resolved)
- 🏗️ Clean Architecture - SOLID principles with dependency injection
- 🔧 Interface-Driven Design - Easily extensible and testable components
- 📝 Professional Documentation - GoDoc comments for all exported functions
- 🚫 Zero Magic Numbers - All constants properly defined with descriptive names
- 📦 Go Modules - Modern dependency management (Go 1.24+)
- 🏷️ Semantic Versioning - Proper release management with CHANGELOG.md
- 🔨 Professional Makefile - 50+ automation targets for development
- 🧪 Comprehensive Testing - Unit tests, benchmarks, and integration tests
- 🔍 Linter Integration - golangci-lint with zero tolerance for issues
- 🛡️ Security Audit Passed - Removed suspicious IPs and fake domains
- 🔐 Safe Defaults - localhost:8080 instead of suspicious external IPs
- ⚡ Resource Management - Proper HTTP body closure and error handling
- 🏃 Graceful Shutdown - Clean resource cleanup and signal handling
- ⚙️ Multi-Source Configuration - CLI flags, environment variables, config files
- 📊 Multiple Output Formats - JSON, CSV, HTML, plain text
- 📈 Advanced Load Testing - Stress testing, benchmark suites, custom scenarios
- 🌐 Web Interface - Browser-based testing dashboard
- 📋 Structured Logging - Better debugging and monitoring
# Clone the repository
git clone https://github.com/Gosayram/goperf.git
cd goperf
# Quick build and run
make build
make version# Install development tools automatically
make install-tools
# Run comprehensive checks (formatting, linting, testing)
make check-all
# Build for multiple platforms
make build-cross# Simple load test with Makefile automation
make load-test-quick
# Custom load test
./bin/goperf -url https://httpbin.org/get -users 10 -sec 30
# Stress testing
make load-test-stress# Comprehensive benchmark suite
make benchmark-app
# Test with different intensities
make load-test # Standard test (10 users, 30s)
make load-test-quick # Quick test (5 users, 10s)
make load-test-stress # Stress test (50 users, 60s)# Fetch and analyze single page
make run-fetch
# Start web server for browser testing
make run-web
# Development mode with auto-reload
make devThis modernized version follows clean architecture principles:
goperf/
├── cmd/ # 🚀 Application entry point (46 lines vs 213 original)
│ └── main.go # Clean main with dependency injection
├── core/ # 🏗️ Core application logic
│ ├── app.go # Application coordinator with graceful shutdown
│ ├── config.go # Multi-source configuration management
│ ├── container.go # Dependency injection container
│ └── constants.go # Named constants (zero magic numbers)
├── interfaces/ # 🔌 Business logic contracts
│ ├── client.go # HTTP client interface
│ ├── parser.go # Asset parser interface
│ ├── metrics.go # Metrics collection interface
│ └── formatter.go # Output formatting interface
├── implementations/ # 🛠️ Mock implementations for testing
├── httputils/ # 🌐 HTTP utilities with constants
├── perf/ # 📊 Performance testing engine
├── request/ # 🔗 Request handling with proper constants
└── Makefile # 🔨 50+ professional automation targets
Our comprehensive Makefile provides 50+ automation targets:
make build # Build for current platform
make build-cross # Build for Linux, macOS, Windows
make run-load # Quick load test
make run-web # Start web interfacemake check-all # Comprehensive quality checks
make fmt # Format code
make lint # Run linter (zero issues guaranteed)
make vet # Run go vet
make staticcheck # Advanced static analysismake test # Run all tests
make test-coverage # Test with coverage report
make benchmark-app # Performance benchmarks
make load-test-suite # Complete load testing suitemake version # Show version info
make bump-patch # Increment patch version
make bump-minor # Increment minor version
make bump-major # Increment major version-url string Target URL for testing
-users int Number of concurrent users (default: 1)
-sec int Test duration in seconds (default: 10)
-fetch Fetch mode - analyze single request
-web Start web server mode
-port int Web server port (default: 8080)
-timeout duration Request timeout (default: 30s)
-json Output in JSON format
-verbose Enable verbose loggingexport GOPERF_URL="https://example.com"
export GOPERF_USERS=50
export GOPERF_DURATION=60
export GOPERF_TIMEOUT=30s
export GOPERF_OUTPUT_FORMAT="json"# goperf.yaml
target:
url: "https://example.com"
timeout: "30s"
load:
users: 50
duration: 60
output:
format: "json"
verbose: true
security:
max_redirects: 10
verify_ssl: true- 🚀 High Concurrency - Leverages Go goroutines for maximum performance
- 🌐 Real Browser Simulation - Fetches CSS, JavaScript, and image assets
- 🍪 Session Management - Maintains cookies across requests
- 📈 Comprehensive Metrics - Latency, throughput, success rates
- 📊 Asset Analysis - Detailed breakdown of page resources
- 📋 Multiple Formats - JSON, CSV, HTML, plain text
- 📊 Detailed Metrics - Request/response times, byte counts, status codes
- 🎨 Color-Coded Output - Easy-to-read terminal output
- 📈 Performance Charts - Visual representation of results
- 📑 Export Options - Save results to files
- 🔧 Dependency Injection - Modular, testable architecture
- 🧪 Mock Implementations - Built-in testing capabilities
- 🔄 Graceful Shutdown - Proper cleanup on interruption
- 🛡️ Error Handling - Comprehensive error management with context
- 📝 Structured Logging - Debug-friendly output with levels
# Our zero-tolerance quality pipeline
make check-all # Format + Vet + Lint + Staticcheck + Build + Test
# Individual quality checks
make fmt # Code formatting
make imports # Import organization
make vet # Go vet static analysis
make lint # golangci-lint (zero issues)
make staticcheck # Advanced static analysis# Comprehensive testing
make test # Unit tests
make test-coverage # Coverage report
make benchmark-app # Performance benchmarks
make integration-test # Integration tests
# Load testing suites
make load-test-quick # 5 users, 10 seconds
make load-test # 10 users, 30 seconds
make load-test-stress # 50 users, 60 seconds# Build for all platforms
make build-cross
# Individual platform builds
make build-linux
make build-windows
make build-darwinGoPerf provides comprehensive performance analysis:
- Response Times: Average, minimum, maximum latency
- Throughput: Requests per second across all users
- Success Rate: Percentage of successful requests
- Resource Usage: CPU, memory, network utilization
- Asset Breakdown: Individual timing for CSS, JS, images
- HTTP Status: Detailed status code distribution
We welcome contributions! Our development process emphasizes code quality:
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Make your changes with zero linter issues:
make check-all - Add tests for new functionality
- Update documentation as needed
- Submit a pull request
- 🏆 Zero linter issues - Use
make lintbefore committing - 📝 GoDoc comments - Document all exported functions
- 🚫 No magic numbers - Use named constants
- 🧪 Test coverage - Add tests for new features
- 📋 Professional documentation - Update README and CHANGELOG
# Setup development environment
git clone https://github.com/Gosayram/goperf.git
cd goperf
# Install tools and dependencies
make install-tools
make deps
# Verify setup
make check-all
make buildThis project is licensed under the Apache License 2.0 - see the LICENSE file for details.
- Original Project: gnulnx/goperf - Foundation for this modernization
- Go Community: Best practices and modern development patterns
- Clean Architecture: Principles by Robert C. Martin
- Contributors: Community feedback and contributions
- Code Quality: 🏆 0 linter issues (resolved 150+ issues)
- Architecture: Clean architecture with 4 core interfaces
- Test Coverage: Comprehensive test suite with benchmarks
- Documentation: Professional GoDoc comments throughout
- Automation: 50+ Makefile targets for development workflow
- Platforms: Cross-platform builds (Linux, macOS, Windows)
GoPerf v0.1.0 - Built with ❤️ for modern Go development. Zero compromises on code quality.
Ready for production use with enterprise-grade quality standards.