Closed ibarkowski closed 5 years ago
Thanks for you PR @ibarkowski !
The issue I see is that the second argument of Metric::__construct
can be an array.
So the captured argument will be applied to all selectors.
If I'm not mistaken, you could use instead
use Blackfire\Profile\Metric;
// define a custom metric
$metric = new Metric('cache.write_calls');
$metric->addCallee('=Cache::write')->selectArgument('1', '^')
$config->defineMetric($metric);
You have right. It works like a charm. It was my mistake - I didn't found that in documentation before. You can simply reject this PR.
From now it's possible to define via SDK custom argument capture settings like in .blackfire.yml file, ex.
its equal to the same definition in .blackfire.yml file: