XHProf: Difference between revisions
No edit summary |
No edit summary |
||
| (3 intermediate revisions by the same user not shown) | |||
| Line 1: | Line 1: | ||
XHProf is enabled in QualityBox to create the [//{{SERVERNAME}}/ServerPerformance Server Performance] graphs. | XHProf is enabled in [[ QualityBox]] to <strike>create the [//{{SERVERNAME}}/ServerPerformance Server Performance] graphs.</strike> (that's regular mysql). We use XHProf for actual profiling; which is turned off by default. | ||
== Profiling your Wiki == | == Profiling your Wiki == | ||
| 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> | ||
< | <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); | ||
</ | </syntaxhighlight> | ||
Your code: | Your code: | ||
< | <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 | ||
</ | </syntaxhighlight> | ||
[[Category:Debugging]] | [[Category:Debugging]] | ||