XHProf: Difference between revisions

No edit summary
m Text replacement - "<(\/?)source" to "<$1syntaxhighlight"
Line 18: Line 18:
== TLDR; ==
== TLDR; ==
<ref>https://github.com/phacility/xhprof/issues/82#issuecomment-294003346</ref>
<ref>https://github.com/phacility/xhprof/issues/82#issuecomment-294003346</ref>
<source lang="bash">
<syntaxhighlight lang="bash">
git clone https://github.com/longxinH/xhprof
git clone https://github.com/longxinH/xhprof
cd xhprof/extension
cd xhprof/extension
Line 35: Line 35:


xhprof_enable(XHPROF_FLAGS_CPU + XHPROF_FLAGS_MEMORY);
xhprof_enable(XHPROF_FLAGS_CPU + XHPROF_FLAGS_MEMORY);
</source>
</syntaxhighlight>


Your code:
Your code:
<source lang="php">
<syntaxhighlight lang="php">
$xhprof_data = xhprof_disable();
$xhprof_data = xhprof_disable();
include_once  '/var/www/xhprof/xhprof_lib/utils/xhprof_lib.php';
include_once  '/var/www/xhprof/xhprof_lib/utils/xhprof_lib.php';
Line 46: Line 46:
echo "<a href='http://xhprof/index.php?run={$run_id}&source=your_project' target='_blank'>profile</a>";
echo "<a href='http://xhprof/index.php?run={$run_id}&source=your_project' target='_blank'>profile</a>";
#http://xhprof is my localhost
#http://xhprof is my localhost
</source>
</syntaxhighlight>


[[Category:Debugging]]
[[Category:Debugging]]