createPackager(string $original_file, string[] $options) : \PEAR_Error | \PEAR_PackageFileManager2
stringPath of the original package.xml.
string[]Set of options to merge in.
\PEAR_Error\PEAR_PackageFileManager2
displayXHProfReport(object $xhprof_runs_impl, array $url_params, string $source, string $run, string $wts, string $symbol, $sort, string $run1, string $run2)
The first argument is an object that implements the iXHProfRuns interface.
objectAn object that implements the iXHProfRuns interface .
arrayArray of non-default URL params.
stringCategory/type of the run. The source in combination with the run id uniquely determines a profiler run.
stringrun id, or comma separated sequence of run ids. The latter is used if an aggregate report of the runs is desired.
stringComma separate list of integers. Represents the weighted ratio in which which a set of runs will be aggregated. [Used only for aggregate reports.]
stringFunction 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.
stringBase run id (for diff reports)
stringNew run id (for diff reports)
full_report($url_params, $symbol_tab, $sort, $run1, $run2)
get_print_class($num, $bold)
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.
get_tooltip_attributes($type, $metric)
init_metrics($xhprof_data, $rep_symbol, $sort, $diff_report)
pc_info($info, $base_ct, $base_info, $parent)
pct($a, $b)
print_flat_data($url_params, $title, $flat_data, $sort, $run1, $run2, $limit)
print_function_info($url_params, $info, $sort, $run1, $run2)
print_pc_array($url_params, $results, $base_ct, $base_info, $parent, $run1, $run2)
print_symbol_summary($symbol_info, $stat, $base)
print_td_num($num, $fmt_func, $bold, $attributes)
print_td_pct($numer, $denom, $bold, $attributes)
profiler_diff_report($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, $run2_desc, $run2_data)
| author | : Kannan |
|---|
profiler_single_run_report($url_params, $xhprof_data, $run_desc, $rep_symbol, $sort, $run)
sort_cbk($a, $b)
stat_description($stat)
symbol_report($url_params, $run_data, $symbol_info, $sort, $rep_symbol, $run1, $symbol_info1, $run2, $symbol_info2)
| author | Kannan |
|---|
xhprof_aggregate_runs(object $xhprof_runs_impl, $runs, $wts, $source, $use_script_name)
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.
objectAn object that implements
the iXHProfRuns interface
@param array $runs run ids of the XHProf runs..
@param array $wts integral (ideally) weights for $runs
@param string $source source to fetch raw data for run from
@param bool $use_script_name If true, a fake edge from main() to
to __script::
xhprof_array_set($arr, $k, $v)
xhprof_array_unset($arr, $k)
xhprof_build_parent_child_key($parent, $child)
xhprof_compute_diff($xhprof_data1, $xhprof_data2)
xhprof_compute_flat_info(array $raw_data, array $overall_totals) : array
Also, store overall totals in the 2nd argument.
| author | Kannan Muthukkaruppan |
|---|
arrayXHProf format raw profiler data.
array&$overall_totals OUT argument for returning overall totals for various metrics.
arrayReturns a map from function name to its
call count and inclusive & exclusive metrics
(such as wall time, etc.).xhprof_compute_inclusive_times($raw_data) : array
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.
| author | Kannan |
|---|
arrayReturns a map of function name to total (across all parents)
inclusive metrics for the function.xhprof_count_format($num)
xhprof_error($message)
xhprof_generate_dot_script(\raw_data, $raw_data, \threshold, $threshold, \page, $source, \func, $page, \critical_path, $func, $critical_path, $right, $left)
| returns | , string, the DOT script to generate image. |
|---|---|
| author | cjiang |
\raw_data,phprof profile data.
\threshold,float, the threshold value [0,1). The functions in the raw_data whose exclusive wall times ratio are below the threshold will be filtered out and won't apprear in the generated image.
\page,string(optional), the root node name. This can be used to replace the 'main()' as the root node.
\func,string, the focus function.
\critical_path,bool, whether or not to display critical path with bold lines.
xhprof_generate_image_by_dot(\dot_script, $dot_script, \type, $type)
This function will spawn a process with "dot" command and pipe the "dot_script" to it and pipe out the generated image content.
| returns | , binary content of the generated image on success. empty string on failure. |
|---|---|
| author | cjiang |
\dot_script,string, the script for DOT to generate the image.
\type,one of the supported image types, see $xhprof_legal_image_types.
xhprof_generate_mime_header($type, $length)
xhprof_get_bool_param($param, $default)
If param is not specified, return the $default value.
If value is not a valid unsigned integer, logs error and returns null.
| author | Kannan |
|---|
xhprof_get_children_table($raw_data)
xhprof_get_content_by_run(object $xhprof_runs_impl, \run_id, $run_id, \type, $type, \threshold, $threshold, \func, $func, $source, $critical_path)
| returns | , string, the DOT script to generate image. |
|---|---|
| author | cjiang |
objectAn object that implements the iXHProfRuns interface
\run_id,integer, the unique id for the phprof run, this is the primary key for phprof database table.
\type,string, one of the supported image types. See also $xhprof_legal_image_types.
\threshold,float, the threshold value [0,1). The functions in the raw_data whose exclusive wall times ratio are below the threshold will be filtered out and won't apprear in the generated image.
\func,string, the focus function.
xhprof_get_float_param($param, $default)
If param is not specified, return the $default value.
If value is not a valid unsigned integer, logs error and returns null.
| author | Kannan |
|---|
xhprof_get_matching_functions($q, $xhprof_data)
xhprof_get_metrics($xhprof_data)
xhprof_get_param_helper(string $param)
xhprof_get_possible_metrics()
xhprof_get_string_param($param, $default)
xhprof_get_uint_param($param, $default)
If param is not specified, return the $default value.
If value is not a valid unsigned integer, logs error and returns null.
| author | Kannan |
|---|
xhprof_http_header(string $name, string $value)
You MUST use this function instead of header() so that we can debug header issues because they're virtually impossible to debug otherwise. If you try to commit header(), SVN will reject your commit.
stringHTTP header name, like 'Location'
stringHTTP header value, like 'http://www.example.com/'
xhprof_include_js_css($ui_dir_url_path)
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_normalize_metrics($raw_data, $num_runs)
Essentially the various metrics collected are divided by $num_runs.
| author | Kannan |
|---|
xhprof_param_init($params)
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.
| params | 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. |
|---|---|
| author | Kannan |
xhprof_parse_parent_child($parent_child)
xhprof_percent_format($s, $precision)
xhprof_prune_run($raw_data, $prune_percent)
xhprof_render_actions($actions)
xhprof_render_diff_image($xhprof_runs_impl, $run1, $run2, $type, $threshold, $source)
xhprof_render_image(object $xhprof_runs_impl, \run_id, $run_id, \type, $type, \threshold, $threshold, \func, $func, \bool, $source, $critical_path)
| author | cjiang |
|---|
objectAn object that implements the iXHProfRuns interface
\run_id,integer, the unique id for the phprof run, this is the primary key for phprof database table.
\type,string, one of the supported image types. See also $xhprof_legal_image_types.
\threshold,float, the threshold value [0,1). The functions in the raw_data whose exclusive wall times ratio are below the threshold will be filtered out and won't apprear in the generated image.
\func,string, the focus function.
\bool,does this run correspond to a PHProfLive run or a dev run?
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)
\html-strthe text/image/innerhtml/whatever for the link
\raw-str
\raw-str
\raw-str
\raw-str
\raw-str
\raw-str
\raw-str
\raw-str
\raw-str
\raw-str
\raw-str
xhprof_trim_run(array $raw_data, array $functions_to_keep) : array
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.
| author | Kannan |
|---|
arrayXHProf raw data
arrayarray of function names
arrayTrimmed XHProf Reportxhprof_valid_run($run_id, array $raw_data)
@param int $run_id Run id of run to be pruned. [Used only for reporting errors.]
arrayXHProf raw data to be pruned & validated. @return bool true on success, false on failure @author Kannan
XHProfRuns_Default is the default implementation of the iXHProfRuns interface for saving/fetching XHProf runs.
« More »XHPROF_BOOL_PARAM
XHPROF_FLOAT_PARAM
XHPROF_STRING_PARAM
XHPROF_UINT_PARAM