← 返回命令列表

Linux command

blackfire 命令

网络

复制后可按需替换文件名、目录或参数。

常用示例

Profile a PHP script

blackfire run php [script.php]

Profile with arguments

blackfire run php [script.php] --arg1 [value]

Profile an HTTP request

blackfire curl [https://example.com/page]

Profile to a specific environment

blackfire --env=[ENV_UUID] run php [script.php]

Get JSON output

blackfire --json run php [script.php]

Profile with quiet output

blackfire -q run php [script.php]

Profile a Symfony console command

blackfire run php bin/console [command:name]

说明

blackfire is the CLI tool for the Blackfire profiler, a performance management solution for PHP applications. It profiles PHP scripts, HTTP requests, and web applications to identify performance bottlenecks. The tool integrates with Blackfire.io cloud services to provide detailed flame graphs, call graphs, and performance recommendations. Profiles can be compared to track performance changes over time.

参数

--env _uuid_
Target environment UUID for the profile
--json
Output profile results in JSON format
-q, --quiet
Suppress output (do not display profile URL)
--samples _n_
Number of samples to collect
--title _text_
Set a title for the profile
--external-id _id_
Set an external identifier for the profile
--ignore-exit-status
Ignore non-zero exit status from profiled command

FAQ

What is the blackfire command used for?

blackfire is the CLI tool for the Blackfire profiler, a performance management solution for PHP applications. It profiles PHP scripts, HTTP requests, and web applications to identify performance bottlenecks. The tool integrates with Blackfire.io cloud services to provide detailed flame graphs, call graphs, and performance recommendations. Profiles can be compared to track performance changes over time.

How do I run a basic blackfire example?

Run `blackfire run php [script.php]` in a terminal, then adjust file names, paths, flags, or remote targets for your system.

What does --env _uuid_ do in blackfire?

Target environment UUID for the profile