blackfireio / lando-plugin

Lando plugin to use Blackfire
4 stars 3 forks source link

Blackfire Plugin for Lando

This plugin for Lando.dev gives you the ability to use Blackfire Profiler with your application.

Blackfire Profiler is a Software-as-a-Service tool which measures how your code consumes resources at run-time. It enables to find performance bottlenecks and understand the code's behavior. It can be used in development, test/staging and production (with no overhead for end-users).

Intuitive visualizations enable you to browse through your call stack, and review Wall-time, CPU time, I/O time, Memory, Network calls, HTTP requests and SQL queries usage.

This plugin provides the Blackfire Agent, the Blackfire CLI Tool, and Blackfire Player. Please refer to the Blackfire documentation for more details on the Blackfire stack.

The Blackfire Agent is a daemon processing the data collected by the Blackfire Probe, and sending it to the Blackfire servers. The Blackfire Probe is a language extension; it collects resources consumption metrics on profiled code.

The Blackfire CLI Tool provides a client with 2 main commands:

Blackfire Player is a powerful Web Crawling, Web Testing, and Web Scraper application. It provides a nice DSL to crawl HTTP services, assert responses, and extract data from HTML/XML/JSON responses.

Requirements

Installation

mv blackfire ~/.lando/plugins/

If the plugins directory doesn't exist, create it:

mkdir -p ~/.lando/plugins

Configuration

You may configure Blackfire within your Landofile, by setting a service:

services:
  blackfire:
    type: blackfire
    server_id: <YOUR_BLACKFIRE_SERVER_ID>
    server_token: <YOUR_BLACKFIRE_SERVER_TOKEN>
    client_id: <YOUR_BLACKFIRE_CLIENT_ID>
    client_token: <YOUR_BLACKFIRE_CLIENT_TOKEN>

Increasing The Log Level

If you need to increase the log level for the Blackfire Probe or Agent, you may configure the log_level directive:

services:
  blackfire:
    type: blackfire
    log_level: 4

Then run lando rebuild. You can now check the logs:

# Blackfire agent log
lando logs -s blackfire

# Blackfire probe log, as part of the appserver ones
lando logs -s appserver

Custom App Service name

By default, Lando main app service is called appserver.

If you decided to call it in a different way, you need to configure the blackfire service:

services:
  blackfire:
    type: blackfire
    app_service: my_app_service_name

Known Limitations