當前位置: 首頁>>代碼示例>>PHP>>正文


PHP XHProfRuns_Default::getNextAssoc方法代碼示例

本文整理匯總了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>");
}
開發者ID:scoates,項目名稱:xhprof,代碼行數:40,代碼來源:common.php

示例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) {
開發者ID:42mate,項目名稱:xhprof,代碼行數:31,代碼來源:index.php

示例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>");
}
開發者ID:Seritech,項目名稱:xhprof,代碼行數:35,代碼來源:common.php


注:本文中的XHProfRuns_Default::getNextAssoc方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。