private static function findSortOrder($run, $mode_id, $revision) { $version_control = VersionControl::forMode($mode_id); $j = 0; while (True) { if ($j++ > 30) { throw new Exception("There shouldn't be too many runs in between"); } if (!$run->isBuildInfoComplete()) { throw new Exception("Encountered an incomplete run."); } $build = Build::withRunAndMode($run->id, $mode_id); // We can safely ignore runs that have no results with the requested mode_id if (!$build) { $run = $run->next(); continue; } // We skip to the next run, if revisions are the same. // To make sure that new runs are shown after existing ones. if ($version_control->equal($build->revision(), $revision)) { $run = $run->next(); continue; } // Using version control take a peek if the revision // is later/earlier than this one. if ($version_control->isAfter($build->revision(), $revision)) { return $run->sort_order(); } $run = $run->next(); } }
static function inbetweenBuilds($regression) { $build = $regression->build(); $run = $build->run(); $mode_id = $build->mode_id(); $machine_id = $run->machine_id(); $sortOrder = $run->sort_order(); $prevSortOrder = $regression->prev_build()->run()->sort_order(); $builds = array(); for ($i = $prevSortOrder + 1; $i < $sortOrder; $i++) { $run_i = Run::withMachineAndSortOrder($machine_id, $i); if (!$run_i->isFinished()) { continue; } $build = Build::withRunAndMode($run_i->id, $mode_id); if (!$build) { continue; } if (count($build->scores()) == 0) { continue; } $builds[] = $build; } return $builds; }
} $error = GET_string('error'); $run->finish($status, $error); die; } if (GET_string("run") == 'addEngine') { $run = new Run(GET_int('runid')); $revision = GET_string('cset'); $mode = Mode::FromMode(GET_string('name')); if ($run->isFinished() || $run->hasError()) { throw new Exception("Run was already finished or error'ed"); } if ($run->isOutOfOrder()) { // out of order builds cannot add extra modes. The available // mode have already been added. if (!Build::withRunAndMode($run->id, $mode->id)) { $run->finish(0, "Tried to add extra modes to out of order run."); } die; } Build::insert($run, $mode->id, $revision); die; } // Report that a slave is still awake when there are no benchmarks results // to send. if (GET_string('awake') == 'yes') { $MACHINE = GET_int('MACHINE'); mysql_query("UPDATE awfy_machine\n SET last_checked = UNIX_TIMESTAMP()\n WHERE id = {$MACHINE}") or die("ERROR: " . mysql_error()); die; } // Report score of a benchmark total or subtest.