Index: openacs-4/packages/monitoring/bin/aolserver-errors.pl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/monitoring/bin/aolserver-errors.pl,v diff -u -r1.1 -r1.2 --- openacs-4/packages/monitoring/bin/aolserver-errors.pl 20 Apr 2001 20:51:11 -0000 1.1 +++ openacs-4/packages/monitoring/bin/aolserver-errors.pl 17 Sep 2002 21:57:37 -0000 1.2 @@ -90,9 +90,21 @@ $start_time = sprintf "%02d%02d%02d%02d", (localtime(time - (60*$num_minutes)))[4,3,2,1]; seek LOG, -$bite_size, 2; + $search_from = tell(LOG); while (1) { while () { + + # Don't search past where we got to last time, rewind to + # where we started and leave (next iter will go back + # another chunk) + if (defined $search_to) { + if (tell(LOG) >= $search_to) { + seek LOG, -$bite_size, 1; + last; + } + } + if (/^\[([0-9]+)\/([A-Za-z]+)\/([0-9]+):([0-9]+):([0-9]+)/) { my($day, $month_name, $year, $hour, $minute) = ($1, $2, $3, $4, $5); @@ -122,6 +134,14 @@ # the end of the file. If it's the second case, we # need to set the starting point to the end of the file. $starting_point = $last_position unless $starting_point; + } else { + # We found a dated entry but we need to go further + # back. Go back from where we started from last + # time, to avoid infinite loop where the whole + # $bite_size doesn't have any dates + + $rewind = (tell(LOG) - $search_from); # how far to rewind to get back to search_from + seek LOG, -$rewind, 1; } # We only need to get one time stamp last; @@ -130,11 +150,11 @@ last if defined $starting_point; + $search_to = tell(LOG); # don't bother searching after where we are now seek LOG, -$bite_size, 1; + $search_from = tell(LOG); - $position = tell LOG; - - if ($position < $bite_size) { + if ($search_from < $bite_size) { # then we need to read the entire file $starting_point = 0; last; Index: openacs-4/packages/monitoring/tcl/monitoring-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/monitoring/tcl/monitoring-procs.tcl,v diff -u -r1.4 -r1.5 --- openacs-4/packages/monitoring/tcl/monitoring-procs.tcl 23 Aug 2002 03:39:12 -0000 1.4 +++ openacs-4/packages/monitoring/tcl/monitoring-procs.tcl 17 Sep 2002 21:57:38 -0000 1.5 @@ -292,8 +292,8 @@ set table_name [lindex $table_item 0] set percent [lindex $table_item 1] - #The string to execute. - set execstr "analyze table :table_name estimate statistics sample :percent percent" + #The string to execute. Don't use bind vars since you can't bind on table name. + set execstr "analyze table $table_name estimate statistics sample $percent percent" # for some reason this failed.. probably cause the table doesn't exists # anymore