This repository has been archived by the owner on Aug 10, 2023. It is now read-only.
Releases: fiverr/page-timing
Releases · fiverr/page-timing
Completely new API and lots of treats
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
[FIX] bundle in es5
1.2.2 fix bundle (es5), add check (#12)
Add measure function
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
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]
Create a fallback for systems where WeakMap is not available
Removed internal memoisation mechanism when weakmap is not available
Improve performance of default metrics used
Skip metrics filtering when using default list
Measure browser timing and do something with it
1.0.0 Measure browser timing and do something with it