Exemple #1
0
/**
* Draw the waterfall image
* 
* @param resource $img
*/
function tbnDrawWaterfall(&$img)
{
    global $id;
    global $testPath;
    global $run;
    global $cached;
    global $url;
    global $newWidth;
    global $test;
    include 'waterfall.inc';
    $is_secure = false;
    $has_locations = false;
    $requests = getRequests($id, $testPath, $run, $cached, $is_secure, $has_locations, false);
    $use_dots = !isset($_REQUEST['dots']) || $_REQUEST['dots'] != 0;
    $rows = GetRequestRows($requests, $use_dots);
    $page_data = loadPageRunData($testPath, $run, $cached);
    $page_events = GetPageEvents($page_data);
    $bwIn = 0;
    if (isset($test) && array_key_exists('testinfo', $test) && array_key_exists('bwIn', $test['testinfo'])) {
        $bwIn = $test['testinfo']['bwIn'];
    } else {
        if (isset($test) && array_key_exists('test', $test) && array_key_exists('bwIn', $test['test'])) {
            $bwIn = $test['test']['bwIn'];
        }
    }
    $options = array('id' => $id, 'path' => $testPath, 'run_id' => $run, 'is_cached' => $cached, 'use_cpu' => true, 'use_bw' => true, 'max_bw' => $bwIn, 'is_thumbnail' => true, 'width' => $newWidth);
    $img = GetWaterfallImage($rows, $url, $page_events, $options, $page_data);
    if (!$requests || !$page_data) {
        $failed = true;
    }
}
Exemple #2
0
/**
* Draw the waterfall image
*
* @param TestStepResult $testStepResult Step results to draw the waterfall for
* @param resource $img
*/
function tbnDrawWaterfall($testStepResult, &$img)
{
    global $id;
    global $testPath;
    global $run;
    global $cached;
    global $url;
    global $newWidth;
    global $test;
    global $step;
    require_once __DIR__ . '/waterfall.inc';
    $requests = $testStepResult->getRequests();
    $localPaths = $testStepResult->createTestPaths();
    AddRequestScriptTimings($requests, $localPaths->devtoolsScriptTimingFile());
    $use_dots = !isset($_REQUEST['dots']) || $_REQUEST['dots'] != 0;
    $rows = GetRequestRows($requests, $use_dots);
    $page_events = GetPageEvents($testStepResult->getRawResults());
    $bwIn = 0;
    if (isset($test) && array_key_exists('testinfo', $test) && array_key_exists('bwIn', $test['testinfo'])) {
        $bwIn = $test['testinfo']['bwIn'];
    } else {
        if (isset($test) && array_key_exists('test', $test) && array_key_exists('bwIn', $test['test'])) {
            $bwIn = $test['test']['bwIn'];
        }
    }
    $options = array('id' => $id, 'path' => $testPath, 'run_id' => $run, 'is_cached' => $cached, 'step_id' => $step, 'use_cpu' => true, 'use_bw' => true, 'max_bw' => $bwIn, 'show_user_timing' => GetSetting('waterfall_show_user_timing'), 'is_thumbnail' => true, 'include_js' => true, 'is_mime' => (bool) GetSetting('mime_waterfalls'), 'width' => $newWidth);
    $url = $testStepResult->readableIdentifier($url);
    $pageData = $testStepResult->getRawResults();
    $img = GetWaterfallImage($rows, $url, $page_events, $options, $pageData);
}
Exemple #3
0
// Get all of the requests;
$is_secure = false;
$has_locations = false;
$use_location_check = false;
if (!isset($requests)) {
    $requests = getRequests($id, $testPath, $run, $cached, $is_secure, $has_locations, $use_location_check);
} else {
    // not multisteps enabled
    $requests = $requests[$run][$cached];
    fixRequests($requests, $id, $testPath, $run, $cached, $is_secure, $has_locations, $use_location_check);
}
if (@$_REQUEST['type'] == 'connection') {
    $is_state = true;
    $rows = GetConnectionRows($requests, $show_labels);
} else {
    $rows = GetRequestRows($requests, $use_dots, $show_labels);
}
$page_events = GetPageEvents($page_data);
$bwIn = 0;
if (isset($test) && array_key_exists('testinfo', $test) && array_key_exists('bwIn', $test['testinfo'])) {
    $bwIn = $test['testinfo']['bwIn'];
} else {
    if (isset($test) && array_key_exists('test', $test) && array_key_exists('bwIn', $test['test'])) {
        $bwIn = $test['test']['bwIn'];
    }
}
$options = array('id' => $id, 'path' => $testPath, 'run_id' => $run, 'is_cached' => $cached, 'use_cpu' => !isset($_REQUEST['cpu']) || $_REQUEST['cpu'] != 0, 'use_bw' => !isset($_REQUEST['bw']) || $_REQUEST['bw'] != 0, 'show_labels' => $show_labels, 'max_bw' => $bwIn, 'is_mime' => $is_mime, 'is_state' => $is_state, 'rowcount' => $rowcount);
$im = GetWaterfallImage($rows, $url, $page_events, $options, $page_data);
// Spit the image out to the browser.
imagepng($im);
imagedestroy($im);
Exemple #4
0
$show_labels = !isset($_REQUEST['labels']) || $_REQUEST['labels'] != 0;
$rowcount = array_key_exists('rowcount', $_REQUEST) ? $_REQUEST['rowcount'] : 0;
// Get all of the requests;
$requests = $testStepResult->getRequests();
if ($include_js) {
    $localPaths = new TestPaths($testInfo->getRootDirectory(), $run, $cached, $step);
    AddRequestScriptTimings($requests, $localPaths->devtoolsScriptTimingFile());
}
if (@$_REQUEST['type'] == 'connection') {
    $is_state = true;
    $include_js = false;
    $rows = GetConnectionRows($requests, $show_labels);
} else {
    $rows = GetRequestRows($requests, $use_dots, $show_labels);
}
$page_events = GetPageEvents($testStepResult->getRawResults());
$bwIn = 0;
if (isset($test) && array_key_exists('testinfo', $test) && array_key_exists('bwIn', $test['testinfo'])) {
    $bwIn = $test['testinfo']['bwIn'];
} else {
    if (isset($test) && array_key_exists('test', $test) && array_key_exists('bwIn', $test['test'])) {
        $bwIn = $test['test']['bwIn'];
    }
}
$options = array('id' => $id, 'path' => $testPath, 'run_id' => $run, 'is_cached' => $cached, 'step_id' => $step, 'use_cpu' => !isset($_REQUEST['cpu']) || $_REQUEST['cpu'] != 0, 'use_bw' => !isset($_REQUEST['bw']) || $_REQUEST['bw'] != 0, 'show_labels' => $show_labels, 'max_bw' => $bwIn, 'is_mime' => $is_mime, 'is_state' => $is_state, 'include_js' => $include_js, 'show_user_timing' => isset($_REQUEST['ut']) ? $_REQUEST['ut'] : GetSetting('waterfall_show_user_timing'), 'rowcount' => $rowcount);
$url = $testStepResult->readableIdentifier($url);
$pageData = $testStepResult->getRawResults();
$im = GetWaterfallImage($rows, $url, $page_events, $options, $pageData);
// Spit the image out to the browser.
imagepng($im);
imagedestroy($im);