Exemple #1
0
/**
 * Return whether the first renderer is a better choice for the given job than the second renderer
 *
 * @param array $first The first renderer
 * @param array $second The second renderer
 * @param array $job The concerned job
 * @return boolean Whether the first renderer is a better choice for the given job than the second renderer
 */
function lib_scheduling_renderer_is_better_than($first, $second, $job)
{
    $first = lib_scheduling_renderer_metadata($first);
    $second = lib_scheduling_renderer_metadata($second);
    // @todo IMPROVE, taking count of the load
    return $first['performance_idx'] < $second['performance_idx'];
}
        <th>®renderer_jobs®</th>
        <th>®renderer_load®</th>
        <th>®renderer_threads®</th>
        <th>®room_enabled®</th>
        <th>®enable_disable®</th>
        <th></th>
    </tr>

    <?php 
include_once 'lib_scheduling.php';
foreach ($renderers as $r) {
    exec('ping ' . $r['host'] . ' 10', $output, $return_val);
    if ($return_val != 0) {
        $r['no_ping'] = true;
    } else {
        $r = lib_scheduling_renderer_metadata($r);
    }
    //var_dump($r2);
    ?>
        <tr class="<?php 
    echo $class;
    ?>
">
            <td><?php 
    if ($r['no_ping'] === true) {
        echo '<span title="®no_ping®"><i class="icon-warning-sign"></i></span>';
    }
    if ($r['ssh_error'] === true) {
        echo '<span title="®ssh_error®"><i class="icon-warning-sign"></i></span>';
    }
    ?>