diff --git a/src/Plugin.php b/src/Plugin.php index 969e48f..6f879d2 100644 --- a/src/Plugin.php +++ b/src/Plugin.php @@ -45,11 +45,11 @@ public function handleArguments(array $arguments): array $domain = $arguments[2]; - $duration = 10; + $run = stress($domain); foreach ($arguments as $argument) { if (str_starts_with($argument, '--duration=')) { - $duration = (int) str_replace('--duration=', '', $argument); + $run->duration((int) str_replace('--duration=', '', $argument)); } } @@ -57,14 +57,10 @@ public function handleArguments(array $arguments): array foreach ($arguments as $argument) { if (str_starts_with($argument, '--concurrency=')) { - $concurrency = (int) str_replace('--concurrency=', '', $argument); + $run->concurrently((int) str_replace('--concurrency=', '', $argument)); } } - stress($domain) - ->concurrently($concurrency) - ->for($duration) - ->seconds() - ->dd(); + $run->dd(); } }