include/SugarXHprof/xhprof_lib/utils/callgraph_utils.php
Functions
xhprof_generate_dot_script(
\raw_data, $raw_data, \threshold, $threshold, \page, $source, \func, $page, \critical_path, $func, $critical_path, $right
=
null, $left
=
null
)
:
voidGenerate DOT script from the given raw phprof data.
| Name | Type | Description |
|---|---|---|
| $raw_data | \raw_data, | phprof profile data. |
| $threshold | \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. |
| $source | \page, | string(optional), the root node name. This can be used to replace the 'main()' as the root node. |
| $page | \func, | string, the focus function. |
| $func | \critical_path, | bool, whether or not to display critical path with bold lines. |
| $critical_path | ||
| $right | ||
| $left |
- Author
- cjiang
- Returns
- , string, the DOT script to generate image.
xhprof_generate_image_by_dot(
\dot_script, $dot_script, \type, $type
)
:
voidGenerate image according to DOT script. This function will spawn a process with "dot" command and pipe the "dot_script" to it and pipe out the generated image content.
| Name | Type | Description |
|---|---|---|
| $dot_script | \dot_script, | string, the script for DOT to generate the image. |
| $type | \type, | one of the supported image types, see $xhprof_legal_image_types. |
- Author
- cjiang
- Returns
- , binary content of the generated image on success. empty string on failure.
xhprof_generate_mime_header(
$type, $length
)
:
voidGenearte and send MIME header for the output image to client browser.
| Name | Type | Description |
|---|---|---|
| $type | ||
| $length |
- Author
- cjiang
xhprof_get_content_by_run(
object $xhprof_runs_impl, \run_id, $run_id, \type, $type, \threshold, $threshold, \func, $func, $source, $critical_path
)
:
voidGenerate image content from phprof run id.
| Name | Type | Description |
|---|---|---|
| $xhprof_runs_impl | object | An object that implements the iXHProfRuns interface |
| $run_id | \run_id, | integer, the unique id for the phprof run, this is the primary key for phprof database table. |
| $type | \type, | string, one of the supported image types. See also $xhprof_legal_image_types. |
| $threshold | \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 | \func, | string, the focus function. |
| $source | ||
| $critical_path |
- Author
- cjiang
- Returns
- , string, the DOT script to generate image.
xhprof_http_header(
string $name, string $value
)
:
voidSend an HTTP header with the response. 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.
| Name | Type | Description |
|---|---|---|
| $name | string | HTTP header name, like 'Location' |
| $value | string | HTTP header value, like 'http://www.example.com/' |
xhprof_render_diff_image(
$xhprof_runs_impl, $run1, $run2, $type, $threshold, $source
)
:
void| Name | Type | Description |
|---|---|---|
| $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
)
:
voidGenerate image from phprof run id and send it to client.
| Name | Type | Description |
|---|---|---|
| $xhprof_runs_impl | object | An object that implements the iXHProfRuns interface |
| $run_id | \run_id, | integer, the unique id for the phprof run, this is the primary key for phprof database table. |
| $type | \type, | string, one of the supported image types. See also $xhprof_legal_image_types. |
| $threshold | \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 | \func, | string, the focus function. |
| $source | \bool, | does this run correspond to a PHProfLive run or a dev run? |
| $critical_path |
- Author
- cjiang