Ejemplo n.º 1
0
function insert($details)
{
    $conn = new Connection("auto");
    $query = new Build();
    $result = $query->insert($conn->grab_conn(), $details, "close");
    return $result;
}
Ejemplo n.º 2
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;
 }
Ejemplo n.º 3
0
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.
$run_id = GET_int('run');
$run = new Run($run_id);
if ($run->isFinished() || $run->hasError()) {
    throw new Error("Run was already finished or error'ed");
}