Retrace: Ideas Portal

Retrace combines several tools every development team needs, but we are always open to fresh new ideas.  Please submit your feature request/idea for Retrace below.

Procedural PHP Functions traceable

We have one app. It's our api written in PHP. We don't use a framework. We have written our own framework to run the API.
It's written mainly in procedural PHP.
Because it's an api we have a number of core files that are required in every endpoint and hundreds of functions. Here's an example function to illustrate my question :
 
 
<?php
function recursion($a)
{
    if ($a < 20) {
        echo "$a\n";
        recursion($a + 1);
    }
}
?>
 
 
I'd like Retrace to analyse all of my functions and/or code and provide me with traceable information much like how the MYSQL and curl built in functions do.
 
Using the instrumentation key in the config I've not been able to successfully get it working properly. Because it's not a class, I obviously don't have a method. So I'm a bit stuck and am not sure how to proceed. 
I need to find where the bottlenecks are in my application and I can't because most time is taken up by "Untraced application code" or something like that. 
 
 
{
      "instrumentation": [
        {
          "function": "recursion", 
          "trackedFunction": true,
          "trackedFunctionName": "{{ClassName}}"
        }
      ]
}
 
 
I hope that makes sense and you can assist. 
 
Many thanks 
  • Avatar32.5fb70cce7410889e661286fd7f1897de Guest
  • May 22 2019
  • Attach files