From 1e9b7bccfdab8715b93e32ec0c46f883271f7140 Mon Sep 17 00:00:00 2001 From: Kyle M Hall Date: Mon, 15 Sep 2025 15:20:13 -0400 Subject: [PATCH] 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 Signed-off-by: Kyle M Hall --- C4/Auth.pm | 3 +++ .../prog/en/includes/intranet-bottom.inc | 18 ++++++++++++++++++ 2 files changed, 21 insertions(+) diff --git a/C4/Auth.pm b/C4/Auth.pm index ddea45206b7..615ee53525a 100644 --- a/C4/Auth.pm +++ b/C4/Auth.pm @@ -165,6 +165,7 @@ Output.pm module. =cut sub get_template_and_user { + my $start_time = dt_from_string; my $in = shift; my ( $user, $cookie, $sessionID, $flags ); @@ -660,6 +661,8 @@ sub get_template_and_user { $template->param( logged_in_user => $patron ); $template->param( sessionID => $sessionID ); + $template->param( start_time => $start_time ); + return ( $template, $borrowernumber, $cookie, $flags ); } diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/intranet-bottom.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/intranet-bottom.inc index 0ce745868b3..60e292459c0 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/intranet-bottom.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/intranet-bottom.inc @@ -1,5 +1,6 @@ [% USE raw %] [% USE Koha %] +[% USE KohaDates %] [% USE KohaPlugins %] [% USE Asset %] [% USE AdditionalContents %] @@ -294,6 +295,23 @@ [% END %] [% KohaPlugins.get_plugins_intranet_js | $raw %] +[% IF start_time %] + +[% END %] + + -- 2.50.1 (Apple Git-155)