Example #1
0
<h1> hi, this page should of been profiled</h1>
<p> Check fo a link below taking you nto the profiler output page</p>

<?php 
// Some samples  to epview xhprof output
function test_for()
{
    for ($i = 0; $i < 1000000; ++$i) {
    }
}
function test_while()
{
    $i = 0;
    while ($i < 1000000) {
        ++$i;
    }
}
function test_sleep($x)
{
    sleep($x);
}
for ($i = 0; $i < 20; $i++) {
    test_for();
    test_while();
}
test_sleep(1);
test_sleep(2);
Example #2
0
 } else {
     $result = 0;
 }
 if ($dotests) {
     // evaluation
     if ($lrow['simpleeval'] == 1) {
         $lvl = SimpleEval($lrow['testtype'], $result);
     } else {
         $lvl = nats_eval("L" . $lrow['localtestid'], $result);
     }
     db(" Eval: " . $lvl);
     // put in the custom retries based on attempts here - we KNOW dotests is on so don't need to worry about untested status
     $att = $lrow['attempts'];
     if ($lvl != 0 && is_numeric($att) && $att > 1) {
         for ($a = 2; $a <= $att; $a++) {
             test_sleep();
             db(" Test: " . $lrow['testtype'] . " (" . $lrow['testparam'] . ") X" . $a);
             $NATS->Event("Tester " . $trid . " Node " . $row['nodeid'] . " X" . $a . " Doing " . $lrow['testtype'] . "(" . $lrow['testparam'] . ")", 10, "Tester", "Test");
             $result = DoTest($lrow['testtype'], $lrow['testparam'], $row['hostname'], $lrow['timeout'], $params, $row['nodeid']);
             db(" Result: " . $result);
             if ($lrow['simpleeval'] == 1) {
                 $lvl = SimpleEval($lrow['testtype'], $result);
             } else {
                 $lvl = nats_eval("L" . $lrow['localtestid'], $result);
             }
             db(" Eval: " . $lvl);
             if ($lvl == 0) {
                 $a = $att + 1;
             }
             // test passed
         }