Skip to content

Commit

Permalink
chore: improves code
Browse files Browse the repository at this point in the history
  • Loading branch information
nunomaduro committed Nov 6, 2023
1 parent eefd1d2 commit 1ed8196
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions src/Plugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,26 +45,22 @@ 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));
}
}

$concurrency = 1;

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();
}
}

0 comments on commit 1ed8196

Please sign in to comment.