laramint/laravel-stress
Fire-and-forget HTTP stress testing for Laravel. Runs Guzzle request pools in a background subprocess to avoid deadlocks with php artisan serve, with an in-process fallback for multi-threaded servers. Returns JSON stats (throughput, percentiles, errors).
php artisan serve) and multi-threaded (Nginx/Apache) environments, reducing friction in heterogeneous devops setups.storage/app). This could be mitigated by extending the package to support Laravel’s filesystem abstraction.php artisan stress:test). This could be extended to support custom configurations or reporting.bus:work) for distributed testing with minimal refactoring.storage/app/stress-results) would mitigate this but requires configuration.throughput) may require environment-specific calibration, particularly when testing locally (php artisan serve) vs. production (Nginx/Apache).Use Case Prioritization:
Scalability Needs:
Observability:
Security:
Authorization) be secured in test configurations (e.g., environment variables, encrypted storage)?Maintenance:
php artisan serve (fallback mode).beforeEach/afterEach hooks for stress testing.StressTest trait to PHPUnit test classes.
use LaraMint\LaravelStress\StressTestRunner;
trait StressTests {
protected $runner;
public function setUp(): void {
$this->runner = new StressTestRunner();
}
public function testApiLoad() {
$result = $this->runner->run([
'method' => 'GET',
'url' => 'http://localhost/api/users',
'count' => 100,
'concurrency' => 10,
]);
$this->assertGreaterThan(95, $result->successRate);
}
}
php artisan stress:run) to trigger background tests and poll results.// In a controller or command
$jobId = $runner->startBackground([...]);
$this->artisan('stress:wait', ['job' => $jobId]);
stress:results command to display test history or integrate with Laravel Nova/Telescope.ext-curl tuning or middleware for modern APIs).ab, hey, or k6).stress:run, stress:wait, stress:cleanup).stress:cleanup Artisan command to kill stale processes (e.g., via ps aux | grep lb_st_*).stderr/stdout to Laravel’s log channel for visibility.sys_get_temp_dir().storage/app/stress-results).How can I help you explore Laravel packages today?