Introduction
Google Chrome's developer tools (popularly called dev tools) is probably the best way to debug and analyse details of your client side web application. It is very useful to measure and analyse the performance of your app as well. I've written a SAP Lumira Data Access extension to acquire some interesting data that can be logged using the dev tools, so that it can be visualized in SAP Lumira. If you're interested in understanding what I did and why, then read on!
Motivation
Recently, I was asked to work on a performance improvement project at work. One of the areas of improvement was identified as client side load times in the browser. As a first step, I started monitoring the network calls made by the application using the “Network” tab in the dev tools. I figured out some obvious optimization that could be done. But, I had no way to keep track of my progress. That's when I accidentally right clicked on one of the items in the network tab, and there it was, “Save as HAR with content” :smile: . On opening this file, I realized that the dev tools let me export the content of the network tab into a HAR format, which was nothing but a well structured JSON. That's when I decided that I'll write a DA extension to parse these logs and visualize the data in Lumira. This extension gave me certain advantages over the dev tools.
That's sort of the motivation and need behind the extension. I will not dwell in depth about the implementation, as I feel it's a simple log parser. But, I'll give a brief idea as to what is happening. I take the following parameters as input to my extension:
The logs are then parsed one by one, creating a row in the output dataset for every entry found in the entries key. One important point to note is that the log file name is used as the primary key, so that analyzing the data is made easy.
Usage
Let me take you through a simple use case to make the usage of the extension clear and also the kind of insights that can be derived. The use case is that I'm trying to understand how a website performs at different network speeds. I'm comparing WiFi vs 3G, which could be considered as a laptop vs mobile performance. First, install the extension as per the instructions at the github repository. I've taken two network logs of a famous social website, one over normal WiFi and one by using the throttling feature of the dev tools
The logs are uploaded here as well. Let us acquire these logs using the DA extension.
Once the acquisition is done, let us do a very naive comparison. Comparing the two download times.
As expected, the 3G download times are higher. We can go a step deeper and analyze each and every network call if required.
If you're still not won over by my extension :sad: , I list down the various ways I feel the extension can provide insights into your web app's network activity:
Ideas
Limitations
The source code is up on Github. I've tried my best to write extensible code, so go ahead and fork it :wink: . Any feature requests or bugs can be created on the repo itself. This is my first blog post and my first open source contribution! I'm really excited about it. Let me know what you guys think!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
14 | |
12 | |
11 | |
11 | |
10 | |
9 | |
9 | |
7 | |
6 | |
6 |