Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 4.3.x will end 7 October 2024 (12 months).
  • Bug fixes for security issues in 4.3.x will end 21 April 2025 (18 months).
  • PHP version: minimum PHP 8.0.0 Note: minimum PHP version has increased since Moodle 4.1. PHP 8.2.x is supported too.

Differences Between: [Versions 310 and 403] [Versions 311 and 403] [Versions 39 and 403]

Our coding convention disallows relative paths in hrefs. Get the base URL path from the SCRIPT_NAME.

File Size: 1442 lines (45 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 24 functions


Functions that are not part of a class:

xhprof_include_js_css($ui_dir_url_path = null)   X-Ref
Generate references to required stylesheets & javascript.

If the calling script (such as index.php) resides in
a different location that than 'xhprof_html' directory the
caller must provide the URL path to 'xhprof_html' directory
so that the correct location of the style sheets/javascript
can be specified in the generated HTML.


xhprof_count_format($num)   X-Ref
No description

xhprof_percent_format($s, $precision = 1)   X-Ref
No description

xhprof_render_actions($actions)   X-Ref
Implodes the text for a bunch of actions (such as links, forms,
into a HTML list and returns the text.


xhprof_render_link($content, $href, $class='', $id='', $title='',$target='',$onclick='', $style='', $access='', $onmouseover='',$onmouseout='', $onmousedown='')   X-Ref

param: html-str $content  the text/image/innerhtml/whatever for the link
param: raw-str  $href
param: raw-str  $class
param: raw-str  $id
param: raw-str  $title
param: raw-str  $target
param: raw-str  $onclick
param: raw-str  $style
param: raw-str  $access
param: raw-str  $onmouseover
param: raw-str  $onmouseout
param: raw-str  $onmousedown
param: raw-str  $dir
param: raw-str  $rel

sort_cbk($a, $b)   X-Ref
Callback comparison operator (passed to usort() for sorting array of
tuples) that compares array elements based on the sort column
specified in $sort_col (global parameter).

author: Kannan

stat_description($stat)   X-Ref
Get the appropriate description for a statistic
(depending upon whether we are in diff report mode
or single run report mode).

author: Kannan

profiler_report($url_params,$rep_symbol,$sort,$run1,$run1_desc,$run1_data,$run2 = 0,$run2_desc = "",$run2_data = array()   X-Ref
Analyze raw data & generate the profiler report
(common for both single run mode and diff mode).

author: : Kannan

pct($a, $b)   X-Ref
Computes percentage for a pair of values, and returns it
in string format.


get_print_class($num, $bold)   X-Ref
Given a number, returns the td class to use for display.

For instance, negative numbers in diff reports comparing two runs (run1 & run2)
represent improvement from run1 to run2. We use green to display those deltas,
and red for regression deltas.

print_td_num($num, $fmt_func, $bold=false, $attributes=null)   X-Ref
Prints a <td> element with a numeric value.


print_td_pct($numer, $denom, $bold=false, $attributes=null)   X-Ref
Prints a <td> element with a pecentage.


print_function_info($url_params, $info, $sort, $run1, $run2)   X-Ref
Print "flat" data corresponding to one function.

author: Kannan

print_flat_data($url_params, $title, $flat_data, $sort, $run1, $run2, $limit)   X-Ref
Print non-hierarchical (flat-view) of profiler data.

author: Kannan

full_report($url_params, $symbol_tab, $sort, $run1, $run2)   X-Ref
Generates a tabular report for all functions. This is the top-level report.

author: Kannan

get_tooltip_attributes($type, $metric)   X-Ref
Return attribute names and values to be used by javascript tooltip.


pc_info($info, $base_ct, $base_info, $parent)   X-Ref
Print info for a parent or child function in the
parent & children report.

author: Kannan

print_pc_array($url_params, $results, $base_ct, $base_info, $parent,$run1, $run2)   X-Ref
No description

print_source_link($info)   X-Ref
No description

print_symbol_summary($symbol_info, $stat, $base)   X-Ref
No description

symbol_report($url_params,$run_data, $symbol_info, $sort, $rep_symbol,$run1,$symbol_info1 = null,$run2 = 0,$symbol_info2 = null)   X-Ref
Generates a report for a single function/symbol.

author: Kannan

profiler_single_run_report($url_params,$xhprof_data,$run_desc,$rep_symbol,$sort,$run)   X-Ref
Generate the profiler report for a single run.

author: Kannan

profiler_diff_report($url_params,$xhprof_data1,$run1_desc,$xhprof_data2,$run2_desc,$rep_symbol,$sort,$run1,$run2)   X-Ref
Generate the profiler report for diff mode (delta between two runs).

author: Kannan

displayXHProfReport($xhprof_runs_impl, $url_params, $source,$run, $wts, $symbol, $sort, $run1, $run2)   X-Ref
Generate a XHProf Display View given the various URL parameters
as arguments. The first argument is an object that implements
the iXHProfRuns interface.

param: object  $xhprof_runs_impl  An object that implements
param: array   $url_params   Array of non-default URL params.
param: string  $source       Category/type of the run. The source in
param: string  $run          run id, or comma separated sequence of
param: string  $wts          Comma separate list of integers.
param: string  $symbol       Function symbol. If non-empty then the
param: string  $run1         Base run id (for diff reports)
param: string  $run2         New run id (for diff reports)