Closed MarkRose closed 5 years ago
If you add ?_profile=1
, it will set a cookie that triggers profiling. When the cookie is present $_xhprof['doprofile']
is set to true
.
If $_xhprof['doprofile']
is false
, then lines 108 through 117 will randomly trigger profiling, with a 1 in $weight
chance. $weight
is set in config.php
. Without this patch, there is no way to disable the random profiling from occurring. With this patch, setting $weight
to 0
(or any falsy value) will disable the random profiling.
I see. Then I like this change.
Merging, thanks @MarkRose .
I've usually add
?_profile=1
to the URL and after redirect all pages on website are profile. Maybe that is an indication that random profiling is disabled by default?