Skip to content

Conversation

@janpapenbrock
Copy link

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:

  1. 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).
  2. 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();

Slach added a commit to Slach/xhprof that referenced this pull request Apr 29, 2018
see humanmade#2
and phacility#80

Signed-off-by: Slach <bloodjazman@gmail.com>
remicollet pushed a commit to remicollet/xhprof that referenced this pull request Jul 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants