You are here

function xhprof_print_function_info in XHProf 7

Same name and namespace in other branches
  1. 6 xhprof.inc \xhprof_print_function_info()

Print "flat" data corresponding to one function.

@author Kannan

File

./xhprof.inc, line 751

Code

function xhprof_print_function_info($url_params, $info, $sort, $run1, $run2) {
  global $totals;
  global $sort_col;
  global $metrics;
  global $format_cbk;
  global $display_calls;
  global $base_path;
  $output = '';
  $href = "{$base_path}/?" . http_build_query(xhprof_array_set($url_params, 'symbol', $info["fn"]));

  //$output .= '<td>';

  //$output .= xhprof_xhprof_render_link($info["fn"], $href);
  if ($display_calls) {

    // Call Count..
    $output .= xhprof_print_num_cell($info["ct"], $format_cbk["ct"], $sort_col == "ct");
    $output .= xhprof_print_pct_cell($info["ct"], $totals["ct"], $sort_col == "ct");
  }

  // Other metrics..
  foreach ($metrics as $metric) {

    // Inclusive metric
    $output .= xhprof_print_num_cell($info[$metric], $format_cbk[$metric], $sort_col == $metric);
    $output .= xhprof_print_pct_cell($info[$metric], $totals[$metric], $sort_col == $metric);

    // Exclusive Metric
    $output .= xhprof_print_num_cell($info["excl_" . $metric], $format_cbk["excl_" . $metric], $sort_col == "excl_" . $metric);
    $output .= xhprof_print_pct_cell($info["excl_" . $metric], $totals[$metric], $sort_col == "excl_" . $metric);
  }
  return $output;
}