0 follower

Interface Yiisoft\Profiler\Target\TargetInterface

Implemented byYiisoft\Profiler\Target\AbstractTarget, Yiisoft\Profiler\Target\FileTarget, Yiisoft\Profiler\Target\LogTarget

Target interface defines a profiling target.

The target receives profiling messages and is sending these to a certain medium or system. It may, as well, filter out messages it does not need.

Public Methods

Hide inherited methods

Method Description Defined By
collect() Processes the given log messages. Yiisoft\Profiler\Target\TargetInterface
enable() Enable or disable target. Yiisoft\Profiler\Target\TargetInterface

Method Details

Hide inherited methods

collect() public abstract method

Processes the given log messages.

public abstract void collect ( Yiisoft\Profiler\Message[] $messages )
$messages Yiisoft\Profiler\Message[]

Profiling messages to be processed.

Each message has the following keys:

  • token: string, profiling token.
  • level: string, message category.
  • beginTime: float, profiling begin timestamp obtained by microtime(true).
  • endTime: float, profiling end timestamp obtained by microtime(true).
  • duration: float, profiling block duration in milliseconds.
  • beginMemory: int, memory usage at the beginning of profile block in bytes, obtained by memory_get_usage().
  • endMemory: int, memory usage at the end of profile block in bytes, obtained by memory_get_usage().
  • memoryDiff: int, a diff between 'endMemory' and 'beginMemory'.

                public function collect(array $messages): void;

            
enable() public abstract method

Enable or disable target.

public abstract void enable ( boolean $value true )
$value boolean

                public function enable(bool $value = true): void;