JSON Output for Profiles

By Fabien Potencier, on May 19, 2015

What about integrating Blackfire into your own tools? As a first step, you can use the --jsonoption we’ve added recently to the Blackfire CLI tool.

When running Blackfire on the console to profile a script (blackfire run) or to profile a web app or an HTTP API (blackfire curl), you can ask for a JSON representation of the result via the --json option:

The resources consumed by your app are under the envelope entry; keys are the dimension and here is their legend:

  • pmu: Peak Memory Usage (in bytes);
  • nw: Network (in microseconds);
  • wt: Wall Clock Time (in microseconds);
  • cpu: CPU time (in microseconds);
  • io: I/O time (in microseconds).

By the way, recent versions of the blackfire run and blackfire curl commands also output a summary of the main costs to make it easy and fast to understand the resources consumed by your app:

Happy profiling!

Fabien Potencier

Fabien Potencier is the CEO and founder of Blackfire.io. He founded the Symfony project in 2004 as he constantly looked for better ways to build websites. Fabien is also the creator of several other Open-Source projects, a writer, a blogger, a speaker at international conferences, and the happy father of two wonderful kids.