diff --git a/base/HHVMDaemon.php b/base/HHVMDaemon.php index f604256..d790ead 100644 --- a/base/HHVMDaemon.php +++ b/base/HHVMDaemon.php @@ -68,6 +68,15 @@ public function needsRetranslatePause(): bool { return $status !== '' && $status !== 'failure'; } + <<__Override>> + public function queueEmpty(): bool { + $status = $this->adminRequest('/check-queued'); + if ($status === 'failure') { + return true; + } + return $status !== '' && $status === '0'; + } + <<__Override>> protected function getArguments(): Vector { if ($this->options->cpuBind) { diff --git a/base/PHPEngine.php b/base/PHPEngine.php index 3687841..a750347 100644 --- a/base/PHPEngine.php +++ b/base/PHPEngine.php @@ -14,4 +14,5 @@ public abstract function __toString(): string; public function writeStats(): void {} public function needsRetranslatePause(): bool { return false; } + public function queueEmpty(): bool { return true; } } diff --git a/base/PerfRunner.php b/base/PerfRunner.php index c037212..3871613 100644 --- a/base/PerfRunner.php +++ b/base/PerfRunner.php @@ -155,6 +155,12 @@ private static function RunWithOptionsAndEngine( ); } + self::PrintProgress('Server warmed, checking queue status.'); + while (!$options->skipWarmUp && !$php_engine->queueEmpty()) { + self::PrintProgress('Server warmed, waiting for queue to drain.'); + sleep(10); + } + self::PrintProgress('Clearing nginx access.log'); $nginx->clearAccessLog();