Leverage CommandBox to install into your ColdBox app:
boxinstallcbdebugger--savedev
You will now have to configure the debugger for it to start tracking your application. This will activate the debugger in your application and render out at the end of a request as a dock or by visiting the debugger request tracker visualizer at /cbdebugger.
component delegates="TimerDelegate@cbdebugger"{
...
cbTimeIt( "processData", ()=> {
... code to time
}
}
/**
* Start a timer with a tracking label
*
* @label The tracking label to register
*
* @return A unique tracking hash you must use to stop the timer
*/
function startCBTimer( required label )
/**
* End a code timer with a tracking hash. If the tracking hash is not tracked, we ignore it
*
* @labelHash The timer label hash to stop
*/
function stopCBTimer( required labelHash )
/**
* Time for the execution of the passed closure that we will execute for you
*
* @label The label to use as a timer label
* @closure The target to execute and time
* @metadata A struct of metadata to store in the execution timer
*/
function cbTimeIt(
required label,
required closure,
struct metadata = {}
)
/**
* Add a timer to the stack manually. You will need the label, executionTime and stoppedAt timestamps
*
* @label The label to use as a timer label
* @executionTime The execution time in ms to register
* @startedAt The date time the timer was started
* @stoppedAt The date time the timer was stopped
* @metadata A struct of metadata to store in the execution timer
* @parent An optional parent label
* @type The type of execution timed: request, view-render, layout-render, event, renderer
*/
function addCBTimer(
required label,
required executionTime,
startedAt = now(),
stoppedat = now(),
struct metadata = {},
parent = "",
type = "timer"
)
/**
* Method to turn on the rendering of the debug panel on a request
*/
any function showDebugger()
/**
* Method to turn off the rendering of the debug panel on a request
*/
any function hideDebugger()
/**
* See if the debugger will be rendering or not
*/
boolean function isDebuggerRendering()
/**
* Start a timer with a tracking label
*
* @label The tracking label to register
*
* @return A unique tracking hash you must use to stop the timer
*/
function startCBTimer( required label )
/**
* End a code timer with a tracking hash. If the tracking hash is not tracked, we ignore it
*
* @labelHash The timer label hash to stop
*/
function stopCBTimer( required labelHash )
/**
* Time for the execution of the passed closure that we will execute for you
*
* @label The label to use as a timer label
* @closure The target to execute and time
* @metadata A struct of metadata to store in the execution timer
*/
function cbTimeIt( required label, required closure, struct metadata = {} )
/**
* Shortcut to get a reference to the ColdBox Debugger Service
*/
function getCBDebugger()
/**
* Push a new tracer into the debugger. This comes from LogBox, so we follow
* the same patterns
*
* @message The message to trace
* @severity The severity of the message
* @category The tracking category the message came from
* @timestamp The timestamp of the message
* @extraInfo Extra info to store in the tracer
*/
DebuggerService function cbTracer(
required message,
severity = "info",
category = "",
timestamp = now(),
extraInfo = ""
)