Exemplo n.º 1
0
/**
 * Generates a tabular report for all functions. This is the top-level report.
 *
 * @author Kannan
 */
function full_report($url_params, $symbol_tab, $sort, $run1, $run2)
{
    global $vwbar;
    global $vbar;
    global $totals;
    global $totals_1;
    global $totals_2;
    global $metrics;
    global $diff_mode;
    global $descriptions;
    global $sort_col;
    global $format_cbk;
    global $display_calls;
    global $base_path;
    $possible_metrics = xhprof_get_possible_metrics();
    if ($diff_mode) {
        $base_url_params = xhprof_array_unset(xhprof_array_unset($url_params, 'run1'), 'run2');
        $href1 = "{$base_path}/index.php?" . http_build_query(xhprof_array_set($base_url_params, 'run', $run1));
        $href2 = "{$base_path}/index.php?" . http_build_query(xhprof_array_set($base_url_params, 'run', $run2));
        print "<h3><center>Overall Diff Summary</center></h3>";
        print '<table border=1 cellpadding=2 cellspacing=1 width="30%" ' . 'rules=rows bordercolor="#bdc7d8" align=center>' . "\n";
        print '<tr bgcolor="#bdc7d8" align=right>';
        print "<th></th>";
        print "<th {$vwbar}>" . xhprof_render_link("Run #{$run1}", $href1) . "</th>";
        print "<th {$vwbar}>" . xhprof_render_link("Run #{$run2}", $href2) . "</th>";
        print "<th {$vwbar}>Diff</th>";
        print "<th {$vwbar}>Diff%</th>";
        print '</tr>';
        if ($display_calls) {
            print '<tr>';
            print "<td>Number of Function Calls</td>";
            print_td_num($totals_1["ct"], $format_cbk["ct"]);
            print_td_num($totals_2["ct"], $format_cbk["ct"]);
            print_td_num($totals_2["ct"] - $totals_1["ct"], $format_cbk["ct"], true);
            print_td_pct($totals_2["ct"] - $totals_1["ct"], $totals_1["ct"], true);
            print '</tr>';
        }
        foreach ($metrics as $metric) {
            $m = $metric;
            print '<tr>';
            print "<td>" . str_replace("<br>", " ", $descriptions[$m]) . "</td>";
            print_td_num($totals_1[$m], $format_cbk[$m]);
            print_td_num($totals_2[$m], $format_cbk[$m]);
            print_td_num($totals_2[$m] - $totals_1[$m], $format_cbk[$m], true);
            print_td_pct($totals_2[$m] - $totals_1[$m], $totals_1[$m], true);
            print '<tr>';
        }
        print '</table>';
        $callgraph_report_title = '[View Regressions/Improvements using Callgraph Diff]';
    } else {
        print "<p><center>\n";
        print '<table cellpadding=2 cellspacing=1 width="30%" ' . 'bgcolor="#bdc7d8" align=center>' . "\n";
        echo "<tr>";
        echo "<th style='text-align:right'>Overall Summary</th>";
        echo "<th></th>";
        echo "</tr>";
        foreach ($metrics as $metric) {
            echo "<tr>";
            echo "<td style='text-align:right; font-weight:bold'>Total " . str_replace("<br>", " ", stat_description($metric)) . ":</td>";
            echo "<td>" . number_format($totals[$metric]) . " " . $possible_metrics[$metric][1] . "</td>";
            echo "</tr>";
        }
        if ($display_calls) {
            echo "<tr>";
            echo "<td style='text-align:right; font-weight:bold'>Number of Function Calls:</td>";
            echo "<td>" . number_format($totals['ct']) . "</td>";
            echo "</tr>";
        }
        echo "</table>";
        print "</center></p>\n";
        $callgraph_report_title = '[View Full Callgraph]';
    }
    print "<center><br><h3>" . xhprof_render_link($callgraph_report_title, "{$base_path}/callgraph.php" . "?" . http_build_query($url_params)) . "</h3></center>";
    $flat_data = array();
    foreach ($symbol_tab as $symbol => $info) {
        $tmp = $info;
        $tmp["fn"] = $symbol;
        $flat_data[] = $tmp;
    }
    usort($flat_data, 'sort_cbk');
    print "<br>";
    if (!empty($url_params['all'])) {
        $all = true;
        $limit = 0;
        // display all rows
    } else {
        $all = false;
        $limit = 100;
        // display only limited number of rows
    }
    $desc = str_replace("<br>", " ", $descriptions[$sort_col]);
    if ($diff_mode) {
        if ($all) {
            $title = "Total Diff Report: '\n               .'Sorted by absolute value of regression/improvement in {$desc}";
        } else {
            $title = "Top 100 <i style='color:red'>Regressions</i>/" . "<i style='color:green'>Improvements</i>: " . "Sorted by {$desc} Diff";
        }
    } else {
        if ($all) {
            $title = "Sorted by {$desc}";
        } else {
            $title = "Displaying top {$limit} functions: Sorted by {$desc}";
        }
    }
    print_flat_data($url_params, $title, $flat_data, $sort, $run1, $run2, $limit);
}
Exemplo n.º 2
0
/**
 * Generates a tabular report for all functions. This is the top-level report.
 *
 * @author Kannan
 */
