Skip to content

Commit

Permalink
Added script speed logging code from VWF
Browse files Browse the repository at this point in the history
  • Loading branch information
nigelhorne committed Aug 2, 2024
1 parent 959d64d commit 39dfbd5
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions .github/workflows/bsd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ jobs:
sudo ${{ matrix.os.pkginstall }}
yes | sudo cpan -i App::cpanminus
sudo cpanm -v Geo::Coder::Free
sudo cpanm -iqfn CGI::IDS Data::Throttler CGI::ACL
sudo cpanm --skip-satisfied -iqn Array::Iterator Config::Auto Data::Text File::Basename File::Copy File::Temp Date::Manip Parse::RecDescent Roman FindBin Gedcom Genealogy::Gedcom::Date Date::Parse Geo::Coder::List Geo::Coder::Free IPC::System::Simple Geo::Coder::Ovi String::Compare Genealogy::Gedcom::Date Geo::Coder::RandMcnally Geo::Coder::US::Census Geo::Coder::OSM Geo::Coder::XYZ Geo::Coder::CA Lingua::EN::ABC Lingua::String Geo::Parser::Text GIS::Distance HTML::Entities Image::Info JSON List::Util LWP::Simple::WithCache MIME::Base64 LWP::UserAgent::Cached DateTime DateTime::Duration DateTime::Format::Genealogy DateTime::Format::Natural Class::Simple::Readonly::Cached Class::Simple::Cached HTML::GoogleMaps::V3 Sort::Key::DateTime Text::Names Text::Names::GB Term::ANSIColor URI URI::Find::Schemeless Locale::AU Locale::CA Locale::US XML::Dumper XML::Twig CHI Class::Simple Lingua::Conjunction Getopt::Std Lingua::EN::NameCase Lingua::EN::NameParse Lingua::EN::Inflect Locale::Object::Country Unicode::Diacritic::Strip URI::Find::Schemeless Marpa::R2 B::Lint warnings::unused Lingua::EN::Numbers::Ordinate CPAN::DistnameInfo CHI XML::Hash Database::Abstraction
sudo cpanm --skip-satisfied -iqn LWP::UserAgent::Cached Data::Serializer
sudo cpanm -iqn F/FR/FRIFFIN/Geo-Coder-PlaceFinder-0.1.tar.gz
Expand Down
6 changes: 6 additions & 0 deletions dynamic-site/cgi-bin/page.fcgi
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ use Log::WarnDie 0.09;
use CGI::ACL;
use HTTP::Date;
use POSIX qw(strftime);
use Time::HiRes;
# FIXME: Gives Insecure dependency in require while running with -T switch in Module/Runtime.pm
# use Taint::Runtime qw($TAINT taint_env);
use autodie qw(:all);
Expand Down Expand Up @@ -242,10 +243,15 @@ while($handling_request = ($request->Accept() >= 0)) {
$people->set_logger($logger);
$info->set_logger($logger);

my $start = [Time::HiRes::gettimeofday()];

# TODO: Make this neater
# Tries again without the database if it can't be opened
try {
doit(debug => 0);
my $timetaken = Time::HiRes::tv_interval($start);

$logger->info("$script_name completed in $timetaken seconds");
} catch Error::DB::Open with {
my $msg = shift;
my $tryagain = 0;
Expand Down

0 comments on commit 39dfbd5

Please sign in to comment.