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

Modified Files:
        merovingian.mx monetdb.mx 
Log Message:
merovingian- deal with missing log directory
monetdb - the status -s should be further reduced to
see only server state, uptime, crashcount (last crash).

We might also wanna see the databases that could be started
(to be implemented).


Index: merovingian.mx
===================================================================
RCS file: /cvsroot/monetdb/MonetDB5/src/tools/merovingian.mx,v
retrieving revision 1.44
retrieving revision 1.45
diff -u -d -r1.44 -r1.45
--- merovingian.mx      8 Sep 2007 07:53:56 -0000       1.44
+++ merovingian.mx      8 Sep 2007 17:39:25 -0000       1.45
@@ -1110,6 +1110,11 @@
                argp = dup(1);
                topdp->fout = fdopen(argp, "w");
        } else {
+               /* check the log directory */
+               if (access(msglog,F_OK) == -1 ){
+                       GDKcreatedir(msglog); /* it doesn't necessarily create 
all */
+                       fprintf(stderr, "log directory created '%s'\n", msglog);
+               }
                /* write to the given file */
                topdp->fout = fopen(msglog, "a");
                if (topdp->fout == NULL) {

Index: monetdb.mx
===================================================================
RCS file: /cvsroot/monetdb/MonetDB5/src/tools/monetdb.mx,v
retrieving revision 1.31
retrieving revision 1.32
diff -u -d -r1.31 -r1.32
--- monetdb.mx  8 Sep 2007 07:53:56 -0000       1.31
+++ monetdb.mx  8 Sep 2007 17:39:25 -0000       1.32
@@ -212,7 +212,7 @@
 
        if (mode == 1) {
                /* short one-line mode */
-               char avg[8];
+               char avg[8],uptime[20];
                char *crash;
 
                /* override if locked for brevity */
@@ -222,7 +222,7 @@
                secondsToString(avg, uplog.avguptime, 0);
 
                if (uplog.lastcrash == -1) {
-                       crash = "no crash";
+                       crash = "";
                } else {
                        struct tm *t;
                        crash = alloca(sizeof(char) * 20);
@@ -230,12 +230,21 @@
                        strftime(crash, 20, "%Y-%m-%d %H:%M:%S", t);
                }
 
-               /* demo | running | avguptime | start | stop | crash | 
lastcrash */
-               printf("%*s  %s %7s  %4d %4d  %4d %s\n",
-                               -len, stats->dbname,
-                               state, avg,
-                               uplog.startcntr, uplog.stopcntr,
-                               uplog.crashcntr, crash);
+               if (uplog.laststart == -1) {
+                       uptime[0]= 0;
+               } else {
+                       time_t now;
+                       time(&now);
+                       now -= uplog.laststart;
+                       secondsToString(uptime,(int) now,0);
+               }
+
+               if(stats->state== SABdbInactive)
+                       uptime[0]=0;
+
+               /* demo | running | uptime | crashes */
+               printf("%*s  %s %6s %4d %s\n",
+                               -len, stats->dbname, state, uptime, 
uplog.crashcntr, crash);
        } else if (mode == 2) {
                /* long mode */
                sablist *entry;
@@ -246,9 +255,9 @@
                printf("  location: %s\n", stats->path);
                printf("  database name: %s\n", stats->dbname);
                printf("  state: %s\n", state);
-               printf("  under maintenance: %s\n", stats->locked == 1 ? "yes" 
: "no");
+               printf("  maintenance mode: %s\n", stats->locked == 1 ? "yes" : 
"no");
                entry = stats->scens;
-               printf("  available scenarios:");
+               printf("  scenarios:");
                if (entry == NULL) {
                        printf(" (none)");
                } else while (entry != NULL) {
@@ -257,7 +266,7 @@
                }
                printf("\n");
                entry = stats->conns;
-               printf("  listening connections:");
+               printf("  connections:");
                if (entry == NULL) {
                        printf(" (none)");
                } else while (entry != NULL) {
@@ -405,11 +414,10 @@
                        stats= stats->next;
                }
 
-               if (mode == 1) {
+               if (mode == 1 && orig) {
                        /* print header for short mode */
-                       /* demo | running | avguptime | start | stop | crash | 
lastcrash */
-                       printf("%*s  state   avgutme  strt stop  crsh 
crashdate\n",
-                               -len,"name");
+                       /* demo | running | uptime | crash */
+                       printf("%*s  state   uptime  crashes \n", -len,"name");
                }
 
                stats= orig;
@@ -436,9 +444,8 @@
 
        if (mode == 1) {
                /* print header for short mode */
-               /* demo | running | avguptime | start | stop | crash | 
lastcrash */
-               printf("%*s  state   avgutme  strt stop  crsh crashdate\n",
-                       -len,"name");
+               /* demo | running | uptime | crash */
+               printf("%*s  state   uptime  crashes \n", -len,"name");
        }
 
        for (i = 1; i < argc; i++) {


-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Monetdb-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/monetdb-checkins

Reply via email to