Generating Callgraph Traces
If you want to generate a trace for a webpage or PHP script there are three different possibilities to achieve this.
- Using the Chrome Extension is the prefered way.
- Using the Commandline Tool
- Appending a Query String GET parameter as described in the "Trigger Trace" dialog inside your application.
With the Chrome extension you only have to be logged in to the Profiler to make it work, select the application you want to generate a trace with and start the profiling, refresh the page and stop the profiling again.
To get the hash for using the GET parameter log into the Profiler and go to the "Settings" section of the application you want to trace. Copy the parameter and append it to the page you want to trace.
You can generate traces for REST-APIs by sending an additional header.
The easy way to do this is using the Profiler commandline client, that will automatically pass the necessary HTTP Headers to either
http (httpie) programs without you having to bother.
After installation just call the
$ tideways run acme/myapp42 curl http://myapp42/api/call
To generate a trace for a command-line PHP script, you have two options.
The easier one is using the commandline client, that will automatically pass the necessary environment variables without you having to bother. After installation just call the
$ tideways run acme/myapp42 php app/console slow:command
It you disabled auto-start, you should look into the PHP Library documentation how to setup the Profiler.
Ajax Requests cannot easily be traced directly, because they usually require both an active/authenticated session and are called asychroneously in your application.
This makes it hard to generate a trace with cURL, but it is possible to generate traces for Ajax requests using the Chrome Extension.
The extension sets a cookie for a domain and forces all your requests to that domain to be collected for a limited amount of time. Refresh a page which trigger the ajax requests you want to trace.