Is there a way to register only execution slower than X with xdebug?

I would like xdebug to only trace “jumps” compared to X ms or more Y KB RAM, for example, every execution that took more than 100 ms or increased memory usage by more than 100 KB. This would allow me to ignore thousands of trace lines that I don’t need to see, and make optimization much easier - since in ZF2, the bloated structure takes 1 second to start with the composer autoloader on our corporate project, the results of which are in the thousands of lines that I really useless. Somewhere along the line I find big jumps at runtime, but not after a long bout of scrolling.

Is there a default option to disable logging "faster than X", or if not, do you know about a helper shell / python script that can only output slower ones?

For clarification, I'm talking about the contents of a .xt file that I get by running xdebug_start_trace () in my application.

+5
source share
1 answer

I don’t know anything about such parameters, but I can suggest using a profile instead of tracing.

Here is an article on how you can use it. In short, put these lines in your php.ini file:

xdebug.profiler_enable = 0
xdebug.profiler_enable_trigger = 1
xdebug.profiler_output_dir="c:\Projects"

and if you want to start the profiler, start the url with the request parameter ?XDEBUG_PROFILE=1

This will create a file with a type name cachegrind.out.*and put it in profiler_output_dir.

CacheGrind . . wincachegrind ( Windows) ZendFramework. , . , , .. , .

+1

All Articles