Update of /cvsroot/monetdb/MonetDB5/src/modules/mal
In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv18380/modules/mal
Modified Files:
clients.mx
Log Message:
Add a few statistics for tracking client behavior.
Index: clients.mx
===================================================================
RCS file: /cvsroot/monetdb/MonetDB5/src/modules/mal/clients.mx,v
retrieving revision 1.67
retrieving revision 1.68
diff -u -d -r1.67 -r1.68
--- clients.mx 1 Jul 2007 22:00:59 -0000 1.67
+++ clients.mx 5 Sep 2007 18:13:17 -0000 1.68
@@ -66,6 +66,14 @@
address CLTLogin
comment "Pseudo bat of client login time.";
+command getActions( ):bat[:int,:int]
+address CLTActions
+comment "Pseudo bat of client command counts.";
+
+command getTime( ):bat[:int,:lng]
+address CLTTime
+comment "Pseudo bat of client total time usage(in usec).";
+
command getUsers( ):bat[:int,:str]
address CLTusers
comment "Pseudo bat of users logged in.";
@@ -78,6 +86,13 @@
command wakeup(id:int):void
address CLTwakeup
comment "Wakeup a client process";
+
+command shutdown(forced:bit):void
+address CLTshutdown
+comment "Close all client connections. If forced=false the
+clients are moved into FINISHING mode, which means that
+the process stops at the next cycle of the scenario.
+If forced=true all client processes are immediately killed";
@-
@{
@include prelude.mx
@@ -110,6 +125,8 @@
clients_export str CLTexit(int *ret);
clients_export str CLTquit(int *ret);
clients_export str CLTLogin(int *ret);
+clients_export str CLTActions(int *ret);
+clients_export str CLTTime(int *ret);
clients_export str CLTInfo(int *ret);
clients_export str CLTsuspend(int *ret, int *id);
@@ -123,6 +140,7 @@
clients_export str CLTaddScenario(int *ret, str *usr, str *sc);
clients_export str CLTremoveScenario(int *ret, str *usr, str *sc);
clients_export str CLTgetUsers(bat *ret, bat *scens);
+clients_export str CLTshutdown(int *ret, bit *forced);
#endif /* _CLIENTS_H */
@c
@@ -270,6 +288,42 @@
@:Pseudo(client,login,)@
return MAL_SUCCEED;
}
+str
+CLTActions(int *ret)
+{
+ BAT *b = BATnew(TYPE_int, TYPE_int, 12);
+ int i;
+
+ if (b == 0)
+ throw(MAL, "clients.getActions", "failed to create BAT");
+ for (i = 0; i < MAL_MAXCLIENTS; i++) {
+ Client c = mal_clients+i;
+ if (c->mode >= CLAIMED && c->user != oid_nil) {
+ BUNins(b, &i, &c->actions, FALSE);
+ }
+ }
+ if (!(b->batDirty&2)) b = BATsetaccess(b, BAT_READ);
+ @:Pseudo(client,actions,)@
+ return MAL_SUCCEED;
+}
+str
+CLTTime(int *ret)
+{
+ BAT *b = BATnew(TYPE_int, TYPE_lng, 12);
+ int i;
+
+ if (b == 0)
+ throw(MAL, "clients.getTime", "failed to create BAT");
+ for (i = 0; i < MAL_MAXCLIENTS; i++) {
+ Client c = mal_clients+i;
+ if (c->mode >= CLAIMED && c->user != oid_nil) {
+ BUNins(b, &i, &c->totaltime, FALSE);
+ }
+ }
+ if (!(b->batDirty&2)) b = BATsetaccess(b, BAT_READ);
+ @:Pseudo(client,usec,)@
+ return MAL_SUCCEED;
+}
@-
Produce a list of clients currently logged in
@@ -468,4 +522,10 @@
rethrow("getUsers", tmp, AUTHgetUsers(ret, scens));
return(MAL_SUCCEED);
}
+
+str CLTshutdown(int *ret, bit *forced) {
+ (void) ret;
+ (void) forced;
+ throw(MAL,"clients.shutdown","not yet implemented");
+}
@}
-------------------------------------------------------------------------
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