Documentation forAppOptics

Code Profiling for PHP

Code profiling provides extra insight into code level execution time that is otherwise not captured by auto-instrumentation. See Code Profiling for general information.

AppOptics PHP agent version 3.4.0 or later is required for code profiling.

What profiling information is collected by the PHP agent?

  • Profiling is now available for both, auto-started and custom SDK-started traces.
  • PHP class name, method/function name, file name and line number are collected when available. Note that calls into native PHP code will not have file name and line number.

Why don't all traces have profiling information?

  • Profiler is disabled by default, please refer to enabling code profiling.
  • Traces with duration shorter than the configured profiling interval (default is 20ms) might not have profiling information.
  • The agent has experimental support for multi-threaded PHP, profiling up to 10 concurrent threads. For example if PHP is running under Apache MPM worker with more than 10 request workers, only traces from 10 of the workers will have profiling information.

What is the "Unknown" path shown in the profiles?

  • "Unknown" accounts for occasions where the agent failed to obtain snapshots on the given interval. This can happen with a long running request where the maximum number of 3000 snapshots is reached and the agent stops collecting more.