Last active
February 17, 2020 21:58
-
-
Save vigneshshanmugam/af60b7d0374349491f4c939b35eb7d51 to your computer and use it in GitHub Desktop.
JS Sampling Profiler
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const profiler = await performance.profile({ | |
categories: ["js"], | |
sampleInterval: 10 | |
}); | |
const trace = await profiler.stop(); | |
// Example trace looks something like this | |
{ | |
"frames": [ | |
{ | |
"column": 4, | |
"line": 2, | |
"name": "schedule", | |
"resourceId": 0 | |
}, | |
{ | |
"column": 9, | |
"line": 1, | |
"name": "makeLongTask", | |
"resourceId": 0 | |
} | |
], | |
"resources": [ | |
"http://localhost:8080/index.html" | |
], | |
"samples": [ | |
{ | |
"stackId": 1, | |
"timestamp": 31.48999996483326 | |
} | |
], | |
"stacks": [ | |
{ | |
"frameId": 1 | |
}, | |
{ | |
"frameId": 1, | |
"parentId": 0 | |
} | |
] | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment