Use the entire sub call for the "totaltime" counter for same_schema.
authorGreg Sabino Mullane <[email protected]>
Tue, 12 Jul 2011 11:45:26 +0000 (07:45 -0400)
committerGreg Sabino Mullane <[email protected]>
Tue, 12 Jul 2011 11:45:26 +0000 (07:45 -0400)
check_postgres.pl

index 074761c1bcf37f1309532831dbc43eddc52d2d63..592b7e3c70f1b0dd7af775e2afd5c75123d55e63 100755 (executable)
@@ -5963,6 +5963,9 @@ sub check_same_schema {
     ## Warning and critical are not used
     ## The filter argument is supported
 
+    ## We override the usual $db->{totaltime} with our own counter
+    my $start = [gettimeofday()];
+
     ## Check for filtering rules, then store inside opt{filtered}
     my %filter;
     if (exists $opt{filter}) {
@@ -6179,6 +6182,9 @@ sub check_same_schema {
         }
     }
 
+    ## Set the total time
+    $db->{totaltime} = sprintf '%.2f', tv_interval($start);
+
     ## Comparison is done, let's report the results
     if (! $opt{failcount}) {
         add_ok msg('ss-matched');