Author: timbo
Date: Mon Dec 19 03:43:08 2005
New Revision: 2319
Modified:
dbi/trunk/Changes
dbi/trunk/lib/DBI/ProfileData.pm
Log:
Changed DBI::ProfileData to be more forgiving of systems with
unstable clocks (where time may go backwards occasionally).
Modified: dbi/trunk/Changes
==============================================================================
--- dbi/trunk/Changes (original)
+++ dbi/trunk/Changes Mon Dec 19 03:43:08 2005
@@ -9,6 +9,9 @@ DBI::Changes - List of significant chang
Fixed $dbh->clone method 'signature' thanks to Jeffrey Klein.
Fixed default ping() method to return false if !$dbh->{Active}.
+ Changed DBI::ProfileData to be more forgiving of systems with
+ unstable clocks (where time may go backwards occasionally).
+
=head2 Changes in DBI 1.50 (svn rev 2307), 13 December 2005
Fixed Makefile.PL options for gcc bug introduced in 1.49.
Modified: dbi/trunk/lib/DBI/ProfileData.pm
==============================================================================
--- dbi/trunk/lib/DBI/ProfileData.pm (original)
+++ dbi/trunk/lib/DBI/ProfileData.pm Mon Dec 19 03:43:08 2005
@@ -219,16 +219,19 @@ sub _read_body {
}
elsif (/^=/) {
# it's data - file in the node array with the path in index 0
+ # (the optional minus is to make it more robust against systems
+ # with unstable high-res clocks - typically due to poor NTP config
+ # of kernel SMP behaviour, i.e. min time may be -0.000008))
@data = /^=\s+(\d+)
- \s+(\d+\.?\d*)
- \s+(\d+\.?\d*)
- \s+(\d+\.?\d*)
- \s+(\d+\.?\d*)
+ \s+(-?\d+\.?\d*)
+ \s+(-?\d+\.?\d*)
+ \s+(-?\d+\.?\d*)
+ \s+(-?\d+\.?\d*)
\s+(\d+\.?\d*)
\s+(\d+\.?\d*)
\s*$/x;
- # no data?
+ # corrupt data?
croak("Invalid data syntax format in $filename line $.: $_")
unless @data;
# hook to enable pre-processing of the data - such as mangling SQL