Or stack trace, stack traceback....
What's a Backtrace?
According to our dear frien Wikipedia, a backtrace is:
"A report of the active slack frames at a certain point in time during the execution of a program".
In other words, it's the image at a given time of your code execution.
But, why use backtraces?
When of of your page takes longer than usual, if you installed correctly your PHP module, You can see which block of your code takes longer than usual.
But what if this specific block has more than 100 functions in it? That's when our backtrace will help you find the one that is the most time consuming.
How to get a backtrace?
- Go to your Quanta web-scenario page
- Go to the scenario you want to analyse
- Click on the step concerned
- Click on Backtrace
But, what will happen?
At the same time as the "normal" probe passage, Quanta will launch another probe in order to get the backtrace
Why another probe?
The time recquired to process a bactrace is longer than a "normal" probe, so for us to interfer the less possible on your statistics, we have 2 different probes at the same minute.
How to read a backtrace?
Once your backtrace filed created (xhprof) you can use a container to read it.
At Quanta, we use Docker for example, which is a turnkey public container that is almost immediately operational.
Once your container is installed on the workstation/server in question (you can install it on your computer)
- Get the public docker "wpalmer/xhprof".
docker pull wpalmer/xhprof
- Launch the Docker by forwarding port 80 to the port of your choice and associating the "tmp" of the container with the local directory containing the .xhprof file.
For example if you have put your bactrace in your pathdirectory:
docker run -d -p 8800:80 -v /path/directory/:/tmp/ wpalmer/xhprof
- Go to the "localhost" of the concerned port
And visualize the backtrace of the step