Jet\Debug_Profiler_Run_SQLQueryData

The class class represents a record of the executed SQL query. It is not intended for standalone use, but is used by the Jet\Debug_Profiler_Run_Block and Jet\Debug_Profiler_Run classes (it is a subentity).

Method Overview

public getMemoryPeakEnd(): int
Method Importance
public __construct(
string $block_id,
string $query,
array $query_params
)
The constructor takes the given parameters, but also initializes the memory and time data directly. The instance should be created just before the query is executed - its creation is taken as the beginning of the SQL query execution.

Parameters:
  • $block_id: ID of the runtime block to which the query belongs - in practice the current block.
  • $query: The query itself
  • $query_params: Possible parameters of the SQL query (especially if it is a statement).
public setDone(
int $rows_count
): void
Information about the termination of SQL query execution. The $rows_count is the number of rows of the result (SELECT), or the number of rows affected (e.g. UPDATE)
public getBlockId(): string Returns the ID of the block to which the SQL query belongs.
public getBacktrace(): Debug_Profiler_BacktraceItem[] Returns the backtrace to the location where the query was executed.
public getMemoryStart(): int Returns how much memory was consumed when the query was started.
public getMemoryEnd(): int Returns how much memory was consumed at the end of the query.
public getMemoryUsageDiff(): int Returns the difference in memory usage after the query is executed.
public getMemoryPeakStart(): int Returns the peak memory usage at query start.
Returns the peak memory usage at query end.
public getMemoryPeakDiff(): int Returns the difference of peak memory usage after the query is executed.
public getQuery(): string Returns the SQL query.
public getQueryParams(): array Returns the parameters of the SQL query (especially if it was a statement).
public getRowsCount(): int Returns the number of rows of the result (if it was a SELECT), or the number of rows affected (e.g. UPDATE).
public getTimestampStart(): float Returns the time (microtime) at query start.
public getTimestampEnd(): float Returns the time (microtime) at query end.
public getDuration(): float Returns the duration of the query runtime.
Previous chapter
Jet\Debug_Profiler_Run_Block_Message
Next chapter
Jet\Debug_Profiler_Run_BacktraceItem