0

Say I have an application on production server and I need to profile some segment of code, but not the whole application, cause it slows drastically.

So I need something like this:

enable_profiler();
function_with_bottle_neck();
disable_profiler();

Is there any way to do that?

1 Answer 1

1

Use xhprof. And you can write something like this:

if ($_SERVER['REMOTE_ADDR'] == 'your_ip') {
 enable_profiler();
}
function_with_bottle_neck();

if ($_SERVER['REMOTE_ADDR'] == 'your_ip') {
 disable_profiler();
}
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.