_driver = $driver; } /** * Register profiler driver to involve it into the results processing */ protected function _registerDriver() { if (!$this->_isDriverRegistered) { $this->_isDriverRegistered = true; \Magento\Framework\Profiler::add($this->_driver); } } /** * Register file-based profiling * * @param string $profilerOutputFile */ public function registerFileProfiler($profilerOutputFile) { $this->_registerDriver(); $this->_driver->registerOutput( new \Magento\Framework\Profiler\Driver\Standard\Output\Csvfile(['filePath' => $profilerOutputFile]) ); } /** * Register profiler with Bamboo-friendly output format * * @param string $profilerOutputFile * @param string $profilerMetricsFile */ public function registerBambooProfiler($profilerOutputFile, $profilerMetricsFile) { $this->_registerDriver(); $this->_driver->registerOutput( new \Magento\TestFramework\Profiler\OutputBamboo( ['filePath' => $profilerOutputFile, 'metrics' => require $profilerMetricsFile] ) ); } }