use OpenILS::Utils::Fieldmapper;
use DateTime::Format::ISO8601;
use CGI qw(:all -utf8);
+use Time::HiRes;
# EGCatLoader sub-modules
use OpenILS::WWW::EGCatLoader::Util;
use constant ANON_CACHE_MYLIST => 'mylist';
use constant ANON_CACHE_STAFF_SEARCH => 'staffsearch';
+use constant DEBUG_TIMING => 0;
+
sub new {
my($class, $apache, $ctx) = @_;
$self->apache($apache);
$self->ctx($ctx);
$self->cgi(new CGI);
+ $self->timelog("New page");
OpenILS::Utils::CStoreEditor->init; # just in case
$self->editor(new_editor());
return $self->{cgi};
}
+sub timelog {
+ my($self, $description) = @_;
+
+ return unless DEBUG_TIMING;
+ return unless $description;
+ $self->ctx->{timing} ||= [];
+
+ my $timer = [Time::HiRes::gettimeofday()];
+ $self->ctx->{time_begin} ||= $timer;
+
+ push @{$self->ctx->{timing}}, [
+ Time::HiRes::tv_interval($self->ctx->{time_begin}, $timer), $description
+ ];
+}
# -----------------------------------------------------------------------------
# Perform initial setup, load common data, then load page data
my $self = shift;
$self->init_ro_object_cache;
+ $self->timelog("Initial load");
my $stat = $self->load_common;
return $stat unless $stat == Apache2::Const::OK;
<a href="http://example.com">[% l('Bottom Link 3') %]</a> |
<a href="http://example.com">[% l('Bottom Link 4') %]</a> |
<a href="http://example.com">[% l('Bottom Link 5') %]</a>
-
+ [% IF ctx.timing %]
+ <div id="timing">
+ [% FOR event IN ctx.timing %]
+ At <span class="timing-time">[% event.0 | format("%0.4f") %]</span>:
+ <span class="timing-event">[% event.1 %]</span><br />
+ [% END %]
+ </div>
+ [% END %]
<div id="copyright_text" style="margin-top: 2em;">
[% l('Copyright © 2006-[_1] Georgia Public Library Service, and others', date.format(date.now, '%Y')) %]
</div>