API Documentation for: 1.0.1
Show:

ProfilerSQLNode Class

Extends CanteenBase
Namespace: Canteen\Profiler

Class representing each SQL query run

Constructor

ProfilerSQLNode

(
  • profiler
  • query
  • [profileNode=null]
)

Parameters:

  • profiler Profiler

    Reference to the profiler object

  • query String

    the sql query for this node

  • [profileNode=null] Boolean | ProfilerNode optional

    reference to the step that this query is running within

Methods

end

() ProfilerSQLNode

End the timers for this sql node. Call this method when the sql query has finished running.

Returns:

ProfilerSQLNode:

return a reference to this query, for chaining.

getCallstack

() Array

Return the call stack for this query. Reference the php documentation for {@link http://php.net/debug_backtrace debug_backtrace} for the structure of the return array.

Returns:

Array:

call stack for this query

getDuration

() Number

Get the total execution duration for this query

Returns:

Number:

Execution duration for this query in milliseconds, rounded to 1 significant digit.

getQuery

() String

Get the query for this SQLNode. Query is parsed so extraneous spaces are removed where required.

Returns:

String:

Query for this node

getQueryType

() String

Get the type of query this is. Parse the query and try to figure out what kind of query it is.

Returns:

String:

'reader' if this is a select query, 'writer' if this is a typical writer query, or 'special' if it's another kind

getStart

() Number

Get the start time of this query, from the unix epoch.

Returns:

Number:

milliseconds from the unix epoch when this query started, rounded to 1 significant digit

Properties

_profiler

Profiler private

Reference to the main profiler

callstack

Array protected

Call stack backtrace of all methods/functions executed up until this SQL query is run

duration

Number protected

Duration for this query (in microseconds)

ended

Number protected

End time of this query (in microseconds)

profileNode

ProfilerNode protected

Reference to the step this SQL query runs in

query

String protected

The query that this object tracks

started

Number protected

Start time of this query (in microseconds)