|
| start ($timerId, $time, $realMemory, $emallocMemory) |
|
| stop ($timerId, $time, $realMemory, $emallocMemory) |
|
| get ($timerId) |
|
| fetch ($timerId, $key) |
|
| clear ($timerId=null) |
|
| getFilteredTimerIds (array $thresholds=null, $filterPattern=null) |
|
Definition at line 12 of file Stat.php.
◆ _getOrderedTimerIds()
Get ordered list of timer ids
- Returns
- array
Definition at line 189 of file Stat.php.
191 $timerIds = array_keys($this->_timers);
192 if (count($timerIds) <= 2) {
199 $patternLastTimerId =
'/' . $nestingSep .
'(?:.(?!' . $nestingSep .
'))+$/';
201 $prevTimerId = $timerIds[0];
203 for (
$i = 1;
$i < count($timerIds);
$i++) {
204 $timerId = $timerIds[
$i];
212 for ($j =
$i + 1; $j < count($timerIds); $j++) {
216 $timerIds[$j] =
null;
221 $prevTimerId = preg_replace($patternLastTimerId,
'', $prevTimerId, -1,
$count);
230 $prevTimerId = $timerId;
◆ clear()
Clear collected statistics for specified timer or for all timers if timer id is omitted
- Parameters
-
- Returns
- void
Definition at line 140 of file Stat.php.
143 unset($this->_timers[$timerId]);
◆ fetch()
Retrieve statistics on specified timer
- Parameters
-
string | $timerId | |
string | $key | Information to return |
- Returns
- string|bool|int|float
- Exceptions
-
Definition at line 105 of file Stat.php.
107 if ($key === self::ID) {
110 if (empty($this->_timers[$timerId])) {
111 throw new \InvalidArgumentException(sprintf(
'Timer "%s" doesn\'t exist.', $timerId));
118 if (!isset($this->_timers[$timerId][$key])) {
119 throw new \InvalidArgumentException(sprintf(
'Timer "%s" doesn\'t have value for "%s".', $timerId, $key));
121 $result = $this->_timers[$timerId][$key];
122 if ($key == self::TIME && $this->_timers[$timerId][self::START] !==
false) {
◆ get()
Get timer statistics data by timer id
- Parameters
-
- Returns
- array
- Exceptions
-
Definition at line 89 of file Stat.php.
91 if (empty($this->_timers[$timerId])) {
92 throw new \InvalidArgumentException(sprintf(
'Timer "%s" doesn\'t exist.', $timerId));
94 return $this->_timers[$timerId];
◆ getFilteredTimerIds()
getFilteredTimerIds |
( |
array |
$thresholds = null , |
|
|
|
$filterPattern = null |
|
) |
| |
Get ordered list of timer ids filtered by thresholds and pcre pattern
- Parameters
-
array | null | $thresholds | |
string | null | $filterPattern | |
- Returns
- array
Definition at line 156 of file Stat.php.
159 if (!$thresholds && !$filterPattern) {
162 $thresholds = (array)$thresholds;
164 foreach ($timerIds as $timerId) {
166 if ($filterPattern && !preg_match($filterPattern, $timerId)) {
171 foreach ($thresholds as $fetchKey => $minMatchValue) {
172 $match = $this->
fetch($timerId, $fetchKey) >= $minMatchValue;
◆ start()
start |
( |
|
$timerId, |
|
|
|
$time, |
|
|
|
$realMemory, |
|
|
|
$emallocMemory |
|
) |
| |
Starts timer
- Parameters
-
string | $timerId | |
int | $time | |
int | $realMemory | Real size of memory allocated from system |
int | $emallocMemory | Memory used by emalloc() |
- Returns
- void
Definition at line 40 of file Stat.php.
42 if (empty($this->_timers[$timerId])) {
43 $this->_timers[$timerId] = [
◆ stop()
stop |
( |
|
$timerId, |
|
|
|
$time, |
|
|
|
$realMemory, |
|
|
|
$emallocMemory |
|
) |
| |
Stops timer
- Parameters
-
string | $timerId | |
int | $time | |
int | $realMemory | Real size of memory allocated from system |
int | $emallocMemory | Memory used by emalloc() |
- Returns
- void
- Exceptions
-
Definition at line 68 of file Stat.php.
70 if (empty($this->_timers[$timerId])) {
71 throw new \InvalidArgumentException(sprintf(
'Timer "%s" doesn\'t exist.', $timerId));
74 $this->_timers[$timerId][
self::TIME] += $time - $this->_timers[$timerId][
'start'];
◆ $_timers
◆ AVG
◆ COUNT
◆ EMALLOC
const EMALLOC = 'emalloc' |
◆ EMALLOC_START
const EMALLOC_START = 'emalloc_start' |
◆ ID
#+ Timer statistics data keys
Definition at line 17 of file Stat.php.
◆ REALMEM
const REALMEM = 'realmem' |
◆ REALMEM_START
const REALMEM_START = 'realmem_start' |
◆ START
◆ TIME
The documentation for this class was generated from the following file:
- vendor/magento/framework/Profiler/Driver/Standard/Stat.php