This example code uses a client-side IndexedDB database to store page and resource performance metrics which can be analysed and uploaded later.
Copy the files to a web server (http://localhost:8888 is presumed) and open the index.html
file in a browser. Open DevTools to view the calculated statistics.
The filename
variable on line 77 of js/performance.js
will need to be changed if you use a different domain, port, or path.
The following files are provided:
js/indexeddb.js
a wrapper API for IndexedDB database functionality, andjs/performance.js
a file which uses the wrapper API to store performance data.