function full_report($url_params, $symbol_tab, $sort, $run1, $run2, $links)
{
    global $vwbar;
    global $vbar;
    global $totals;
    global $totals_1;
    global $totals_2;
    global $metrics;
    global $diff_mode;
    global $descriptions;
    global $sort_col;
    global $format_cbk;
    global $display_calls;
    global $base_path;
    $possible_metrics = xhprof_get_possible_metrics();
    if ($diff_mode) {
        global $xhprof_runs_impl;
        include "../xhprof_lib/templates/diff_run_header_block.phtml";
    } else {
        global $xhprof_runs_impl;
        include "../xhprof_lib/templates/single_run_header_block.phtml";
    }
    //echo xhprof_render_actions($links);
    $flat_data = array();
    foreach ($symbol_tab as $symbol => $info) {
        $tmp = $info;
        $tmp["fn"] = $symbol;
        $flat_data[] = $tmp;
    }
    usort($flat_data, 'sort_cbk');
    print "<br />";
    if (!empty($url_params['all'])) {
        $all = true;
        $limit = 0;
        // display all rows
    } else {
        $all = false;
        $limit = 100;
        // display only limited number of rows
    }
    $desc = str_replace("<br />", " ", $descriptions[$sort_col]);
    if ($diff_mode) {
        if ($all) {
            $title = "Total Diff Report: '\n               .'Sorted by absolute value of regression/improvement in {$desc}";
        } else {
            $title = "Top 100 <i style='color:red'>Regressions</i>/" . "<i style='color:green'>Improvements</i>: " . "Sorted by {$desc} Diff";
        }
    } else {
        if ($all) {
            $title = "Sorted by {$desc}";
        } else {
            $title = "Displaying top {$limit} functions: Sorted by {$desc}";
        }
    }
    print_flat_data($url_params, $title, $flat_data, $sort, $run1, $run2, $limit);
}
Exemplo n.º 3
0
/**
 * Generates a tabular report for all functions. This is the top-level report.
 *
 * @author Kannan
 */
