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

updating oss-performance to work with recent changes to invariant sig… #78

Merged
merged 3 commits into from Jan 31, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion base/BuildChecker.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public static function Check(
if ($skipKeys->contains($k)) {
continue;
}
invariant(is_array($v), $k.' is not an array');
invariant(is_array($v), '%s is not an array', $k);
$v = self::MakeCheckedValue($v);
if ($v['OK']) {
continue;
Expand Down
9 changes: 6 additions & 3 deletions base/PerfRunner.php
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,8 @@ private static function RunWithOptionsAndEngine(
Process::sleepSeconds($options->delayPhpStartup);
invariant(
$php_engine->isRunning(),
'Failed to start '.get_class($php_engine),
'Failed to start %s',
get_class($php_engine),
);

if ($target->needsUnfreeze()) {
Expand Down Expand Up @@ -114,7 +115,8 @@ private static function RunWithOptionsAndEngine(
invariant(!$siege->isRunning(), 'Siege is still running :/');
invariant(
$php_engine->isRunning(),
get_class($php_engine).' crashed',
'%s crashed',
get_class($php_engine),
);
} else {
self::PrintProgress('Skipping single request warmup');
Expand All @@ -130,7 +132,8 @@ private static function RunWithOptionsAndEngine(
invariant(!$siege->isRunning(), 'Siege is still running :/');
invariant(
$php_engine->isRunning(),
get_class($php_engine).' crashed',
'%s crashed',
get_class($php_engine),
);
} else {
self::PrintProgress('Skipping multi request warmup');
Expand Down
4 changes: 3 additions & 1 deletion base/PerfTarget.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,9 @@ final public function sanityCheck(): void {
$content = file_get_contents($url, /* include path = */ false, $ctx);
invariant(
strstr($content, $this->getSanityCheckString()) !== false,
'Failed to find string "'.$this->getSanityCheckString().'" in '.$url,
'Failed to find string "%s" in %s',
$this->getSanityCheckString(),
$url,
);
}

Expand Down
2 changes: 1 addition & 1 deletion base/Siege.php
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ protected function getArguments(): Vector<string> {
return $arguments;
default:
invariant_violation(
'Unexpected request mode: '.(string) $this->mode,
'Unexpected request mode: %s', (string) $this->mode,
);
}
}
Expand Down
8 changes: 3 additions & 5 deletions targets/wordpress/WordpressTarget.php
Original file line number Diff line number Diff line change
Expand Up @@ -100,11 +100,9 @@ private function unfreezeRequest(PerfOptions $options): void {
$data = file_get_contents($url, /* include path = */ false, $ctx);
invariant(
$data !== false,
'Failed to unfreeze '.
$url.
' after '.
$options->maxdelayUnfreeze.
' secs',
'Failed to unfreeze %s after %f secs',
$url,
$options->maxdelayUnfreeze,
);
}
}