本文整理汇总了PHP中XHProfRuns_Default::getNextAssoc方法的典型用法代码示例。如果您正苦于以下问题:PHP XHProfRuns_Default::getNextAssoc方法的具体用法?PHP XHProfRuns_Default::getNextAssoc怎么用?PHP XHProfRuns_Default::getNextAssoc使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类XHProfRuns_Default
的用法示例。
在下文中一共展示了XHProfRuns_Default::getNextAssoc方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: showChart
function showChart($rs)
{
$count = 0;
$dataPoints = "";
$ids = array();
$arCPU = array();
$arWT = array();
$arPEAK = array();
$arIDS = array();
$arDateIDs = array();
// $arSplit = array();
while ($row = XHProfRuns_Default::getNextAssoc($rs)) {
$date[] = "'" . date("Y", $row['timestamp']) . "-" . (date("m", $row['timestamp']) - 1) . "-" . date("d", $row['timestamp']) . "'";
$cpu = $row['cpu'];
$wt = $row['wt'];
$pmu = $row['pmu'];
$ids = "'{$row['id']}'";
$id = "{$row['id']}";
$arCPU[] = $cpu;
$arWT[] = $wt;
$arPEAK[] = $pmu;
$arIDS[] = $ids;
$arDateIDs[] = "'" . date("Y", $row['timestamp']) . "-" . (date("m", $row['timestamp']) - 1) . "-" . date("d", $row['timestamp']) . " <br/> " . $id . "'";
// $arSplit[] = "'" . $id . " ".date("Y", $row['timestamp']) . "-" . (date("m", $row['timestamp']) - 1) . "-" . date("d", $row['timestamp'])."'";
$count++;
}
$dateJS = implode(", ", $date);
$cpuJS = implode(", ", $arCPU);
$wtJS = implode(", ", $arWT);
$pmuJS = implode(", ", $arPEAK);
$idsJS = implode(", ", $arIDS);
$dateidsJS = implode(", ", $arDateIDs);
// $SplitJS = implode(", ", $arSplit);
// echo "[" . $idsJS . "]";
ob_start();
require "../xhprof_lib/templates/chart.phtml";
$stuff = ob_get_contents();
ob_end_clean();
return array($stuff, "<div id=\"container\" style=\"width: 1000px; height: 500px; margin: 0 auto\"></div>");
}
示例2: isset
$last = (int) $last;
$days = isset($_GET['days']) ? $_GET['days'] : 1;
$days = (int) $days;
if (isset($_GET['type']) && ($_GET['type'] === 'url' or $_GET['type'] = 'curl')) {
$type = $_GET['type'];
} else {
$type = 'url';
}
$criteria['limit'] = $last;
$criteria['days'] = $days;
$criteria['type'] = $type;
$resultSet = $xhprof_runs_impl->getHardHit($criteria);
echo "<div class=\"runTitle\">Hardest Hit</div>\n";
echo "<table id=\"box-table-a\" class=\"tablesorter\" summary=\"Stats\"><thead><tr><th>URL</th><th>Hits</th><th class=\"{sorter: 'numeric'}\">Total Wall Time</th><th>Avg Wall Time</th></tr></thead>";
echo "<tbody>\n";
while ($row = XHProfRuns_Default::getNextAssoc($resultSet)) {
$url = urlencode($row['url']);
$html['url'] = htmlentities($row['url'], ENT_QUOTES, 'UTF-8');
echo "\t<tr><td><a href=\"?geturl={$url}\">{$html['url']}</a></td><td>{$row['count']}</td><td>" . number_format($row['total_wall']) . " ms</td><td>" . number_format($row['avg_wall']) . " ms</td></tr>\n";
}
echo "</tbody>\n";
echo "</table>\n";
echo <<<CODESE
<script type="text/javascript">
\$(document).ready(function() {
\$.tablesorter.addParser({
id: 'pretty',
is: function(s) {
return false;
},
format: function(s) {
示例3: showChart
function showChart($rs, $flip = false)
{
$dataPoints = "";
$ids = array();
$arCPU = array();
$arWT = array();
$arPEAK = array();
$arIDS = array();
$arDateIDs = array();
while ($row = XHProfRuns_Default::getNextAssoc($rs)) {
$date[] = "'" . date("Y-m-d", $row['timestamp']) . "'";
$arCPU[] = $row['cpu'];
$arWT[] = $row['wt'];
$arPEAK[] = $row['pmu'];
$arIDS[] = $row['id'];
$arDateIDs[] = "'" . date("Y-m-d", $row['timestamp']) . " <br/> " . $row['id'] . "'";
}
$date = $flip ? array_reverse($date) : $date;
$arCPU = $flip ? array_reverse($arCPU) : $arCPU;
$arWT = $flip ? array_reverse($arWT) : $arWT;
$arPEAK = $flip ? array_reverse($arPEAK) : $arPEAK;
$arIDS = $flip ? array_reverse($arIDS) : $arIDS;
$arDateIDs = $flip ? array_reverse($arDateIDs) : $arDateIDs;
$dateJS = implode(", ", $date);
$cpuJS = implode(", ", $arCPU);
$wtJS = implode(", ", $arWT);
$pmuJS = implode(", ", $arPEAK);
$idsJS = implode(", ", $arIDS);
$dateidsJS = implode(", ", $arDateIDs);
ob_start();
require "../xhprof_lib/templates/chart.phtml";
$stuff = ob_get_contents();
ob_end_clean();
return array($stuff, "<div id=\"container\" style=\"width: 1000px; height: 500px; margin: 0 auto\"></div>");
}