function full_report($url_params, $symbol_tab, $sort, $run1, $run2)
{
    global $vwbar;
    global $vbar;
    global $totals;
    global $totals_1;
    global $totals_2;
    global $metrics;
    global $diff_mode;
    global $descriptions;
    global $sort_col;
    global $format_cbk;
    global $display_calls;
    global $base_path;
    $possible_metrics = xhprof_get_possible_metrics();
    if ($diff_mode) {
        $base_url_params = xhprof_array_unset(xhprof_array_unset($url_params, 'run1'), 'run2');
        $href1 = "{$base_path}/?" . http_build_query(xhprof_array_set($base_url_params, 'run', $run1));
        $href2 = "{$base_path}/?" . http_build_query(xhprof_array_set($base_url_params, 'run', $run2));
        $file1_arr = explode("/", $run1);
        $file2_arr = explode("/", $run2);
        $time_page1 = $file1_arr[count($file1_arr) - 1];
        $time_page2 = $file2_arr[count($file2_arr) - 1];
        $game_id1 = $file1_arr[count($file1_arr) - 3];
        $game_id2 = $file2_arr[count($file2_arr) - 3];
        $game_me1 = explode("_", $game_id1);
        $game_me2 = explode("_", $game_id2);
        $game1 = $game_me1[0];
        $game2 = $game_me2[0];
        if (sizeof($game_me1) > 1) {
            $array1 = $game_me1[1];
        } else {
            $array1 = "all";
        }
        if (sizeof($game_me2) > 1) {
            $array2 = $game_me2[1];
        } else {
            $array2 = "all";
        }
        if (sizeof($game_me1) > 1) {
            if (is_numeric($game_me1[sizeof($game_me1) - 1])) {
                for ($i = 1; $i < sizeof($game_me1) - 1; $i++) {
                    $game1 = $game1 . "_" . $game_me1[$i];
                }
                $array1 = $game_me1[sizeof($game_me1) - 1];
            } else {
                for ($i = 1; $i < sizeof($game_me1); $i++) {
                    $game1 = $game1 . "_" . $game_me1[$i];
                }
                $array1 = "all";
            }
        } else {
            $array1 = "all";
        }
        if (sizeof($game_me2) > 1) {
            if (is_numeric($game_me2[sizeof($game_me2) - 1])) {
                for ($i = 1; $i < sizeof($game_me2) - 1; $i++) {
                    $game2 = $game2 . "_" . $game_me2[$i];
                }
                $array2 = $game_me2[sizeof($game_me2) - 1];
            } else {
                for ($i = 1; $i < sizeof($game_me2); $i++) {
                    $game2 = $game2 . "_" . $game_me2[$i];
                }
                $array2 = "all";
            }
        } else {
            $array2 = "all";
        }
        $timestamp1 = intval($time_page1 . substr(0, 10));
        $timestamp2 = intval($time_page2 . substr(0, 10));
        $page1 = substr($time_page1, 11, strlen($time_page1) - 18);
        $page2 = substr($time_page2, 11, strlen($time_page2) - 18);
        print '<div id="diff_page" class="title left hdblock" style="margin-left:20px;">zPerfmon/Profile Diff</div><br /><br /> <br /><br />';
        print '<div><table id="summary" class="summary" style="margin:0px;border-color:grey;margin-top: 20px ;margin-left:20px;font-size:16px; border:1px solid ;border-color:grey">' . "\n";
        print '<tr style="background: #D8D8DA url(http://yui.yahooapis.com/2.9.0/build/assets/skins/sam/sprite.png) repeat-x 0 0;text-align:center" >';
        print "<th></th>";
        print "<th {$vwbar} style ='text-align:center;' >{$page1} <br /> <div id='time1'>{$timestamp1}</div> </th>";
        print "<th {$vwbar} style ='text-align:center;' >{$page2} <br /> <div id ='time2'>{$timestamp2}</div> </th>";
        print "<th {$vwbar}>Diff</th>";
        print "<th {$vwbar}>Diff%</th>";
        print '</tr>';
        if ($display_calls) {
            print '<tr>';
            print "<td>Number of Function Calls</td>";
            print_td_num($totals_1["ct"], $format_cbk["ct"]);
            print_td_num($totals_2["ct"], $format_cbk["ct"]);
            print_td_num($totals_1["ct"] - $totals_2["ct"], $format_cbk["ct"], true);
            print_td_pct($totals_1["ct"] - $totals_2["ct"], $totals_1["ct"], true);
            print '</tr>';
        }
        foreach ($metrics as $metric) {
            $m = $metric;
            print '<tr>';
            print "<td>" . str_replace("<br>", " ", $descriptions[$m]) . "</td>";
            print_td_num($totals_1[$m], $format_cbk[$m]);
            print_td_num($totals_2[$m], $format_cbk[$m]);
            print_td_num($totals_1[$m] - $totals_2[$m], $format_cbk[$m], true);
            print_td_pct($totals_1[$m] - $totals_2[$m], $totals_1[$m], true);
            print '</tr>';
        }
        echo "<tr><td>Game:</td><td style= 'text-align:right'>" . $game1 . "</td><td style= 'text-align:right'>" . $game2 . "</td><td></td><td></td></tr>";
        echo "<tr><td>Array:</td><td style= 'text-align:right'>" . $array1 . "</td><td style= 'text-align:right'>" . $array2 . "</td><td></td></tr>";
        print '</table>';
        echo "<span>";
        echo '<button id="callgraph_button" style ="width:125px;margin:10px;margin-left:0px" type=button onClick="changeUrl(\'callgraph.php\')">Call Graph</button>';
        echo '<button id="piechart" style ="width:125px;margin:10px;" type=button onClick="changeUrl(\'piechart.php\')">Pie Chart</button>';
        echo "<button id='select_column' style ='width:125px;margin:10px;margin-left:20px;' type='button' >Select Column</button>";
        echo "<button id='display_all' style ='width:125px;margin:10px;'   type='button' >Display All</button>";
        echo "<span><a id='link_address_anchor' style='font-size:18px;color:#555;' href=''>Profile URL</a></span>";
        echo "<input id='fn-input' value='Function Search' style='width:200px;height:30px;margin:20px' onfocus='searchfield_focus()'  onKeyPress='display_page(event)' type='text'> ";
        echo "</span>";
        print '<div class="clear" style="clear:both"></div></div>';
        $callgraph_report_title = '[View Regressions/Improvements using Callgraph Diff]';
    } else {
        if ($run1 == "" && realpath($url_params['file']) == $url_params['file']) {
            $file_arr1 = explode("/", realpath($url_params['file']));
            $temp = $file_arr1[count($file_arr1) - 1];
            $temp_arr = explode(":", $temp);
            $run1 = $temp_arr[1] . "." . $temp_arr[3];
        }
        $file_arr = explode("/", $url_params['file']);
        $game_id = $file_arr[count($file_arr) - 3];
        $game_me = explode("_", $game_id);
        $game = $game_me[0];
        if (sizeof($game_me) > 1) {
            if (is_numeric($game_me[sizeof($game_me) - 1])) {
                for ($i = 1; $i < sizeof($game_me) - 1; $i++) {
                    $game = $game . "_" . $game_me[$i];
                }
                $array = $game_me[sizeof($game_me) - 1];
            } else {
                for ($i = 1; $i < sizeof($game_me); $i++) {
                    $game = $game . "_" . $game_me[$i];
                }
                $array = "all";
            }
        } else {
            $array = "all";
        }
        if ($file_arr[1] == 'db') {
            $game = $file_arr[3];
        }
        echo "</table>";
        print '<div id="fn_info" style="margin:40px 20px 20px;">';
        print '<table style ="margin-right:20px;">';
        print '<tr><td valign="top">';
        print '<table id="summary" class="summary" style="border-color:grey;font-size:16px; border:1px solid ;border-color:grey" cellpadding=2 cellspacing=1 >';
        echo "<tr colspan=2><td colspan=2 style='background: #D8D8DA url(http://yui.yahooapis.com/2.9.0/build/assets/skins/sam/sprite.png) repeat-x 0 0;text-align:center'>Page Summary</td></tr>";
        echo "<tr><td>Game:</td><td>" . $game . "</td></tr>";
        echo "<tr><td>Array:</td><td>" . $array . "</td></tr>";
        echo "<tr><td>Page:</td><td>" . substr($run1, 11) . "</td></tr>";
        echo "<tr><td>Release Tag:</td><td>";
        $game_id = $file_arr[count($file_arr) - 3];
        $game_me = explode("_", $game_id);
        $_GET['timestamp'] = intval($run1 . substr(0, 10));
        $timestamp = intval($run1 . substr(0, 10));
        include_once "get_latest_release.php";
        echo "</td></tr>";
        echo "<tr><td>Time:</td><td id='time' >{$timestamp}</td></tr>";
        echo "</table></td>";
        print '<td valign="top"><table id="summary" class="summary" style="border-color:grey;font-size:16px; border:1px solid ;border-color:grey" cellpadding=2 cellspacing=1 ' . '>' . "\n";
        echo "<tr colspan=2><td colspan=2 style='background: #D8D8DA url(http://yui.yahooapis.com/2.9.0/build/assets/skins/sam/sprite.png) repeat-x 0 0;text-align:center'>Overall Summary</td></tr>";
        foreach ($metrics as $metric) {
            echo "<tr>";
            echo "<td style=''>Total " . str_replace("<br>", " ", stat_description($metric)) . ":</td>";
            echo "<td>" . number_format($totals[$metric]) . " " . $possible_metrics[$metric][1] . "</td>";
            echo "</tr>";
        }
        if ($display_calls) {
            echo "<tr>";
            echo "<td style=' '>Number of Function Calls:</td>";
            echo "<td>" . number_format($totals['ct']) . "</td>";
            echo "</tr>";
        }
        echo "</table>";
        echo "</td></tr></table>";
        echo "<span>";
        echo '<button id="callgraph_button" style ="width:125px;margin:10px;margin-left:0px" type=button onClick="changeUrl(\'callgraph.php\')">Call Graph</button>';
        echo '<button id="piechart" style ="width:125px;margin:10px;" type=button onClick="changeUrl(\'piechart.php\')">Pie Chart</button>';
        echo "<button id='select_column' style ='width:125px;margin:10px;' type='button' >Select Column</button>";
        echo "<button id='display_all' style ='width:125px;margin:10px;'   type='button' >Display All</button>";
        echo "<span><a id='link_address_anchor' style='font-size:18px;color:#555;' href=''>Profile URL</a></span>";
        echo "<input id='fn-input' value='Function Search' style='width:200px;height:30px;margin:20px' onfocus='searchfield_focus()'  onKeyPress='display_page(event)' type='text'> ";
        echo "</span>";
        echo "</div>";
        $callgraph_report_title = '[View Full Callgraph]';
    }
    print "<div id='link_address' style='z-index:101;position: absolute; top: 222px; left:800px; display: block;' ></div>";
    print '<div style="margin:20px" id="top_data"></div>';
    print '<div style="margin:20px" id="basic"></div>';
    print "<style>.ui-dialog{left:600px;}</style>";
    print "<div><div id='checkbox_container' class='checkbox_container' ><span id='checkbox_loading'>Loading ...</span></div>";
    print "</div>";
    print "<div style='position:absolute;z-index:101;top:220px;left:500px;' id='searchFunction'  class='yui3-skin-sam  yui-skin-sam'>";
    print "</div>";
    $flat_data = array();
    foreach ($symbol_tab as $symbol => $info) {
        $tmp = $info;
        $tmp["fn"] = $symbol;
        $flat_data[] = $tmp;
    }
    usort($flat_data, 'sort_cbk');
    print "<br>";
    if (!empty($url_params['all'])) {
        $all = true;
        $limit = 0;
        // display all rows
    } else {
        $all = false;
        $limit = 100;
        // display only limited number of rows
    }
    $desc = str_replace("<br>", " ", $descriptions[$sort_col]);
    if ($diff_mode) {
        if ($all) {
            $title = "Total Diff Report: '\n               .'Sorted by absolute value of regression/improvement in {$desc}";
        } else {
            $title = "Top 100 <i style='color:red'>Regressions</i>/" . "<i style='color:green'>Improvements</i>: " . "Sorted by {$desc} Diff";
        }
    } else {
        if ($all) {
            $title = "Sorted by {$desc}";
        } else {
            $title = "Displaying top {$limit} functions: Sorted by {$desc}";
        }
    }
    print_flat_data($url_params, $title, $flat_data, $sort, $run1, $run2, $limit);
}
Exemplo n.º 4
0
/**
 * Generates a tabular report for all functions. This is the top-level report.
 *
 * @author Kannan
 */
