2

Wondering if there is a way to see the CPU time used by a specific static class instantiated from a trigger handler. I see the overarching trigger cpu time used and then there is a dropdown that details method cpu time in dev console but feel like it isn't accurate. Whats whats the best way to see how much CPU time is used when a class or i guess more specifically a method is called

6

The easiest way to do this is to use the Developer Console, capturing the debug logs for a request that exercises your trigger and the related code then open the debug log and switch to the excellent Analysis perspective via the Debug menu's Switch Perspective option.

This allows you to drill down through the call flow and call stack and lets you see amount of time spent in your Apex code at aggregate or refined levels in that call flow/stack.

You probably will benefit from both examination of the Execution Tree view and the Performance Tree view. You may also like the Timeline in the Execution Overview.

3

In the Developer Console, you can go to Debug > Change Log Levels > Add/Change, and change the Profiling flag to FINEST. Perform an operation on a record, then open the log. At the bottom of the log, you'll see each method, how many times it was called, and the total time consumed by each method.

Changing Debug Logs

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.