# HG changeset patch # User heiko # Date 1216717701 0 # Node ID 4be7cc578e32dc59aa7d1b92dc8418f1de50d7ea # Parent 5a436b1d8e255bd96a9feec5a014282d26426b8d - more time output diff -r 5a436b1d8e25 -r 4be7cc578e32 mail2db --- a/mail2db Mon Jul 21 12:56:37 2008 +0000 +++ b/mail2db Tue Jul 22 09:08:21 2008 +0000 @@ -3,6 +3,13 @@ # $Id$ # $URL$ +my ($T0, $T1); + +BEGIN { + use Time::HiRes qw(gettimeofday tv_interval); + $T0 = [ gettimeofday() ]; +} + use strict; use warnings; use Getopt::Long; @@ -16,7 +23,7 @@ use Time::HiRes qw(gettimeofday tv_interval); use if $ENV{DEBUG} => "Data::Dumper"; -my $T0 = [ gettimeofday() ]; +$T1 = [ gettimeofday() ]; my $OUTPUT_CHARSET = "UTF8"; my $DEFAULT_INPUT_CHARSET = "ASCII"; @@ -134,7 +141,7 @@ } $DBH->commit if not $opt_dry; - syslog( LOG_NOTICE, "inserted message $msg_id (%.1fs)", tv_interval($T0) ); + syslog( LOG_NOTICE, "inserted message $msg_id (%.1fs / %.1fs)", tv_interval($T0), tv_interval($T1) ); } @@ -289,6 +296,9 @@ "DEBUG". Errors are logged as "ERR", and warnings as "WARNING". If standard input is connected to a terminal, additional logging goes to STDERR. +Normally just a single line is logged, containing the id of the inserted message +and two times - the full runtime and the runtime after loading the modules. + =head1 DATABASE LAYOUT Beside having transactions and real support for foreign keys, the