Update of /cvsroot/monetdb/MonetDB5/src/mal
In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv31604/mal

Modified Files:
        mal_sabaoth.mx 
Log Message:
Fix crash averages and last crash date in the case of a running server

Index: mal_sabaoth.mx
===================================================================
RCS file: /cvsroot/monetdb/MonetDB5/src/mal/mal_sabaoth.mx,v
retrieving revision 1.30
retrieving revision 1.31
diff -u -d -r1.30 -r1.31
--- mal_sabaoth.mx      18 Aug 2007 23:15:15 -0000      1.30
+++ mal_sabaoth.mx      24 Aug 2007 10:40:27 -0000      1.31
@@ -620,13 +620,13 @@
        double crashavg30; /* average of crashes in the last 30 start attempts 
*/
 } sabuplog;
 
-mal_export str SABAOTHgetUplogInfo(sabuplog* ret, str dbname);
+mal_export str SABAOTHgetUplogInfo(sabuplog *ret, sabdb *db);
 @c
 /**
  * Parses the .uplog file for the given database, and fills ret with the
  * parsed information.
  */
-str SABAOTHgetUplogInfo(sabuplog* ret, str dbname) {
+str SABAOTHgetUplogInfo(sabuplog *ret, sabdb *db) {
        str path = alloca(sizeof(char) * (PATHLENGTH + 1));
        str log = alloca(sizeof(char) * (PATHLENGTH + 1));
        str tmp;
@@ -656,7 +656,7 @@
                throw(IO, "sabaoth.getUplogInfo", "unable to open directory %s: 
%s",
                                path, strerror(errno));
        while ((e = readdir(d)) != NULL) {
-               if (dbname != NULL && strcmp(e->d_name, dbname) != 0)
+               if (strcmp(e->d_name, db->dbname) != 0)
                        continue;
 
                snprintf(log, PATHLENGTH, "%s/%s/%s", path, e->d_name, 
UPLOGFILE);
@@ -699,12 +699,12 @@
                                        break;
                                }
                        }
-                       if (start != 0)
+                       if (start != 0 && db->state != SABdbRunning)
                                ret->lastcrash = start;
                        memmove(&avg10[0], &avg10[1], sizeof(int) * 9);
                        memmove(&avg30[0], &avg30[1], sizeof(int) * 29);
                        avg10[9] = avg30[29] = ret->crashavg1 =
-                               (start != 0 ? 1 : 0);
+                               (start != 0 ? (db->state != SABdbRunning ? 1 : 
0) : 0);
                        ret->crashcntr = ret->startcntr - ret->stopcntr;
                        for (i = 0; i < 10; i++)
                                ret->crashavg10 += avg10[i];


-------------------------------------------------------------------------
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

Reply via email to