include/SugarXHprof/xhprof_lib/display/xhprof.php
Functions
displayXHProfReport(
object $xhprof_runs_impl, array $url_params, string $source, string $run, string $wts, string $symbol, $sort, string $run1, string $run2
)
:
voidGenerate a XHProf Display View given the various URL parameters as arguments. The first argument is an object that implements the iXHProfRuns interface.
| Name | Type | Description |
|---|---|---|
| $xhprof_runs_impl | object | An object that implements the iXHProfRuns interface . |
| $url_params | array | Array of non-default URL params. |
| $source | string | Category/type of the run. The source in combination with the run id uniquely determines a profiler run. |
| $run | string | run id, or comma separated sequence of run ids. The latter is used if an aggregate report of the runs is desired. |
| $wts | string | Comma separate list of integers. Represents the weighted ratio in which which a set of runs will be aggregated. [Used only for aggregate reports.] |
| $symbol | string | Function symbol. If non-empty then the parent/child view of this function is displayed. If empty, a flat-profile view of the functions is displayed. |
| $sort | ||
| $run1 | string | Base run id (for diff reports) |
| $run2 | string | New run id (for diff reports) |
full_report(
$url_params, $symbol_tab, $sort, $run1, $run2
)
:
voidGenerates a tabular report for all functions. This is the top-level report.
| Name | Type | Description |
|---|---|---|
| $url_params | ||
| $symbol_tab | ||
| $sort | ||
| $run1 | ||
| $run2 |
- Author
- Kannan
get_print_class(
$num, $bold
)
:
voidGiven 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.
| Name | Type | Description |
|---|---|---|
| $num | ||
| $bold |
get_tooltip_attributes(
$type, $metric
)
:
voidReturn attribute names and values to be used by javascript tooltip.
| Name | Type | Description |
|---|---|---|
| $type | ||
| $metric |
pc_info(
$info, $base_ct, $base_info, $parent
)
:
voidPrint info for a parent or child function in the parent & children report.
| Name | Type | Description |
|---|---|---|
| $info | ||
| $base_ct | ||
| $base_info | ||
| $parent |
- Author
- Kannan
pct(
$a, $b
)
:
voidComputes percentage for a pair of values, and returns it in string format.
| Name | Type | Description |
|---|---|---|
| $a | ||
| $b |
print_flat_data(
$url_params, $title, $flat_data, $sort, $run1, $run2, $limit
)
:
voidPrint non-hierarchical (flat-view) of profiler data.
| Name | Type | Description |
|---|---|---|
| $url_params | ||
| $title | ||
| $flat_data | ||
| $sort | ||
| $run1 | ||
| $run2 | ||
| $limit |
- Author
- Kannan
print_function_info(
$url_params, $info, $sort, $run1, $run2
)
:
voidPrint "flat" data corresponding to one function.
| Name | Type | Description |
|---|---|---|
| $url_params | ||
| $info | ||
| $sort | ||
| $run1 | ||
| $run2 |
- Author
- Kannan
print_pc_array(
$url_params, $results, $base_ct, $base_info, $parent, $run1, $run2
)
:
void| Name | Type | Description |
|---|---|---|
| $url_params | ||
| $results | ||
| $base_ct | ||
| $base_info | ||
| $parent | ||
| $run1 | ||
| $run2 |
print_symbol_summary(
$symbol_info, $stat, $base
)
:
void| Name | Type | Description |
|---|---|---|
| $symbol_info | ||
| $stat | ||
| $base |
print_td_num(
$num, $fmt_func, $bold
=
false, $attributes
=
null
)
:
voidPrints a
| Name | Type | Description |
|---|---|---|
| $num | ||
| $fmt_func | ||
| $bold | ||
| $attributes |
print_td_pct(
$numer, $denom, $bold
=
false, $attributes
=
null
)
:
voidPrints a
| Name | Type | Description |
|---|---|---|
| $numer | ||
| $denom | ||
| $bold | ||
| $attributes |
profiler_diff_report(
$url_params, $xhprof_data1, $run1_desc, $xhprof_data2, $run2_desc, $rep_symbol, $sort, $run1, $run2
)
:
voidGenerate the profiler report for diff mode (delta between two runs).
| Name | Type | Description |
|---|---|---|
| $url_params | ||
| $xhprof_data1 | ||
| $run1_desc | ||
| $xhprof_data2 | ||
| $run2_desc | ||
| $rep_symbol | ||
| $sort | ||
| $run1 | ||
| $run2 |
- Author
- Kannan
profiler_report(
$url_params, $rep_symbol, $sort, $run1, $run1_desc, $run1_data, $run2
=
0, $run2_desc
=
"", $run2_data
=
array()
)
:
voidAnalyze raw data & generate the profiler report (common for both single run mode and diff mode).
| Name | Type | Description |
|---|---|---|
| $url_params | ||
| $rep_symbol | ||
| $sort | ||
| $run1 | ||
| $run1_desc | ||
| $run1_data | ||
| $run2 | ||
| $run2_desc | ||
| $run2_data |
- Author
- : Kannan
profiler_single_run_report(
$url_params, $xhprof_data, $run_desc, $rep_symbol, $sort, $run
)
:
voidGenerate the profiler report for a single run.
| Name | Type | Description |
|---|---|---|
| $url_params | ||
| $xhprof_data | ||
| $run_desc | ||
| $rep_symbol | ||
| $sort | ||
| $run |
- Author
- Kannan
sort_cbk(
$a, $b
)
:
voidCallback 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).
| Name | Type | Description |
|---|---|---|
| $a | ||
| $b |
- Author
- Kannan
stat_description(
$stat
)
:
voidGet the appropriate description for a statistic (depending upon whether we are in diff report mode or single run report mode).
| Name | Type | Description |
|---|---|---|
| $stat |
- Author
- Kannan
symbol_report(
$url_params, $run_data, $symbol_info, $sort, $rep_symbol, $run1, $symbol_info1
=
null, $run2
=
0, $symbol_info2
=
null
)
:
voidGenerates a report for a single function/symbol.
| Name | Type | Description |
|---|---|---|
| $url_params | ||
| $run_data | ||
| $symbol_info | ||
| $sort | ||
| $rep_symbol | ||
| $run1 | ||
| $symbol_info1 | ||
| $run2 | ||
| $symbol_info2 |
- Author
- Kannan
xhprof_include_js_css(
$ui_dir_url_path
=
null
)
:
voidGenerate 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.
| Name | Type | Description |
|---|---|---|
| $ui_dir_url_path |
xhprof_render_actions(
$actions
)
:
voidImplodes the text for a bunch of actions (such as links, forms, into a HTML list and returns the text.
| Name | Type | Description |
|---|---|---|
| $actions |
xhprof_render_link(
\html-str $content, \raw-str $href, \raw-str $class
=
'', \raw-str $id
=
'', \raw-str $title
=
'', \raw-str $target
=
'', \raw-str $onclick
=
'', \raw-str $style
=
'', \raw-str $access
=
'', \raw-str $onmouseover
=
'', \raw-str $onmouseout
=
'', \raw-str $onmousedown
=
''
)
:
void| Name | Type | Description |
|---|---|---|
| $content | \html-str | the text/image/innerhtml/whatever for the link |
| $href | \raw-str | |
| $class | \raw-str | |
| $id | \raw-str | |
| $title | \raw-str | |
| $target | \raw-str | |
| $onclick | \raw-str | |
| $style | \raw-str | |
| $access | \raw-str | |
| $onmouseover | \raw-str | |
| $onmouseout | \raw-str | |
| $onmousedown | \raw-str |