Update of /cvsroot/monetdb/MonetDB5/src/mal
In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv26591
Modified Files:
mal_sabaoth.mx
Log Message:
Don't return bogus uptimes if the .uplog file is empty.
Index: mal_sabaoth.mx
===================================================================
RCS file: /cvsroot/monetdb/MonetDB5/src/mal/mal_sabaoth.mx,v
retrieving revision 1.27
retrieving revision 1.28
diff -u -d -r1.27 -r1.28
--- mal_sabaoth.mx 24 Jul 2007 08:16:17 -0000 1.27
+++ mal_sabaoth.mx 18 Aug 2007 13:03:57 -0000 1.28
@@ -697,13 +697,20 @@
avg10[9] = avg30[29] = ret->crashavg1 =
(start != 0 ? 1 : 0);
ret->crashcntr = ret->startcntr - ret->stopcntr;
- ret->avguptime = (time_t)(((double)up /
(double)ret->stopcntr) + 0.5);
for (i = 0; i < 10; i++)
ret->crashavg10 += avg10[i];
ret->crashavg10 = ret->crashavg10 / 10.0;
for (i = 0; i < 30; i++)
ret->crashavg30 += avg30[i];
ret->crashavg30 = ret->crashavg30 / 30.0;
+
+ if (ret->startcntr > 0) {
+ ret->avguptime = (time_t)(((double)up /
(double)ret->stopcntr) + 0.5);
+ } else {
+ ret->avguptime = 0;
+ ret->minuptime = 0;
+ ret->maxuptime = 0;
+ }
(void)fclose(f);
} else {
throw(IO, "sabaoth.getUplogInfo", "unable to open file
%s: %s",
-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems? Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
Monetdb-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/monetdb-checkins