Challenge Overview
We have finished the automated Jenkins Build Process on Docker challenge and got the profiling data of the reference app.
Currently, the profiler script can generate following profiling items:
- Network Data including XHR, IMG, JS
- Memory usage data
- CPU usage data
The current profiling data are put in https://github.com/topcoderinc/Headlessrefapp/commit/dd4ff3b8b63b9645ad3ef8159cee988ba867722e
We are required to extract metrics from the profiling data based on a scorecard (provided in the forum) that client provided. Some of the budgets in the scorecard cannot be pulled from the existing profiling data, so in this task, you are required to update the profiler script to make sure the output profiling data include the following items.
(1) Number of all available routes.
If possible we’d like to enumerate all possible routes from initial page load, get a total count and also use the full route list as the URL list to iterate through when profiling each page. We need to capture all of the following information for each route that exists.
In the final output JSON, this item should be named as ‘total-routes.
(2) Number of watchers of each route
We need to check if there are any Angular watchers on each route when the URL is loaded.
In the final output JSON, this item should be named as total-watchers.
(3) Number of browser objects
We need to count the total number of browser objects for each URL that is loaded (all objects, img, strings, etc.)
Here is a reference code (Provided in the forum)
In the final output JSON, this item should be named as total-browser-objects.
(4) Total size of browser session storage
We need to get the total size of CacheStorage for each URL that is loaded.
In the final output JSON, this item should be named as total-cache-size-mb.
(5) Total size of IndexedDB storage
We need to get the total size of the IndexedDB for each URL that is loaded
In the final output JSON, this item should be named as total-indexeddb-size-mb.
(6) Number of logs that is published to browser console
We need to capture any log entries generated by each page and count them for each URL loaded.
The Log API supports it. Here's the full list of devtools protocols: https://chromedevtools.github.io/devtools-protocol/
In the final output JSON, this item should be named as total-console-logs.
(7) Number of detached DOM per screen
We need to capture any log entries generated by each page and count them for each URL loaded.
Will be able to retrieve this from heap snapshot: https://developer.chrome.com/devtools/docs/heap-profiling-dom-leaks
In the final output JSON, this item should be named as total-detached-dom.
Here is a sample of output JSON. The output JSON should be in this format
{
"total-routes" : 50,
"routes":[
{
"url" : "https://example.com/route1",
"total-watchers" : 0,
"total-browser-objects" : 56000,
"total-cache-size-mb" : 1,
"total-indexeddb-size-mb" : 15,
"total-global-variables" : 13,
"total-console-logs" : 0,
"total-detached-dom" : 0
},
{
"url" : "https://example.com/route1",
"total-watchers" : 0,
"total-browser-objects" : 56000,
"total-cache-size-mb" : 1,
"total-indexeddb-size-mb" : 15,
"total-global-variables" : 13,
"total-console-logs" : 0,
"total-detached-dom" : 0
}
]
}
Final Submission Guidelines
A zip archive including the following files
1. A git patch against the commit hash dd4ff3b8b63b9645ad3ef8159cee988ba867722e , which should include the update profiler script
2. The generated JSON data that meets the format mentioned above.
3. A README.md that includes the deployment guide and verification steps.