gitweb: Add optional "time to generate page" info in footer

Add "This page took XXX seconds and Y git commands to generate"
to page footer, if global feature 'timed' is enabled (disabled
by default).  Requires Time::HiRes installed for high precision
'wallclock' time.

Note that Time::HiRes is being required unconditionally; this is
because setting $t0 variable needs to be done fairly early to have
running time of the whole script.  If Time::HiRes module were required
only if 'timed' feature is enabled, the earliest place where starting
time ($t0) could be calculated would be after reading gitweb config,
making "time to generate page" info inaccurate.

This code is based on example code by Petr 'Pasky' Baudis.

Signed-off-by: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Jakub Narebski
2009-09-01 13:39:16 +02:00
committed by Junio C Hamano
parent aef37684ea
commit aa7dd05e6a
2 changed files with 36 additions and 0 deletions

View File

@ -75,6 +75,13 @@ div.page_footer_text {
font-style: italic;
}
div#generating_info {
margin: 4px;
font-size: smaller;
text-align: center;
color: #505050;
}
div.page_body {
padding: 8px;
font-family: monospace;