Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
Public Member Functions | Protected Member Functions | Protected Attributes
Profiler Class Reference

Public Member Functions

 __construct (\Magento\Framework\Profiler\Driver\Standard $driver)
 
 registerFileProfiler ($profilerOutputFile)
 
 registerBambooProfiler ($profilerOutputFile, $profilerMetricsFile)
 

Protected Member Functions

 _registerDriver ()
 

Protected Attributes

 $_driver
 
 $_isDriverRegistered = false
 

Detailed Description

Definition at line 12 of file Profiler.php.

Constructor & Destructor Documentation

◆ __construct()

__construct ( \Magento\Framework\Profiler\Driver\Standard  $driver)

Constructor

Parameters
\Magento\Framework\Profiler\Driver\Standard$driver

Definition at line 33 of file Profiler.php.

34  {
35  $this->_driver = $driver;
36  }

Member Function Documentation

◆ _registerDriver()

_registerDriver ( )
protected

Register profiler driver to involve it into the results processing

Definition at line 41 of file Profiler.php.

42  {
43  if (!$this->_isDriverRegistered) {
44  $this->_isDriverRegistered = true;
45  \Magento\Framework\Profiler::add($this->_driver);
46  }
47  }
static add(DriverInterface $driver)
Definition: Profiler.php:137

◆ registerBambooProfiler()

registerBambooProfiler (   $profilerOutputFile,
  $profilerMetricsFile 
)

Register profiler with Bamboo-friendly output format

Parameters
string$profilerOutputFile
string$profilerMetricsFile

Definition at line 68 of file Profiler.php.

69  {
70  $this->_registerDriver();
71  $this->_driver->registerOutput(
72  new \Magento\TestFramework\Profiler\OutputBamboo(
73  ['filePath' => $profilerOutputFile, 'metrics' => require $profilerMetricsFile]
74  )
75  );
76  }

◆ registerFileProfiler()

registerFileProfiler (   $profilerOutputFile)

Register file-based profiling

Parameters
string$profilerOutputFile

Definition at line 54 of file Profiler.php.

55  {
56  $this->_registerDriver();
57  $this->_driver->registerOutput(
58  new \Magento\Framework\Profiler\Driver\Standard\Output\Csvfile(['filePath' => $profilerOutputFile])
59  );
60  }

Field Documentation

◆ $_driver

$_driver
protected

Definition at line 19 of file Profiler.php.

◆ $_isDriverRegistered

$_isDriverRegistered = false
protected

Definition at line 26 of file Profiler.php.


The documentation for this class was generated from the following file: