Skip to content
This repository has been archived by the owner on Jan 13, 2022. It is now read-only.

Commit

Permalink
add wait for message queue to drain before final siege (#88)
Browse files Browse the repository at this point in the history
  • Loading branch information
swalk-cavium authored and mofarrell committed Oct 10, 2017
1 parent e783511 commit aa38192
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 0 deletions.
9 changes: 9 additions & 0 deletions base/HHVMDaemon.php
Original file line number Diff line number Diff line change
Expand Up @@ -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<string> {
if ($this->options->cpuBind) {
Expand Down
1 change: 1 addition & 0 deletions base/PHPEngine.php
Original file line number Diff line number Diff line change
Expand Up @@ -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; }
}
6 changes: 6 additions & 0 deletions base/PerfRunner.php
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand Down

0 comments on commit aa38192

Please sign in to comment.