Baldinof / roadrunner-bundle

A RoadRunner worker integrated in your Symfony app
MIT License
270 stars 48 forks source link

Question: Blackfire #64

Closed Fichtme closed 2 years ago

Fichtme commented 2 years ago

Hi!

We just recently started using blackfire.

The documentation says that the bundle supports blackfire, but how do i use it in an api application?

// let's create a client
$blackfire = new \Blackfire\Client();
// then start the probe
$probe = $blackfire->createProbe();

// When runtime shuts down, let's finish the profiling session
register_shutdown_function(function () use ($blackfire, $probe) {
    // See the PHP SDK documentation for using the $profile object
    $profile = $blackfire->endProbe($probe);
    dd('stopped');
});

Any help would be much appreciated!

Baldinof commented 2 years ago

Hi!

Thank you for using this bundle :)

The integration starts and stop the probe for http requests, so that you can use blackfire curl <your url> or the blackfire browser extension.

The goal of the integration is to work the same as it does when using php fpm, so you should be able to profile with blackfire curl.

Fichtme commented 2 years ago

I'll look into this. Thnx for your time!

Baldinof commented 2 years ago

👍 Do not hesitate to repost here if you have any problem :)