Jet\Debug_Profiler_Run_Block

The class represents a running block. It is not intended for standalone use, but is used by the Jet\Debug_Profiler_Run class (it is a subentity).

Method Overview

Method Meaning of
public __construct(
string $label,
int $level,
?Debug_Profiler_Run_Block $parent_block = null
)
The constructor initializes everything and takes care of the hierarchy within the tree structure of the runtime blocks.

A lone call to the constructor (i.e. instance creation) will change the block initialization.
protected addChild(
Debug_Profiler_Run_Block $child
): void
For internal use - tree hierarchy.
public setEnd(
?float $timestamp_end = null
): void
End of block.

It is possible to specify the time (microtime - parameter $timestamp_end) when the end occurred. This is used when terminating the application run to close all open blocks so that the end time is the same for all blocks closed at once and is not affected by the termination operation itself and its overhead.
public getIsRoot(): bool Indikuje zda se jedná o kořenový blok.
public getId(): string Each block must have an identifier. The identifier is a hash containing the name of the block and the time (microtime) of its start.
public getIsAnonymous(): bool Indicates whether this is an anonymous block. Although an anonymous block has its own class, this class inherits from this class.
public getBacktraceStart(
): Debug_Profiler_BacktraceItem[]
Returns the backtrace of the beginning of the block.
public getBacktraceEnd(
): Debug_Profiler_BacktraceItem[]
Returns the end of block backtrace.
public getLabel(): string Returns the block name.
public getChildren(
): Debug_Profiler_Run_Block[]
Returns subblocks - i.e. descendants of the block in the sense of tree hierarchy.
public getLevel(): int Returns the level of immersion in terms of the tree hierarchy.
public getParentBlock(
): ?Debug_Profiler_Run_Block
Returns the parent block in terms of the tree hierarchy.
public getMemoryStart(): int Returns how much memory was consumed when the block was started.
public getMemoryEnd(): int Returns how much memory was consumed at the end of the block.
public getMemoryUsageDiff(): int Returns the memory usage difference after the block is executed.
public getMemoryPeakEnd(): int Returns an indication of peak memory usage at block start.
public getMemoryPeakStart(): int Returns the peak memory usage at the end of the block.
public getMemoryPeakDiff(): int Returns the difference in peak memory usage after the block is executed.
public getTimestampStart(): float Returns the time (microtime) at block start.
public getTimestampEnd(): float Returns the time (microtime) at the end of the block.
public getDuration(): float Returns the duration of the block run.
public getSQLQueries(
): Debug_Profiler_Run_SQLQueryData[]
Returns information about SQL queries executed within the block.
public SQLQueryStart(
string $query,
array $query_params
): Debug_Profiler_Run_SQLQueryData
It is called before starting the SQL query execution.

Never used alone, but always before the Jet\Debug_Profiler facade.
public SQLQueryDone(
int $rows_count
): void
It is called after executing the SQL query.

Never used alone, but always before the Jet\Debug_Profiler facade.
public message(
string $text
): void
Inserts the message and debugging information into the block.

Never used alone, but always before the Jet\Debug_Profiler facade.
public getMessages(
): Debug_Profiler_Run_Block_Message[]
Returns messages and debugging information from the block.
public __sleep(): array Designed for serialization and thus saving.

In practice, internal properties (intended only for profiler running) whose name starts with __ characters are not saved.
Previous chapter
Jet\Debug_Profiler_Run
Next chapter
Jet\Debug_Profiler_Run_Block_Anonymous