Skip to content

Commit

Permalink
Blackfire: Add distributed profilling support
Browse files Browse the repository at this point in the history
  • Loading branch information
staabm committed Aug 25, 2023
1 parent 869f0c7 commit 4173619
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/Parallel/Process.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,16 @@ public function start(callable $onData, callable $onError, callable $onExit): vo
if ($tmpStdErr === false) {
throw new ShouldNotHappenException('Failed creating temp file for stderr.');
}

$env = $_ENV;
if (class_exists('BlackfireProbe') && \BlackfireProbe::isEnabled()) {
$probe = \BlackfireProbe::getMainInstance();
$env['BLACKFIRE_QUERY'] = $probe->createSubProfileQuery();
}

$this->stdOut = $tmpStdOut;
$this->stdErr = $tmpStdErr;
$this->process = new \React\ChildProcess\Process($this->command, null, null, [
$this->process = new \React\ChildProcess\Process($this->command, null, $env, [
1 => $this->stdOut,
2 => $this->stdErr,
]);
Expand Down

0 comments on commit 4173619

Please sign in to comment.