|
Moodle
2.2.1
http://www.collinsharper.com
|
Go to the source code of this file.
| enum XHPROF_BOOL_PARAM |
Definition at line 730 of file xhprof_lib.php.
| enum XHPROF_FLOAT_PARAM |
Definition at line 729 of file xhprof_lib.php.
| enum XHPROF_STRING_PARAM |
Type definitions for URL params
Definition at line 727 of file xhprof_lib.php.
| enum XHPROF_UINT_PARAM |
Definition at line 728 of file xhprof_lib.php.
| init_metrics | ( | $ | xhprof_data, |
| $ | rep_symbol, | ||
| $ | sort, | ||
| $ | diff_report = false |
||
| ) |
Initialize the metrics we'll display based on the information in the raw data.
Definition at line 50 of file xhprof_lib.php.


| xhprof_aggregate_runs | ( | $ | xhprof_runs_impl, |
| $ | runs, | ||
| $ | wts, | ||
| $ | source = "phprof", |
||
| $ | use_script_name = false |
||
| ) |
Get raw data corresponding to specified array of runs aggregated by certain weightage.
Suppose you have run:5 corresponding to page1.php, run:6 corresponding to page2.php, and run:7 corresponding to page3.php
and you want to accumulate these runs in a 2:4:1 ratio. You can do so by calling:
xhprof_aggregate_runs(array(5, 6, 7), array(2, 4, 1));
The above will return raw data for the runs aggregated in 2:4:1 ratio.
| object | $xhprof_runs_impl | An object that implements the iXHProfRuns interface |
| array | $runs | run ids of the XHProf runs.. |
| array | $wts | integral (ideally) weights for $runs |
| string | $source | source to fetch raw data for run from |
| bool | $use_script_name | If true, a fake edge from main() to to __script::<scriptname> is introduced in the raw data so that after aggregations the script name is still preserved. |
Definition at line 320 of file xhprof_lib.php.


| xhprof_array_set | ( | $ | arr, |
| $ | k, | ||
| $ | v | ||
| ) |
Set one key in an array and return the array
Definition at line 709 of file xhprof_lib.php.

| xhprof_array_unset | ( | $ | arr, |
| $ | k | ||
| ) |
Removes/unsets one key in an array and return the array
Definition at line 719 of file xhprof_lib.php.

| xhprof_build_parent_child_key | ( | $ | parent, |
| $ | child | ||
| ) |
Given parent & child function name, composes the key in the format present in the raw data.
Definition at line 165 of file xhprof_lib.php.

| xhprof_compute_diff | ( | $ | xhprof_data1, |
| $ | xhprof_data2 | ||
| ) |
Hierarchical diff: Compute and return difference of two call graphs: Run2 - Run1.
Definition at line 516 of file xhprof_lib.php.


| xhprof_compute_flat_info | ( | $ | raw_data, |
| &$ | overall_totals | ||
| ) |
Analyze hierarchical raw data, and compute per-function (flat) inclusive and exclusive metrics.
Also, store overall totals in the 2nd argument.
| array | $raw_data | XHProf format raw profiler data. |
| array | &$overall_totals | OUT argument for returning overall totals for various metrics. |
Definition at line 454 of file xhprof_lib.php.


| xhprof_compute_inclusive_times | ( | $ | raw_data | ) |
Compute inclusive metrics for function. This code was factored out of xhprof_compute_flat_info().
The raw data contains inclusive metrics of a function for each unique parent function it is called from. The total inclusive metrics for a function is therefore the sum of inclusive metrics for the function across all parents.
Definition at line 567 of file xhprof_lib.php.


| xhprof_error | ( | $ | message | ) |
| xhprof_get_bool_param | ( | $ | param, |
| $ | default = false |
||
| ) |
Extracts value for a boolean param $param from query string. If param is not specified, return the $default value.
If value is not a valid unsigned integer, logs error and returns null.
Definition at line 834 of file xhprof_lib.php.


| xhprof_get_float_param | ( | $ | param, |
| $ | default = 0 |
||
| ) |
Extracts value for a float param $param from query string. If param is not specified, return the $default value.
If value is not a valid unsigned integer, logs error and returns null.
Definition at line 807 of file xhprof_lib.php.


| xhprof_get_matching_functions | ( | $ | q, |
| $ | xhprof_data | ||
| ) |
Given a partial query string $q return matching function names in specified XHProf run. This is used for the type ahead function selector.
Definition at line 921 of file xhprof_lib.php.

| xhprof_get_metrics | ( | $ | xhprof_data | ) |
Definition at line 125 of file xhprof_lib.php.


| xhprof_get_param_helper | ( | $ | param | ) |
Internal helper function used by various xhprof_get_param* flavors for various types of parameters.
| string | name of the URL query string param |
Definition at line 742 of file xhprof_lib.php.

| xhprof_get_string_param | ( | $ | param, |
| $ | default = '' |
||
| ) |
Extracts value for string param $param from query string. If param is not specified, return the $default value.
Definition at line 759 of file xhprof_lib.php.


| xhprof_get_uint_param | ( | $ | param, |
| $ | default = 0 |
||
| ) |
Extracts value for unsigned integer param $param from query string. If param is not specified, return the $default value.
If value is not a valid unsigned integer, logs error and returns null.
Definition at line 778 of file xhprof_lib.php.


| xhprof_normalize_metrics | ( | $ | raw_data, |
| $ | num_runs | ||
| ) |
Takes raw XHProf data that was aggregated over "$num_runs" number of runs averages/nomalizes the data. Essentially the various metrics collected are divided by $num_runs.
Definition at line 268 of file xhprof_lib.php.


| xhprof_param_init | ( | $ | params | ) |
Initialize params from URL query string. The function creates globals variables for each of the params and if the URL query string doesn't specify a particular param initializes them with the corresponding default value specified in the input.
array $params An array whose keys are the names of URL params who value needs to be retrieved from the URL query string. PHP globals are created with these names. The value is itself an array with 2-elems (the param type, and its default value). If a param is not specified in the query string the default value is used.
Definition at line 886 of file xhprof_lib.php.

| xhprof_parse_parent_child | ( | $ | parent_child | ) |
Takes a parent/child function name encoded as "a==>b" and returns array("a", "b").
Definition at line 148 of file xhprof_lib.php.

| xhprof_prune_run | ( | $ | raw_data, |
| $ | prune_percent | ||
| ) |
| xhprof_trim_run | ( | $ | raw_data, |
| $ | functions_to_keep | ||
| ) |
Return a trimmed version of the XHProf raw data. Note that the raw data contains one entry for each unique parent/child function combination.The trimmed version of raw data will only contain entries where either the parent or child function is in the list of $functions_to_keep.
Note: Function main() is also always kept so that overall totals can still be obtained from the trimmed version.
| array | XHProf raw data |
| array | array of function names |
Definition at line 240 of file xhprof_lib.php.


| xhprof_valid_run | ( | $ | run_id, |
| $ | raw_data | ||
| ) |
Checks if XHProf raw data appears to be valid and not corrupted.
| int | $run_id | Run id of run to be pruned. [Used only for reporting errors.] |
| array | $raw_data | XHProf raw data to be pruned & validated. |
Definition at line 186 of file xhprof_lib.php.

