예제 #1
0
 public static function createOutOfOrder($machine_id, $mode_id, $revision, $run_before_id, $run_after_id)
 {
     $run_before = new Run($run_before_id);
     $run_after = new Run($run_after_id);
     // Find the sorting order where we could add this revision;
     $sort_order = RunReporter::findSortOrder($run_before, $mode_id, $revision);
     // Get the approx stamp of the run with the sort_order before the one we are replacing.
     $old_run = Run::withMachineAndSortOrder($machine_id, $sort_order - 1);
     $approx_stamp = $old_run->approx_stamp();
     // sanity check.
     RunReporter::assertInBound($run_before, $run_after, $mode_id, $sort_order);
     // Create a space at the given sort_order, by shifting all sort_order,
     // equal or higher than the given sort_order.
     RunReporter::increaseNextSortOrder($machine_id, $sort_order);
     $run = Run::insert($machine_id, $sort_order, $approx_stamp);
     $run->updateInt("out_of_order", 1);
     $build = Build::insert($run, $mode_id, $revision);
     return $run;
 }
예제 #2
0
// Start a full benchmark run. Request a token/number used to report/group
// benchmark scores.
if (GET_string("run") == 'yes') {
    $machine_id = GET_int('MACHINE');
    $run = RunReporter::createForMachine($machine_id);
    echo "id=" . $run->id;
    die;
}
// Start an out of order run. Retriggering a particular mode.
if (GET_string("run") == 'ooo') {
    $machine_id = GET_int('MACHINE');
    $mode = Mode::FromMode(GET_string('mode'));
    $revision = GET_string('revision');
    $run_before_id = GET_int('run_before_id');
    $run_after_id = GET_int('run_after_id');
    $run = RunReporter::createOutOfOrder($machine_id, $mode->id, $revision, $run_before_id, $run_after_id);
    echo "id=" . $run->id;
    die;
}
// Finish a full benchmark run. Scores will only become visible from now on
// (when status equals 1).
if (GET_string("run") == 'finish') {
    $run_id = GET_int('runid');
    $status = GET_int('status');
    $run = new Run($run_id);
    if ($run->isFinished() || $run->hasError()) {
        throw new Error("Run was already finished or error'ed");
    }
    $error = GET_string('error');
    $run->finish($status, $error);
    die;