function full_report($url_params, $symbol_tab, $sort, $run1, $run2)
{
    global $vwbar;
    global $vbar;
    global $totals;
    global $totals_1;
    global $totals_2;
    global $metrics;
    global $diff_mode;
    global $descriptions;
    global $sort_col;
    global $format_cbk;
    global $display_calls;
    global $base_path;
    $possible_metrics = xhprof_get_possible_metrics();
    if ($diff_mode) {
        $base_url_params = xhprof_array_unset(xhprof_array_unset($url_params, 'run1'), 'run2');
        $href1 = "{$base_path}/?" . http_build_query(xhprof_array_set($base_url_params, 'run', $run1));
        $href2 = "{$base_path}/?" . http_build_query(xhprof_array_set($base_url_params, 'run', $run2));
        //  print("<h3><center>Overall Diff Summary</center></h3>");
        /*    print('<div id="diff_page" class="title left hdblock">zPerfmon</div><br />');
            print('<div id="diff_page" class="title right hdblock">Profile Diff</div><br />');
            print('<table id="summary" style="margin:0px;border-color:grey;margin-top: 20px ;margin-left:20px;font-size:16px; border:1px solid ;border-color:grey">' . "\n");
            print('<tr style="background: #D8D8DA url(http://yui.yahooapis.com/2.9.0/build/assets/skins/sam/sprite.png) repeat-x 0 0;text-align:center" >');
            print("<th></th>");
            print("<th $vwbar>Profile1</th>");
            print("<th $vwbar>Profile2</th>");
            print("<th $vwbar>Diff</th>");
            print("<th $vwbar>Diff%</th>");
            print('</tr>');
            if ($display_calls) {
              print('<tr>');
              print("<td>Number of Function Calls</td>");
              print_td_num($totals_1["ct"], $format_cbk["ct"]);
              print_td_num($totals_2["ct"], $format_cbk["ct"]);
              print_td_num($totals_2["ct"] - $totals_1["ct"], $format_cbk["ct"], true);
              print_td_pct($totals_2["ct"] - $totals_1["ct"], $totals_1["ct"], true);
              print('</tr>');
            }
        
            foreach ($metrics as $metric) {
              $m = $metric;
              print('<tr>');
              print("<td>" . str_replace("<br>", " ", $descriptions[$m]) . "</td>");
              print_td_num($totals_1[$m], $format_cbk[$m]);
              print_td_num($totals_2[$m], $format_cbk[$m]);
              print_td_num($totals_2[$m] - $totals_1[$m], $format_cbk[$m], true);
              print_td_pct($totals_2[$m] - $totals_1[$m], $totals_1[$m], true);
              print('</tr>');
            }
        	$file1_arr = explode("/", $run1);
        	$file2_arr = explode("/", $run2);
        	$time_page1 = $file1_arr[count($file1_arr)-1];
        	$time_page2 = $file2_arr[count($file2_arr)-1];
            echo "<tr><td>Game:</td><td style= 'text-align:right'>".$file1_arr[count($file1_arr)-3]."</td><td style= 'text-align:right'>".$file2_arr[count($file2_arr)-3]."</td><td></td><td></td></tr>";
            echo "<tr><td>Page:</td><td style= 'text-align:right'>".substr($time_page1,11,strlen($time_page1)-18)."</td><td style= 'text-align:right'>".substr($time_page2,11,strlen($time_page2)-18)."</td><td></td><td></td></tr>";
            echo "<tr><td>Time Slot:</td><td>".date("Y/m/d H:i",(intval($time_page1.substr(0,10))+5.5*60*60)).date(" -  H:i",(intval($time_page1.substr(0,10))+6*60*60))."</td><td>".date("Y/m/d H:i",(intval($time_page2.substr(0,10))+5.5*60*60)).date(" -  H:i",(intval($time_page2.substr(0,10))+6*60*60))."</td><td></td><td></td></tr>";
            
            print('</table>');
        */
        $callgraph_report_title = '[View Regressions/Improvements using Callgraph Diff]';
    } else {
        //    print("<p><center>\n");
        /*    print('<div id="fn_info" style="margin:20px"><table id="summary" style="border-color:grey;font-size:16px; border:1px solid ;border-color:grey" cellpadding=2 cellspacing=1 '
                  .'>' . "\n");
            echo "<tr colspan=2><td colspan=2 style='background: #D8D8DA url(http://yui.yahooapis.com/2.9.0/build/assets/skins/sam/sprite.png) repeat-x 0 0;text-align:center'>Overall Summary</td></tr>";
        
            foreach ($metrics as $metric) {
              echo "<tr>";
              echo "<td style=''>Total "
                    . str_replace("<br>", " ", stat_description($metric)) . ":</td>";
              echo "<td>" . number_format($totals[$metric]) .  " "
                   . $possible_metrics[$metric][1] . "</td>";
              echo "</tr>";
            }
        
            if ($display_calls) {
              echo "<tr>";
              echo "<td style=' '>Number of Function Calls:</td>";
              echo "<td>" . number_format($totals['ct']) . "</td>";
              echo "</tr>";
            }
            $file_arr = explode("/", $url_params['file']);
            echo "<tr><td>Game:</td><td>".$file_arr[count($file_arr)-3]."</td></tr>";
            echo "<tr><td>Page:</td><td>".substr($run1,11)."</td></tr>";
            echo "<tr><td>Time Slot:</td><td>".date("Y/m/d H:i",(intval($run1.substr(0,10))+5.5*60*60)).date(" -  H:i",(intval($run1.substr(0,10))+6*60*60))."</td></tr>";
            echo "</table></div>";
        
            $callgraph_report_title = '[View Full Callgraph]';
        */
    }
    /*
      print("<div id='pie-chart1'></div>");
    //  print("<center><br><h3>" .
      //      xhprof_render_link($callgraph_report_title,
        //                "$base_path/callgraph.php" . "?" . http_build_query($url_params))
          //  . xhprof_render_link("[View PieChart]",
            //            "$base_path/piechart.php" . "?" . http_build_query($url_params))
    //        . "</h3></center>");
    echo('<button id="callgraph_button" style="position: absolute;z-index:101; top: 20px; left: 500px;" type=button onClick="javascript:var doc = document.location.toString();document.location = doc.substr(0,65)+\'callgraph.php\'+doc.substr(65)">&nbsp;&nbsp;Call Graph&nbsp;&nbsp;&nbsp;&nbsp;</button>');
    echo('<button id="piechart" style="z-index:101;position: absolute; top: 70px; left: 500px;" type=button onClick="javascript:var doc = document.location.toString();document.location = doc.substr(0,65)+\'piechart.php\'+doc.substr(65)">&nbsp;&nbsp;Pie Chart&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</button>');
    // document.location="."$base_path/callgraph.php" . "?" . http_build_query($url_params).">google</button>");
    //  print("</div>");
    
    
    
      print('<div style="margin:20px" id="top_data"></div>');
      print('<div style="margin:20px" id="basic"></div>');
      
      print("<button id='select_column' style='z-index:101;position: absolute; top: 120px; left: 500px; display: block;'id='show_checkbox' type='button' >Select Column</button>");
    //  print("<div id='checkbox_container' class='checkbox_container' style='background-color: white; top: 0px; left: 500px; height: 200px;width:150px; overflow-y: scroll; display: none; display:none;background-color:white'>");
      print("<style>.ui-dialog{left:600px;}</style>");
      print("<div><div id='checkbox_container' class='checkbox_container' ><span id='checkbox_loading'>Loading ...</span></div>");
      print("</div>");
      print("<div style='position:absolute;z-index:101;top:170px;left:500px;' id='searchFunction'  class='yui3-skin-sam  yui-skin-sam'>");
      print("<input id='fn-input' placeholder='Search a Function' style='width:200px;height:25px' onKeyPress='display_page(event)' type='text'> ");
      print("</div>");
    */
    $flat_data = array();
    foreach ($symbol_tab as $symbol => $info) {
        $tmp = $info;
        $tmp["fn"] = $symbol;
        $flat_data[] = $tmp;
    }
    usort($flat_data, 'sort_cbk');
    if (!empty($url_params['all'])) {
        $all = true;
        $limit = 0;
        // display all rows
    } else {
        $all = false;
        $limit = 100;
        // display only limited number of rows
    }
    $desc = str_replace("<br>", " ", $descriptions[$sort_col]);
    if ($diff_mode) {
        if ($all) {
            $title = "Total Diff Report: '\r\n               .'Sorted by absolute value of regression/improvement in {$desc}";
        } else {
            $title = "Top 100 <i style='color:red'>Regressions</i>/" . "<i style='color:green'>Improvements</i>: " . "Sorted by {$desc} Diff";
        }
    } else {
        if ($all) {
            $title = "Sorted by {$desc}";
        } else {
            $title = "Displaying top {$limit} functions: Sorted by {$desc}";
        }
    }
    print_flat_data($url_params, $title, $flat_data, $sort, $run1, $run2, $limit);
}
Exemplo n.º 5
0
/**
 * Generates a tabular report for all functions. This is the top-level report.
 *
 * @author Kannan
 */
