This repository was archived by the owner on Aug 10, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 5
Releases: fiverr/page-timing
Releases · fiverr/page-timing
Completely new API and lots of treats
@omrilotan
omrilotan
4a9cfec
This commit was created on GitHub.com and signed with GitHub’s verified signature.
The key has expired.
Sorry about that, but trust me, it's totally worth it.
- Simpler API 🦋
- Browser information for reference 💁♂️ like connection and memory
- More metrics
♥️ such as assets count, size and timing, DOM node count and depth and more
Assets 2
[FIX] bundle in es5
1.2.2 fix bundle (es5), add check (#12)
Assets 2
Add measure function
@omrilotan
omrilotan
66f3bab
This commit was created on GitHub.com and signed with GitHub’s verified signature.
The key has expired.
measure
Wrap a function and measure it's execution time in milliseconds into a performance measure entry.
import { measure } from 'page-timing'; await pageTiming.measure(wait, 'my-function'); // Example: Convert entries to a named array performance.getEntriesByType('measure').reduce( (accumulator, {name, duration}) => Object.assign(accumulator, {[name]: duration}), {} ); // {my-function: 53.35999990347773} // Example: Retrieve a specific entry const { duration } = performance.getEntriesByType('measure') .find(({name}) => name === 'my-function'); // 53.35999990347773
Assets 2
Add paint events
-
Add paint entries "first-paint" and "first-contentful-paint" (see full list below)
-
Add experimentation page (
npm start) -
Adjust dist to be ES5 compatible (babel)
Example default array after update
0: (2) ["connectEnd", 4.382080078125] 1: (2) ["connectStart", 4.382080078125] 2: (2) ["domComplete", 2165.382080078125] 3: (2) ["domContentLoadedEventEnd", 2111.382080078125] 4: (2) ["domContentLoadedEventStart", 2111.382080078125] 5: (2) ["domInteractive", 2111.382080078125] 6: (2) ["domLoading", 25.382080078125] 7: (2) ["domainLookupEnd", 4.382080078125] 8: (2) ["domainLookupStart", 4.382080078125] 9: (2) ["fetchStart", 4.382080078125] 10: (2) ["loadEventStart", 2165.382080078125] 11: (2) ["requestStart", 4.382080078125] 12: (2) ["responseEnd", 15.382080078125] 13: (2) ["responseStart", 4.382080078125] 14: (2) ["unloadEventEnd", 19.382080078125] 15: (2) ["unloadEventStart", 19.382080078125] 16: (2) ["first-paint", 2049.8999999836087] 17: (2) ["first-contentful-paint", 2049.8999999836087]