Пример #1
0
 /**
  * @param Item $item
  */
 public function onStart(Item $item)
 {
     $item->setStatistic(self::class, self::FILED_START, $this->getT())->setStatistic(self::class, self::FILED_RUNTIME, 0);
 }
Пример #2
0
 /**
  * @param Item $item
  */
 public function onStart(Item $item)
 {
     $item->setStatistic(static::class, static::FILED_TAG, $this->tag);
 }
Пример #3
0
 /**
  * @param Item $item
  */
 public function onStop(Item $item)
 {
     $item->setStatistic(static::class, static::FILED_MEMORY_USAGE, memory_get_peak_usage($this->realUsage) - $item->getStatistic(static::class, static::FILED_MEMORY_USAGE));
 }
Пример #4
0
 /**
  * @param Item $item
  */
 public function onStop(Item $item)
 {
     $item->setStatistic(self::class, 'onStop', true);
 }
Пример #5
0
 /**
  * @param Item $item
  * @param string $field
  * @param string $invoke
  * @param string $file
  * @param int $line
  * @return $this
  */
 protected function writeStatistics(Item $item, $field, $invoke, $file, $line)
 {
     $item->setStatistic(static::class, $field, [static::SUB_FILED_EXPRESSION => $invoke, static::SUB_FILED_FILE => $file, static::SUB_FILED_LINE => $line]);
     return $this;
 }