This is basically just a rebase of #34. All implementation credit goes to @turchanov.
Reason for this rebase: The original PR contained some additional, unrelated changes.
This PR adds two options to configure xhprof_sample_* functions behavior:
xhprof.sampling_interval - Configure the sampling interval in microseconds, i.e. the time between two samples being taken. Defaults to the current hard-coded default of 100 miliseconds (=100,000 microseconds).
xhprof.sampling_depth - Configure the call stack depth being sampled, i.e. when set to 10, only the 10 deepest method calls are recorded. Defaults to INT_MAX.
Both additions are great for in-depth performance analysis of requests with short response times, where the original sampling interval of 100 miliseconds is not useful at all.
Exemplary usage in the wild:
ini_set('xhprof.sampling_interval', 50000); // sample twice as often
ini_set('xhprof.sampling_depth', 50);
xhprof_sample_enable();
This is basically just a rebase of #34. All implementation credit goes to @turchanov.
Reason for this rebase: The original PR contained some additional, unrelated changes.
This PR adds two options to configure
xhprof_sample_*
functions behavior:xhprof.sampling_interval
- Configure the sampling interval in microseconds, i.e. the time between two samples being taken. Defaults to the current hard-coded default of 100 miliseconds (=100,000 microseconds).xhprof.sampling_depth
- Configure the call stack depth being sampled, i.e. when set to 10, only the 10 deepest method calls are recorded. Defaults to INT_MAX.Both additions are great for in-depth performance analysis of requests with short response times, where the original sampling interval of 100 miliseconds is not useful at all.
Exemplary usage in the wild: