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

Commit

Permalink
Added paramter --wait-after-warmup
Browse files Browse the repository at this point in the history
Summary:
When running with the parameter wait after warmup, perf
waits for user input before continuing the benchmark. This
feature is useful when you want to profile HHVM.
Using this option, you have more control over the hhvm that is
being benhmark. You can get more accurate profile information
as you can start the profile only after the warmup is done.
  • Loading branch information
andreeaflorescu committed Oct 21, 2015
1 parent c791502 commit 1d6662f
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
4 changes: 4 additions & 0 deletions base/PerfOptions.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@ final class PerfOptions {
// Pause once benchmarking is complete to allow for manual inspection of the
// HHVM or PHP process.
public bool $waitAtEnd = false;
// Pause after the warmup is completed to get relevant data when profiling
public bool $waitAfterWarmup = false;

//
// HHVM specific options to enable RepoAuthoritative mode and the static
Expand Down Expand Up @@ -116,6 +118,7 @@ public function __construct(Vector<string> $argv) {
'siege:',
'nginx:',
'wait-at-end',
'wait-after-warmup',
'no-proxygen',
'no-repo-auth',
'no-file-cache',
Expand Down Expand Up @@ -216,6 +219,7 @@ public function __construct(Vector<string> $argv) {

$this->skipSanityCheck = $this->getBool('skip-sanity-check');
$this->skipWarmUp = $this->getBool('skip-warmup');
$this->waitAfterWarmup = $this->getBool('wait-after-warmup');
$this->skipVersionChecks = $this->getBool('skip-version-checks');
$this->skipDatabaseInstall = $this->getBool('skip-database-install');
$this->noTimeLimit = $this->getBool('no-time-limit');
Expand Down
5 changes: 5 additions & 0 deletions base/PerfRunner.php
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,11 @@ private static function RunWithOptionsAndEngine(
self::PrintProgress('Clearing nginx access.log');
$nginx->clearAccessLog();

if ($options->waitAfterWarmup) {
self::PrintProgress('Finished warmup. Press Enter to continue the benchmark');
fread(STDIN, 1);
}

self::PrintProgress('Starting Siege for benchmark');
$siege = new Siege($options, $target, RequestModes::BENCHMARK);
$siege->start();
Expand Down

0 comments on commit 1d6662f

Please sign in to comment.