Warm tip: This article is reproduced from serverfault.com, please click

How to follow and trace executed part of code while browsing a local web application?

发布于 2020-12-02 08:04:07

I have this enormous local web application built with PHP, bootstrap, jQuery , ajax and MVC pattern which make it really difficult for me to know where parts of code related to a certain part of the app are, is there any way that I can track what pars of code are being executed while I'm using the web app ?

Questioner
Asmoun
Viewed
0
Asmoun 2020-12-02 18:14:43

after some search I found out that what i'm looking for is called PHP profilers and there is 3 types :

  • Standard profilers (like Xdebug) : If you’re having a major problem with your application, standard profilers can help you get to the bottom of it. Standard profilers periodically record stack traces of their application. per line of code, and frequency of method calls.
  • Tracing profilers (this is what I'm looking for Z-Ray is a popular one) : Tracing profilers are lighter weight than standard profilers and can be used while you code. These are designed to catch errors and follow part of code in real time while you’re developing.
  • Application Performance Monitoring (APM) tools : APM tools monitor your entire web stack throughout the development lifecycle. They give you basic server metrics like CPU and memory, as well as detailed, code-level insights on your application’s performance. Some APM tools also give you transaction tracing and logging metrics as well.

for me looks like Z-Ray is a prefect tool to look into , It has PHP debug capabilities and It displays all the internal details of a page request, across all the PHP scripts involved in building the page. It is injected into the response coming from PHP app. Also, it is shown right in the browser that you are using for development. The good thing is that you get vastly greater insight without changing your development workflow any other suggestions are welcomed