What does it do?

Blackfire enables you to gather information on how your, back-end, PHP code is consuming resources.

It requires a developer, or a tool, to trigger requests (GET or POST) which will automatically be instrumented, or to instrument the code manually or to use the PHP SDK. Check our doc for further information on how to start a profile.

It is very different an complementary to Application Performance Monitoring tools (such as New Relic), which automatically gather data as soon as they're installed on your production servers. Blackfire is also made to be used on production, test, staging or developer. Basically anywhere you can deploy some code. This article gives more details about the differences.

How Does it Work?

Blackfire's core technology relies on profiling techniques. While your code is being executed, Blackfire gathers resource consumption data. Then, it renders the profiling data as two different views:

  • A call-graph that shows the execution path and caller/callee relation between your code's function calls. You can get the detailed resources consumption in terms of Wall-time, I/O time, CPU time, Memory, Network, HTTP calls and SQL requests.
  • A timeline that shows individual function calls on a timeline for a better understanding of the call stack. It allows you to inspect all parent calls that led to any specific call.

Reading profiles

To better understand how to read profiles in Blackfire, check our docs on analyzing call graphs and analyzing timelines.

Blackfire profiles are generated only for requests triggered by a Blackfire user, or by Blackfire when profiling is automated. That is made possible thanks to our runtime instrumentation. As no other requests will be instrumented, Blackfire will add no overhead for your end users, which makes it safe to use in production. Another benefit of the on-the-fly runtime instrumentation is that you do not need to modify your code to get profiling data. Which makes it much more scalable when releasing to production.

The technical stack

To better understand how Blackfire works, check our doc on the Blackfire stack.

Did this answer your question?