Update of /cvsroot/monetdb/sql/src/backends/monet5
In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv32352

Modified Files:
        monetdb.mx 
Log Message:
Transform one-line output to be less "just numbers" and more "just
meaningfull".  Translated the crash counter into a health percentage
with average uptime.  The result looks like this:

      name       state     uptime       health       last crash
demo            crashed                70%, 42m  2008-04-08 12:58:14
Alexia          stopped               100%,  7d  -
Amalia          stopped               100%, 11m  -
fabian          stopped                86%,  8m  2007-12-13 19:58:53
Ariane          crashed                98%, 15m  2008-05-23 17:46:57
Anton           stopped               100%, 10m  -
benchmark       crashed                13%, 23h  2008-04-08 12:55:59
test            stopped                88%, 34s  2008-08-20 11:29:53


U monetdb.mx
Index: monetdb.mx
===================================================================
RCS file: /cvsroot/monetdb/sql/src/backends/monet5/monetdb.mx,v
retrieving revision 1.20
retrieving revision 1.21
diff -u -d -r1.20 -r1.21
--- monetdb.mx  8 Apr 2008 10:58:59 -0000       1.20
+++ monetdb.mx  28 Aug 2008 13:02:51 -0000      1.21
@@ -25,7 +25,7 @@
 information about them are the primary goals of this tool.
 
 @h
-#define TOOLKIT_VERSION   "0.3"
+#define TOOLKIT_VERSION   "0.4"
 
 @c
 #include "sql_config.h"
@@ -213,6 +213,7 @@
                /* short one-line (default) mode */
                char *state;
                char uptime[12];
+               char avg[8];
                char *crash;
                char *dbname;
                int len;
@@ -236,7 +237,7 @@
                        state = "locked ";
 
                if (uplog.lastcrash == -1) {
-                       crash = "";
+                       crash = "-";
                } else {
                        struct tm *t;
                        crash = alloca(sizeof(char) * 20);
@@ -258,11 +259,13 @@
                } else {
                        dbname = stats->dbname;
                }
-               /* demo | state | uptime | crash */
-               printf("%-14s  %s %12s  %d %s\n",
+               /* demo | state | uptime | health */
+               secondsToString(avg, uplog.avguptime, 0);
+               printf("%-14s  %s %12s  %3d%%, %3s  %s\n",
                                dbname,
                                state, uptime,
-                               uplog.crashcntr, crash);
+                               100 - (uplog.crashcntr * 100 / uplog.startcntr),
+                               avg, crash);
        } else if (mode == 2) {
                /* long mode */
                char *state;
@@ -432,7 +435,7 @@
        if (mode == 1) {
                /* print header for short mode */
                /* demo | state uptime | crash lastcrash */
-               printf("     name        state     uptime     crashes\n");
+               printf("      name       state     uptime       health       
last crash\n");
        }
 
        if (doall == 1) {


-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Monetdb-sql-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/monetdb-sql-checkins

Reply via email to