@@ -218,6 +218,11 @@ private function configureClient(ContainerBuilder $container, $name, array $argu
218
218
$ pluginClientOptions = [];
219
219
220
220
if ($ profiling ) {
221
+ if (!in_array ('httplug.plugin.stopwatch ' , $ arguments ['plugins ' ])) {
222
+ // Add the stopwatch plugin
223
+ array_unshift ($ arguments ['plugins ' ], 'httplug.plugin.stopwatch ' );
224
+ }
225
+
221
226
// Tell the plugin journal what plugins we used
222
227
$ container
223
228
->getDefinition ('httplug.collector.plugin_journal ' )
@@ -340,6 +345,12 @@ private function registerAutoDiscoverableClient(ContainerBuilder $container, $na
340
345
$ pluginClientOptions = [];
341
346
342
347
if ($ profiling ) {
348
+ // Tell the plugin journal what plugins we used
349
+ $ container
350
+ ->getDefinition ('httplug.collector.plugin_journal ' )
351
+ ->addMethodCall ('setPlugins ' , [$ name , ['httplug.plugin.stopwatch ' ]])
352
+ ;
353
+
343
354
$ debugPluginServiceId = $ this ->registerDebugPlugin ($ container , $ serviceId );
344
355
345
356
$ pluginClientOptions ['debug_plugins ' ] = [new Reference ($ debugPluginServiceId )];
@@ -348,7 +359,7 @@ private function registerAutoDiscoverableClient(ContainerBuilder $container, $na
348
359
$ container
349
360
->register ($ serviceId , DummyClient::class)
350
361
->setFactory ([PluginClientFactory::class, 'createPluginClient ' ])
351
- ->setArguments ([[], $ factory , [], $ pluginClientOptions ])
362
+ ->setArguments ([[new Reference ( ' httplug.plugin.stopwatch ' ) ], $ factory , [], $ pluginClientOptions ])
352
363
;
353
364
354
365
return $ serviceId ;
0 commit comments