コード例 #1
0
ファイル: job_times.php プロジェクト: entibasse/superhost
function analyze($appid, $app_version_id, $nresults)
{
    global $hist;
    $clause = $app_version_id ? " and app_version_id = {$app_version_id} " : "";
    $query = "select id, server_state, outcome, elapsed_time, flops_estimate from result where server_state=5 and appid={$appid} and outcome=1 and validate_state=1 {$clause} order by id desc limit {$nresults}";
    $r = mysql_query($query);
    $n = 0;
    while ($result = mysql_fetch_object($r)) {
        handle_result($result);
        $n++;
    }
    if (!$n) {
        echo "No done results for that app";
        exit;
    }
    ksort($hist);
    show_stats($hist);
    echo "<hr>\n";
    show_as_table();
    echo "<hr>\n";
    show_as_xml();
}
コード例 #2
0
ファイル: job_times.php プロジェクト: Turante/boincweb
function analyze($appid, $platformid, $nresults)
{
    global $hist;
    $clause = "";
    switch ($platformid) {
        case 0:
            $clause = "";
            break;
        case 1:
            $clause = " and locate('Windows', os_name)";
            break;
        case 2:
            $clause = " and locate('Darwin', os_name)";
            break;
        case 3:
            $clause = " and locate('Linux', os_name)";
            break;
    }
    $query = "select server_state, outcome, cpu_time, p_fpops from result, host where server_state=5 and appid={$appid} and host.id = result.hostid {$clause} limit {$nresults}";
    $r = mysql_query($query);
    $n = 0;
    while ($result = mysql_fetch_object($r)) {
        switch ($result->outcome) {
            case 1:
                // success
                handle_result($result);
                $n++;
                break;
            case 2:
                // couldn't send
            // couldn't send
            case 3:
                // client error
            // client error
            case 4:
                // no reply
            // no reply
            case 5:
                // didn't need
            // didn't need
            case 6:
                // validate error
            // validate error
            case 7:
                // client detached
        }
    }
    if (!$n) {
        echo "No done results for that app";
        exit;
    }
    ksort($hist);
    show_stats($hist);
    echo "<hr>\n";
    show_as_table();
    echo "<hr>\n";
    show_as_xml();
}