Bug 40813

Summary: Add ability to embed page start and end timing
Product: Koha Reporter: Kyle M Hall (khall) <kyle>
Component: Architecture, internals, and plumbingAssignee: Kyle M Hall (khall) <kyle>
Status: Needs Signoff --- QA Contact: Testopia <testopia>
Severity: enhancement    
Priority: P5 - low CC: dcook, lucas
Version: unspecified   
Hardware: All   
OS: All   
GIT URL: Change sponsored?: ---
Patch complexity: --- Documentation contact:
Documentation submission: Text to go in the release notes:
Version(s) released in:
Circulation function:
Attachments: Bug 40813: Add ability to embed page start and end timing
Bug 40813: Add ability to embed page start and end timing

Description Kyle M Hall (khall) 2025-09-15 19:19:55 UTC
It would be useful to know what time a page load was initiated and rendering completed for debugging purposes. The most reasonable solution I've found is to get a time from the start of get_template_and_user and the end of intranet-bottom.inc.
Comment 1 Kyle M Hall (khall) 2025-09-15 19:21:59 UTC
Created attachment 186445 [details] [review]
Bug 40813: Add ability to embed page start and end timing

It would be useful to know what time a page load was initiated and
rendering completed for debugging purposes. The most reasonable solution
I've found is to get a time from the start of get_template_and_user and
the end of intranet-bottom.inc. This adds timing to nearly all Koha
pages with just a few lines of code.

Test Plan:
1) Apply this patch
2) Restart all the things!
3) Load mainpage.pl
4) Note the "start" and "end" values at the bottom of the page
Comment 2 Kyle M Hall (khall) 2025-09-15 19:24:25 UTC
Open questions:
1) Do we need to hide this data by default using CSS or a syspref? If so, which?

2) Can anyone style this information better?
Comment 3 Lucas Gass (lukeg) 2025-09-16 14:40:45 UTC
(In reply to Kyle M Hall (khall) from comment #2)
> Open questions:
> 1) Do we need to hide this data by default using CSS or a syspref? If so,
> which?

In my opinion it should be by system preference. Perhaps "DumpTemplateLoadTimes"?
Comment 4 Lucas Gass (lukeg) 2025-09-16 16:51:41 UTC
Created attachment 186490 [details] [review]
Bug 40813: Add ability to embed page start and end timing

It would be useful to know what time a page load was initiated and
rendering completed for debugging purposes. The most reasonable solution
I've found is to get a time from the start of get_template_and_user and
the end of intranet-bottom.inc. This adds timing to nearly all Koha
pages with just a few lines of code.

Test Plan:
1) Apply this patch
2) Restart all the things!
3) Load mainpage.pl
4) Note the "start" and "end" values at the bottom of the page