示例#1
0
文件: index.php 项目: 42mate/xhprof
$serverRS = $xhprof_runs_impl->getDistinct(array('column' => 'server_id'));
$serverFilterOptions = array("None");
while ($row = XHProfRuns_Default::getNextAssoc($serverRS)) {
    $serverFilterOptions[] = $row['server_id'];
}
$criteria = array();
if (!is_null($domainFilter)) {
    $criteria['server_name'] = $domainFilter;
}
if (!is_null($serverFilter)) {
    $criteria['server_id'] = $serverFilter;
}
$_xh_header = "";
if (isset($_GET['run1']) || isset($_GET['run'])) {
    include "../lib/templates/header.phtml";
    displayXHProfReport($xhprof_runs_impl, $params, $source, $run, $wts, $symbol, $sort, $run1, $run2);
} elseif (isset($_GET['geturl'])) {
    $last = isset($_GET['last']) ? $_GET['last'] : 100;
    $last = (int) $last;
    $criteria['url'] = $_GET['geturl'];
    $criteria['limit'] = $last;
    $criteria['order by'] = 'timestamp';
    $rs = $xhprof_runs_impl->getUrlStats($criteria);
    list($header, $body) = showChart($rs, TRUE);
    $_xh_header .= $header;
    include "../lib/templates/header.phtml";
    $rs = $xhprof_runs_impl->getRuns($criteria);
    include "../lib/templates/emptyBody.phtml";
    $url = htmlentities($_GET['geturl'], ENT_QUOTES, "UTF-8");
    displayRuns($rs, "Runs with URL: {$url}");
} elseif (isset($_GET['getcurl'])) {
示例#2
0
        unset($params[$k]);
    }
}
////echo "<html>";
////echo "<head><title>XHProf: Hierarchical Profiler Report</title>";
////xhprof_include_js_css();
////echo "</head>";
////echo "<body>";
$vbar = ' class="vbar"';
$vwbar = ' class="vwbar"';
$vwlbar = ' class="vwlbar"';
$vbbar = ' class="vbbar"';
$vrbar = ' class="vrbar"';
$vgbar = ' class="vgbar"';
$xhprof_runs_impl = new XHProfRuns_Default(eZXHProfLogger::logDir());
displayXHProfReport($xhprof_runs_impl, $params, $GLOBALS['source'], $GLOBALS['run'], $GLOBALS['wts'], $GLOBALS['symbol'], $GLOBALS['sort'], $GLOBALS['run1'], $GLOBALS['run2']);
////echo "</body>";
////echo "</html>";
$body = ob_get_clean();
$info = false;
$infoFile = eZXHProfLogger::logDir() . "/{$GLOBALS['run']}.info";
if (file_exists($infoFile)) {
    $info = eZPerfLoggerApacheLogger::parseLogLine(file_get_contents($infoFile));
}
$tpl = eZTemplate::factory();
$tpl->setVariable('body', $body);
$tpl->setVariable('error', $error);
$tpl->setVariable('run', $GLOBALS['run']);
$tpl->setVariable('info', $info);
$Result['content'] = $tpl->fetch('design:xhprof/view.tpl');
$Result['path'] = array(array('text' => 'XHProf', 'url' => 'xhprof/list'), array('text' => 'Run: ' . $GLOBALS['run'], 'url' => 'xhprof/view?run=' . $GLOBALS['run']));