HeliosDB Load Testing Framework
HeliosDB Load Testing Framework
Comprehensive load testing and chaos engineering framework for Phase 2 Milestone 1 validation.
Features
- Concurrent Load Testing: 1K, 10K, 100K concurrent requests
- Chaos Engineering: Failure injection (node failures, partitions, disk full, etc.)
- Performance Metrics: Latency percentiles (P50, P95, P99), throughput, error rates
- Comprehensive Reporting: Terminal, HTML, and JSON reports
- Feature-Specific Tests: All 8 Phase 2 M1 features tested
Quick Start
# Run a quick smoke testcargo run --bin load-test smoke
# Run 1K concurrent users load test (60 seconds)cargo run --bin load-test load --level 1k --duration 60
# Run 10K concurrent users load test (120 seconds)cargo run --bin load-test load --level 10k --duration 120
# Run 100K concurrent users load test (300 seconds)cargo run --bin load-test load --level 100k --duration 300
# Run chaos engineering testscargo run --bin load-test chaos --scenarios all
# Run specific chaos scenariocargo run --bin load-test chaos --scenarios node
# Run full test suitecargo run --bin load-test fullUsage
Load Testing
# Basic load testcargo run --bin load-test load --level 1k
# Custom configurationcargo run --bin load-test load \ --level 1k \ --duration 120 \ --users 1000 \ --mode mixed
# Test modes:# - read: Read-only queries# - write: Write-only operations# - mixed: 70% reads, 30% writes# - complex: Complex queries (joins, aggregations)Chaos Engineering
# Run all chaos scenarioscargo run --bin load-test chaos --scenarios all
# Run specific scenariocargo run --bin load-test chaos --scenarios nodecargo run --bin load-test chaos --scenarios partitioncargo run --bin load-test chaos --scenarios diskcargo run --bin load-test chaos --scenarios memorycargo run --bin load-test chaos --scenarios slowcargo run --bin load-test chaos --scenarios connectioncargo run --bin load-test chaos --scenarios cpucargo run --bin load-test chaos --scenarios cascadeReport Generation
# Generate terminal reportcargo run --bin load-test report --input ./load-test-results/report-20251031-200000.json
# Generate HTML reportcargo run --bin load-test report \ --input ./load-test-results/report-20251031-200000.json \ --format html
# View JSON reportcargo run --bin load-test report \ --input ./load-test-results/report-20251031-200000.json \ --format jsonChaos Scenarios
| Scenario | Description | Expected Behavior |
|---|---|---|
| Node Failure | Kill 1-3 nodes randomly | Automatic failover within 5 minutes |
| Network Partition | Split cluster into partitions | Partition tolerance, eventual consistency |
| Disk Full | Simulate storage exhaustion | Graceful degradation, alerts triggered |
| Memory Pressure | Force OOM conditions | Memory management, swap usage |
| Slow Dependency | Inject 500-2000ms latency | Request timeout, retry logic |
| Connection Loss | Drop database connections | Connection pool recovery |
| CPU Saturation | Saturate CPU to 95%+ | Resource throttling, queue management |
| Cascading Failure | Trigger chain of failures | Circuit breakers, isolation |
Performance Targets
1K Concurrent Users
- Success Rate: ≥99.9%
- P99 Latency: <100ms
- Throughput: ≥1,000 req/s
10K Concurrent Users
- Success Rate: ≥99.9%
- P99 Latency: <500ms
- Throughput: ≥10,000 req/s
100K Concurrent Users
- Success Rate: ≥99%
- P99 Latency: <2000ms
- Throughput: ≥50,000 req/s
Report Formats
Terminal Report
Colored, formatted output to terminal with key metrics.
HTML Report
Comprehensive HTML report with:
- Performance metrics table
- Chaos engineering results
- Visual formatting and charts
- Export-ready format
JSON Report
Machine-readable JSON format for:
- CI/CD integration
- Historical tracking
- Automated analysis
Architecture
heliosdb-load-test/├── src/│ ├── lib.rs # Library entry point│ ├── main.rs # CLI application│ ├── config.rs # Configuration types│ ├── executor.rs # Load test execution engine│ ├── metrics.rs # Performance metrics collection│ ├── scenarios.rs # Test scenarios│ ├── chaos.rs # Chaos engineering│ └── reporter.rs # Report generation├── Cargo.toml└── README.mdIntegration with CI/CD
# Run in CI pipelinecargo run --bin load-test smoke || exit 1cargo run --bin load-test load --level 1k --duration 30 || exit 1
# Check results programmaticallyif [ -f ./load-test-results/latest.json ]; then success_rate=$(jq '.metrics.error_rate' ./load-test-results/latest.json) if [ "$success_rate" -lt "0.001" ]; then echo "Success rate within SLA" else echo "Success rate below SLA" exit 1 fifiDevelopment
# Buildcargo build --release
# Run testscargo test
# Run with verbose loggingcargo run --bin load-test load --level 1k --verbose
# Clean up old reportsrm -rf ./load-test-results/*Future Enhancements
- Real database integration (currently simulated)
- Distributed load generation across multiple machines
- Real-time monitoring dashboard
- Automated performance regression detection
- Cloud provider integration (AWS, Azure, GCP)
- Custom scenario DSL for complex workflows
License
Copyright © 2025 HeliosDB. All rights reserved.