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

Commit

Permalink
updating oss-performance to work with recent changes to invariant sig… (
Browse files Browse the repository at this point in the history
#78)

* updating oss-performance to work with recent changes to invariant signature

* updating change to reflect comments

* changing %s to %f for a numeric value
  • Loading branch information
drewsk01 authored and fredemmott committed Jan 31, 2017
1 parent 9dd9706 commit adb976a
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 11 deletions.
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,
);
}
}

0 comments on commit adb976a

Please sign in to comment.