ProfilerNode Class
Class which represents the profiler steps
Constructor
ProfilerNode
-
profiler
-
name
-
depth
-
parentNode
-
profilerKey
Parameters:
-
profiler
ProfilerReference to the profiler object
-
name
StringName of this step
-
depth
IntTree depth of this step
-
parentNode
ProfilerNodeReference to this step's parent. null if top-level.
-
profilerKey
StringAPI key to identify an internal API call from an external one.
Item Index
Methods
Methods
addChild
-
childNode
Add child {@link ProfilerNode} to this node
Parameters:
-
childNode
ProfilerNodethe profiler node to add
Returns:
Return a reference to this profiler node (for chaining)
addQueryDuration
-
time
Increment the total sql duration at this step
Parameters:
-
time
Numberamount of time to increment the SQL duration by, in microseconds
Returns:
Return instance of this step, for chaining
end
-
[profilerKey=null]
End the timer for this step. Call this after the code that is being profiled by this step has completed executing
Parameters:
-
[profilerKey=null]
String optionalThis is for internal use only! don't ever pass anything!
Returns:
returns parent node, or null if there is no parent
getChildren
()
Array
Get the children steps for this step
Returns:
List of {@link ProfilerNodes} that are the child of this node
getDepth
()
Int
Return tree depth of this step
Returns:
Tree depth of this step
getEnd
()
Number
Get the end time of this step in milliseconds
Returns:
End time of this step, in milliseconds, from unix epoch. (1 significant digit)
getParent
()
Boolean | ProfilerNode
Return this step's parent node
Returns:
Returns {@link ProfilerNode} object for the parent node to this step, or null if there is no parent
getSelfDuration
()
Number
Get the duration of execution for this step, excluding child nodes.
Returns:
Duration of this step, excluding child nodes. (1 significant digit)
getSQLQueries
()
Array
Get all the SQL queries executed at this step
Returns:
list of {@link ProfilerSQLNode}s
getSQLQueryCount
()
Int
Return number of queries run at this step
Returns:
number of queries run at this step
getStart
()
Number
Get the start time of this step in milliseconds
Returns:
Start time of this step, in milliseconds, from unix epoch. (1 significant digit)
getTotalDuration
()
Number
Get the total time spent executing this node, including children
Returns:
Duration of this step, in milliseconds. (1 significant digit)
getTotalSQLQueryDuration
()
Number
Get the total duration for SQL queries executed at this step in milliseconds
Returns:
Duration of query time at this step, in milliseconds, 1 significant digit
hasChildren
()
Boolean
Determine if this node has child steps or not
Returns:
True if this node has child steps, false otherwise
hasNonTrivialChildren
()
Boolean
Determine if this node has trivial children. Traverse the tree of child steps until a non-trivial node is found. This is used at render time.
Returns:
False if all children are trivial, true if there's at least one non-trivial
hasSQLQueries
()
Boolean
Determine if SQL queries were executed at this step
Returns:
True if there are queries, false if not
increaseChildDuration
-
time
Increase the total time child steps have taken. Stored in microseconds
Parameters:
-
time
NumberAmount of time to add to the total child duration, in microseconds
Returns:
Return number total time child steps have taken, in microseconds
sqlStart
-
sqlProfile
This method is called by the Profiler::sqlStart method
Parameters:
-
sqlProfile
ProfilerSQLNodeAn instance of the {@link ProfilerSQLNode} to add to this step
Returns:
reference to the {@link ProfilerSQLNode} object for the query initiated
Properties
depth
Int
protected
Tree depth of this step
sqlQueryCount
Int
protected
Number of queries run at this step
totalSQLQueryDuration
Number
protected
Total time spent performing SQL queries. Stored in microseconds