The numbers on the left are critical to identifying the performance problems. Each is the number of microseconds since the start of the request at which the line was logged. Therefore, scanning down the logs, you can identify slow steps by identifying large increases.
But which line is actually the problem? And what if a script is called many times? Each one may only take a few microseconds, but they all add up to a significant amount of time.
After banging my head against this problem on a previous project, I threw together a quick parser for the Recent Request log. I’ve spent some time verifying, optimizing and improving the script and made it into a small single page app.
Pasting in the same Request log from above, click Parse and you get a Flame Graph of the execution tree:
Each color in the Flame Graph denotes the component of AEM that’s executing the portion of the request making it easier to classify.
The parser also outputs a searchable table of all of the logs:
During the parsing process, the parser calculates the duration of each step as well as determining how much of the execution time is from sub-components.
The parser even outputs tables of the most expensive and most common steps of the request, deduplicating repeated steps:
The Sling Recent Requests parser is a pretty simple VueJs app and deployed via AWS Amplify and is 100% client side. Check it out!
Sling Recent Requests Parser