@@ -218,6 +218,11 @@ private function configureClient(ContainerBuilder $container, $name, array $argu
218218 $ pluginClientOptions = [];
219219
220220 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+
221226 // Tell the plugin journal what plugins we used
222227 $ container
223228 ->getDefinition ('httplug.collector.plugin_journal ' )
@@ -340,6 +345,12 @@ private function registerAutoDiscoverableClient(ContainerBuilder $container, $na
340345 $ pluginClientOptions = [];
341346
342347 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+
343354 $ debugPluginServiceId = $ this ->registerDebugPlugin ($ container , $ serviceId );
344355
345356 $ pluginClientOptions ['debug_plugins ' ] = [new Reference ($ debugPluginServiceId )];
@@ -348,7 +359,7 @@ private function registerAutoDiscoverableClient(ContainerBuilder $container, $na
348359 $ container
349360 ->register ($ serviceId , DummyClient::class)
350361 ->setFactory ([PluginClientFactory::class, 'createPluginClient ' ])
351- ->setArguments ([[], $ factory , [], $ pluginClientOptions ])
362+ ->setArguments ([[new Reference ( ' httplug.plugin.stopwatch ' ) ], $ factory , [], $ pluginClientOptions ])
352363 ;
353364
354365 return $ serviceId ;
0 commit comments