php-apm icon indicating copy to clipboard operation
php-apm copied to clipboard

enhancement the backtrace with time consumption for every function call

Open oikomi opened this issue 9 years ago • 4 comments

hi @patrickallaert

would you consider to add time consumption for every function call in a request? like xhprof .

oikomi avatar Aug 18 '15 08:08 oikomi

XHProf has severe performance impact, APM doesn't suffer from that, hence why I'm not very enthusiast about this idea. Besides that, xhprof is very good at what it does, why not just use it if you don't care about the performance impact?

patrickallaert avatar Aug 18 '15 10:08 patrickallaert

hi @patrickallaert In fact, we do not use XHProf everywhere, just when we found the slow request, we want to known which function spent a lot of time, so the performance impact within a tolerable range.

oikomi avatar Aug 19 '15 01:08 oikomi

The problem is that in order to provide that kind of measure, we would be forced (like XHProf does) to get a very precise time (with nanoseconds) before/after every function call, that is the only way to produce the time spent in a function. The thing here is that collecting the system time with high precision is an expensive process. Providing the feature wouldn't only dramatically impact the performance, not more, not less than XHProf or any other profiling tool, but in addition, we would just embed a profile tool that is better kept separate from APM.

Note that catchy.io will provide something that could possibly help you. Not by telling you in which function you spent more time, but whether this is in DB, networking I/O, file operations, regexes,...

patrickallaert avatar Mar 29 '16 11:03 patrickallaert

@patrickallaert catchy.io seems to be dead. Is there any open source alternative for this?

fizerkhan avatar Dec 08 '16 06:12 fizerkhan