56
loading...
This website collects cookies to deliver better user experience
00:03
In part one, I used open source AppMaps to quickly address a performance bug in my Python Django application. In this demo, I'll show how to use the same AppMaps for documenting the bug and my fix for my team so my code can be reviewed, approved and deployed in the shortest time possible.
To quickly recap the previous demo: from a test, I recorded an AppMap that visually documented a performance bug in my running code. Then I applied a fix, re-recorded the AppMap from my test and confirmed that my fix addressed the root cause.
00:41
And this is the AppMap of my performance bug before the fix:
It clearly shows that one of my “meetings” endpoints worked as expected, while the other one was suffering from the “N+1” problem (i.e. excessive trips to the database caused by imperfect ORM query definition, executing 1,501 queries vs 3 of the other endpoint).
01:00
Let me prepend this AppMap’s filename with “before-“ so I can save it for later.
01:06
And here is a new AppMap recorded from the same test after I applied the fix:
As you can see, the second request now also needs only three trips to the database as well, and the time required to execute it shrank to 1/4 of the original.
01:23
Let me rename this AppMap as well, this time I’ll prepend its name with “after-“.
01:30
Now I’m ready to create a Pull Request with my fix and submit it for review. And since the AppMap helped me understand the bug and validate the fix, I’m going to attach the before-and-after AppMaps to my PR.
With the before AppMap, I can upload it to the ticket directly or create a Snippet and link it from the request. I can also upload it to our file sharing service and add a link there. But in this demo, I’m going to use simple sharing with AppMap Cloud - a cloud repository and interactive viewer that makes collaborating with my teammates fast and convenient.
02:08
I open the AppMap, click the “Cloud upload” icon and confirm the action. I can sign in with my GitLab or GitHub account and my AppMap opens in the cloud. I can now get the sharing link and add it to my Pull request:
02:27
Let me repeat the same with the “After the fix” AppMap. Open, upload, share.
02:40
When my teammates open the Merge request, they can instantly open and review my AppMaps and the linked code in their web browser, or they can download the AppMaps and open them in their code editor. With access to my AppMaps, my teammates can quickly observe the behavior of the impacted code before and after my bug fix, allowing them to review and merge my changes faster and more confidently.