Backtraces Quanta

Or stack trace, stack traceback....


In this article


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?

  1. Go to your Quanta web-scenario page
  2. Go to the scenario you want to analyse
  3. Click on the step concerned
  4. 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)

  1. Get the public docker "wpalmer/xhprof".
    ​docker pull wpalmer/xhprof
  2. 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
  3. Go to the "localhost" of the concerned port
    Here, http://localhost:8800/
    And visualize the backtrace of the step  
Need Help? Do not hesitate to contact our support 
Have more questions? Submit a request


Please sign in to leave a comment.