зеркало из https://github.com/mozilla/pjs.git
Use startup test function instead of cut-paste now. -mcafee
This commit is contained in:
Родитель
b8284c3030
Коммит
427391610a
|
@ -247,96 +247,13 @@ sub main {
|
|||
|
||||
# Startup test.
|
||||
if ($chimera_startup_test and $post_status eq 'success') {
|
||||
my $i;
|
||||
my $startuptime; # Startup time in ms.
|
||||
my $agg_startuptime = 0; # Aggregate startup time.
|
||||
my $startup_count = 0; # Number of successful runs.
|
||||
my $avg_startuptime = 0; # Average startup time.
|
||||
my @times;
|
||||
|
||||
for($i=0; $i<10; $i++) {
|
||||
# Settle OS.
|
||||
TinderUtils::run_system_cmd("sync; sleep 5", 35);
|
||||
|
||||
# Generate URL of form file:///<path>/startup-test.html?begin=986869495000
|
||||
# Where begin value is current time.
|
||||
my ($time, $url, $cwd, $cmd);
|
||||
|
||||
#
|
||||
# Test for Time::HiRes and report the time.
|
||||
$time = Time::PossiblyHiRes::getTime();
|
||||
|
||||
$cwd = TinderUtils::get_system_cwd();
|
||||
print "cwd = $cwd\n";
|
||||
$url = "\"file:$chimera_dir/../../../startup-test.html?begin=$time\"";
|
||||
|
||||
print "url = $url\n";
|
||||
|
||||
# Then load startup-test.html, which will pull off the begin argument
|
||||
# and compare it to the current time to compute startup time.
|
||||
# Since we are iterating here, save off logs as StartupPerformanceTest-0,1,2...
|
||||
#
|
||||
# -P $Settings::MozProfileName added 3% to startup time, assume one profile
|
||||
# and get the 3% back. (http://bugzilla.mozilla.org/show_bug.cgi?id=112767)
|
||||
#
|
||||
if($post_status eq 'success') {
|
||||
$startuptime =
|
||||
TinderUtils::AliveTestReturnToken("StartupPerformanceTest-$i",
|
||||
"$chimera_dir/build/Navigator.app/Contents/MacOS",
|
||||
"Navigator",
|
||||
"-url $url",
|
||||
$Settings::StartupPerformanceTestTimeout,
|
||||
"__startuptime",
|
||||
",");
|
||||
}
|
||||
|
||||
|
||||
if($startuptime) {
|
||||
$post_status = 'success';
|
||||
|
||||
# Add our test to the total.
|
||||
$startup_count++;
|
||||
$agg_startuptime += $startuptime;
|
||||
|
||||
# Keep track of the results in an array.
|
||||
push(@times, $startuptime);
|
||||
} else {
|
||||
$post_status = 'testfailed';
|
||||
}
|
||||
|
||||
} # for loop
|
||||
|
||||
if($post_status eq 'success') {
|
||||
TinderUtils::print_log "\nSummary for startup test:\n";
|
||||
|
||||
# Print startup times.
|
||||
chop(@times);
|
||||
my $times_string = join(" ", @times);
|
||||
TinderUtils::print_log "times = [$times_string]\n";
|
||||
|
||||
# Figure out the average startup time.
|
||||
$avg_startuptime = $agg_startuptime / $startup_count;
|
||||
TinderUtils::print_log "Average startup time: $avg_startuptime\n";
|
||||
|
||||
my $min_startuptime = TinderUtils::min(@times);
|
||||
TinderUtils::print_log "Minimum startup time: $min_startuptime\n";
|
||||
|
||||
# Old mechanism here, new = TinderboxPrint.
|
||||
# print_log "\n\n __avg_startuptime,$avg_startuptime\n\n";
|
||||
# print_log "\n\n __avg_startuptime,$min_startuptime\n\n";
|
||||
|
||||
my $time = POSIX::strftime "%Y:%m:%d:%H:%M:%S", localtime;
|
||||
my $print_string = "\n\nTinderboxPrint:<a title=\"Best startup time out of 10 startups\"href=\"http://$Settings::results_server/graph/query.cgi?testname=startup&tbox=" . ::hostname() . "&autoscale=1&days=7&avg=1&showpoint=$time,$min_startuptime\">Ts:" . $min_startuptime . "ms</a>\n\n";
|
||||
TinderUtils::print_log "$print_string";
|
||||
|
||||
# Report data back to server
|
||||
if($Settings::TestsPhoneHome) {
|
||||
TinderUtils::print_log "phonehome = 1\n";
|
||||
TinderUtils::send_results_to_server($min_startuptime, $times_string,
|
||||
"startup", ::hostname());
|
||||
}
|
||||
|
||||
}
|
||||
$post_status =
|
||||
TinderUtils::StartupPerformanceTest("ChimeraStartupPerformanceTest",
|
||||
"Navigator",
|
||||
"$chimera_dir/build/Navigator.app/Contents/MacOS",
|
||||
"-url",
|
||||
"file:$chimera_dir/../../../startup-test.html");
|
||||
}
|
||||
|
||||
# Pass our status back to calling script.
|
||||
|
|
Загрузка…
Ссылка в новой задаче