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

Modified Files:
        clients.mx 
Log Message:
Added client inspection routines


Index: clients.mx
===================================================================
RCS file: /cvsroot/monetdb/MonetDB5/src/modules/mal/clients.mx,v
retrieving revision 1.68
retrieving revision 1.69
diff -u -d -r1.68 -r1.69
--- clients.mx  5 Sep 2007 18:13:17 -0000       1.68
+++ clients.mx  8 Sep 2007 19:03:27 -0000       1.69
@@ -66,13 +66,17 @@
 address CLTLogin
 comment "Pseudo bat of client login time.";
 
+command getLastCommand( ):bat[:int,:str] 
+address CLTLastCommand
+comment "Pseudo bat of client's last command time.";
+
 command getActions( ):bat[:int,:int] 
 address CLTActions
-comment "Pseudo bat of client command counts.";
+comment "Pseudo bat of client's command counts.";
 
 command getTime( ):bat[:int,:lng] 
 address CLTTime
-comment "Pseudo bat of client total time usage(in usec).";
+comment "Pseudo bat of client's total time usage(in usec).";
 
 command getUsers( ):bat[:int,:str] 
 address CLTusers
@@ -125,6 +129,7 @@
 clients_export str CLTexit(int *ret);
 clients_export str CLTquit(int *ret);
 clients_export str CLTLogin(int *ret);
+clients_export str CLTLastCommand(int *ret);
 clients_export str CLTActions(int *ret);
 clients_export str CLTTime(int *ret);
 clients_export str CLTInfo(int *ret);
@@ -288,6 +293,28 @@
        @:Pseudo(client,login,)@
        return MAL_SUCCEED;
 }
+
+str
+CLTLastCommand(int *ret)
+{
+       BAT *b = BATnew(TYPE_int, TYPE_str, 12);
+       int i;
+       char s[26];
+
+       if (b == 0)
+               throw(MAL, "clients.getLastCommand", "failed to create BAT");
+       for (i = 0; i < MAL_MAXCLIENTS; i++) {
+               Client c = mal_clients+i;
+               if (c->mode >= CLAIMED && c->user != oid_nil) {
+                       CLTtimeConvert((time_t) c->lastcmd,s);
+                       BUNins(b, &i, s, FALSE);
+               }
+       }
+       if (!(b->batDirty&2)) b = BATsetaccess(b, BAT_READ);
+       @:Pseudo(client,lastcommand,)@
+       return MAL_SUCCEED;
+}
+
 str
 CLTActions(int *ret)
 {


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