diff --git a/base/PerfOptions.php b/base/PerfOptions.php index 426d57c..ccfcd35 100644 --- a/base/PerfOptions.php +++ b/base/PerfOptions.php @@ -136,6 +136,9 @@ final class PerfOptions { public ?string $remoteSiege; public ?string $siegeTmpDir; + public string $siegeDuration = '1M'; + public string $siegeTimeout = '5m'; + public function __construct(Vector $argv) { $def = Vector { 'help', @@ -201,6 +204,8 @@ public function __construct(Vector $argv) { 'server-threads:', 'client-threads:', 'remote-siege:', + 'siege-duration:', + 'siege-timeout:', 'memcached-port:', 'memcached-threads:', 'no-memcached', // do not use memcached (even if target supports it) @@ -375,6 +380,17 @@ public function __construct(Vector $argv) { $this->srcDir = $this->getNullableString('src-dir'); $this->remoteSiege = $this->getNullableString('remote-siege'); + + $duration = $this->getNullableString('siege-duration'); + if ($duration) { + $this->siegeDuration = $duration; + } + + $timeout = $this->getNullableString('siege-timeout'); + if ($timeout) { + $this->siegeTimeout = $timeout; + } + } public function validate() { diff --git a/base/Siege.php b/base/Siege.php index 61e4b2b..3ef3ab6 100644 --- a/base/Siege.php +++ b/base/Siege.php @@ -114,7 +114,7 @@ protected function getArguments(): Vector { // See Siege::getExecutablePath() - these arguments get passed to // timeout '--signal=9', - '5m', + $this->options->siegeTimeout, parent::getExecutablePath(), }; } @@ -176,7 +176,7 @@ protected function getArguments(): Vector { if (!$this->options->noTimeLimit) { $arguments->add('-t'); - $arguments->add(PerfSettings::BenchmarkTime()); + $arguments->add($this->options->siegeDuration); } return $arguments; default: