Add a note to the Datasette footer measuring the total page load time
Install this plugin in the same environment as Datasette.
datasette install datasette-total-page-time
Once this plugin is installed, a note will appear in the footer of every page showing how long the page took to generate.
Queries took 326.74ms ยท Page took 386.310ms
Measuring how long a page takes to load and then injecting that note into the page is tricky, because you need to finish generating the page before you know how long it took to load it!
This plugin uses the asgi_wrapper plugin hook to measure the time taken by Datasette and then inject the following JavaScript at the bottom of the response, after the closing