class DatabaseDataCollector implements DataCollectorInterface

A data collector that collects database data that will be shown on the profiler

Properties

$data

Methods

collect(Request $request, Response $response, Exception $exception = null)

Collects data for the given Request and Response, so that it can be serialized and stored for later retrieval

logQuery(DatabaseQuery $query)

Log a database query

logCacheFetch(string $type, int $id)

Log a fetch from the Model Cache

array
getCacheFetches()

Get the sorted catche fetches by Model type

int
getTotalCacheFetches()

Get the total number of catche fetches

number
estimateTimeSaved()

Get an estimate of the time that the model cache saved in milliseconds

array
getQueryFrequencies()

Get the number of times each query was sent to the server

int
getDuplicatedQueryCount()

Get the number of duplicated queries

getQueries()

Get the queries made to the database

float
getDuration()

Get the total duration of the database queries in milliseconds

string
getName()

Returns the name of the collector.

Details

at line line 32
collect(Request $request, Response $response, Exception $exception = null)

Collects data for the given Request and Response, so that it can be serialized and stored for later retrieval

Parameters

Request $request A Request instance
Response $response A Response instance
Exception $exception An Exception instance

at line line 46
logQuery(DatabaseQuery $query)

Log a database query

Parameters

DatabaseQuery $query The query

at line line 57
logCacheFetch(string $type, int $id)

Log a fetch from the Model Cache

Parameters

string $type The type of the model
int $id The ID of the model

at line line 71
array getCacheFetches()

Get the sorted catche fetches by Model type

Return Value

array

at line line 82
int getTotalCacheFetches()

Get the total number of catche fetches

Return Value

int

at line line 92
number estimateTimeSaved()

Get an estimate of the time that the model cache saved in milliseconds

Return Value

number

at line line 116
array getQueryFrequencies()

Get the number of times each query was sent to the server

Return Value

array An array with resolved queries as keys and frequencies as values

at line line 138
int getDuplicatedQueryCount()

Get the number of duplicated queries

Return Value

int

at line line 150
DatabaseQuery[] getQueries()

Get the queries made to the database

Return Value

DatabaseQuery[]

at line line 160
float getDuration()

Get the total duration of the database queries in milliseconds

Return Value

float

at line line 176
string getName()

Returns the name of the collector.

Return Value

string The collector name