Saturday, August 17, 2013

Sneak Peek: Checkpoints (a.k.a. Simulated Breakpoints)

What?
Simulated breakpoints a.k.a. checkpoints enable developers to assign breakpoints to assess stack values at that point of execution.

Where?
Simulated breakpoints are available in new Developer console. 

Why?
At many occasions developers need to assess variable/ instance values during execution. This comes in very handy especially when debugging something in production wherein developers cannot add "system.debug" statements at their will. With breakpoints, developers can very well place breakpoints at desired code locations and execute the code to get breakpoint results

How?
To create checkpoints, open a class/ trigger in developer console and click on left hand side (just next to line no.). Once added, you can view your breakpoints in "Checkpoint Locations" sub tab within Checkpoints tab. 
Each execution of class/ trigger generates Checkpoint data in "Checkpoints" sub tab. Double click on the individual checkpoint log, to view corresponding heap dump and memory details.

Very interesting. Isn't it. 

Overlaying Apex Code and SOQL Statements


That's not all. In addition to viewing heap dumps, Checkpoints enable developers to inject anonymous apex/ soql code during execution and the corresponding logs are displayed accordingly (log for apex code gets displayed in debug logs along with other details and results for SOQL query injected gets displayed within checkpoint details). This can come very handy while debugging production issues

Additional reads:-


Popular Posts