Skip to content

Instantly share code, notes, and snippets.

View Awais-cb's full-sized avatar
🎯
Focusing

Awais Fiaz Awais-cb

🎯
Focusing
View GitHub Profile
@Awais-cb
Awais-cb / resource-monitoring.js
Created March 23, 2024 20:54
Example of utilizing the resource entry type from Performance Api
function calculateResourceMetrics() {
let resources = window.performance.getEntriesByType('resource');
// Iterate through each resource
resources.forEach(function(resource) {
let transferedOverNetworkSize = `${resource.transferSize/1000}kb`;
let dnsLookupTime = `${resource.domainLookupEnd - resource.domainLookupStart}ms`;
let tcpHandshakeTime = `${resource.connectEnd - resource.connectStart}ms`;
let sslHandshakeTime = 0;
if (resource.secureConnectionStart > 0) {
sslHandshakeTime = resource.connectEnd - resource.secureConnectionStart;
@Awais-cb
Awais-cb / docker-help.md
Created August 19, 2019 12:38 — forked from bradtraversy/docker-help.md
Docker Commands, Help & Tips

Docker Commands, Help & Tips

Show commands & management commands

$ docker

Docker version info