function full_report($url_params, $symbol_tab)
{
    $callgraph_report_title = '<i class="fa fa-pie-chart"></i> View Full Callgraph';
    $callGraphUrl = \Sugarcrm\XHProf\Viewer\Templates\Helpers\UrlHelper::url(array('callgraph' => 1, 'dir' => CurrentPageHelper::getParam('dir'), 'run' => CurrentPageHelper::getParam('run')));
    $callGraphButton = '<a class="btn btn-primary btn-sm" target="_blank" href="' . $callGraphUrl . '">' . $callgraph_report_title . '</a>';
    $flat_data = array();
    foreach ($symbol_tab as $symbol => $info) {
        $tmp = $info;
        $tmp["fn"] = $symbol;
        if (!isset($tmp['bcc'])) {
            $tmp['bcc'] = '';
        }
        $flat_data[] = $tmp;
    }
    usort($flat_data, 'sort_cbk');
    if (!empty($url_params['all'])) {
        $limit = 0;
        // display all rows
    } else {
        $limit = 100;
        // display only limited number of rows
    }
    print_flat_data('Top-Level Report &nbsp;', $flat_data, $limit, $callGraphButton);
}
Exemplo n.º 6
0




//var_dump(grade_report_user_profilereport());
//var_dump($unavailableactivites);
echo $OUTPUT->footer();



print <<<END


END;
print_flat_data();
function printdataact($cname,$activity_type,$activity_name,$description,$no_of_submission,$act_grade){
    print <<<END
<div class="jumbotron">
<div class="new">
<div class="span2 imagecours1">
<div class="tleft">
<div class="coursename">
END;
    echo $cname;
    print <<<END

</div>
<div class="topicname">
END;
echo $activity_type;