costin 02/05/14 10:04:09 Modified: jk/native2/include jk_endpoint.h Log: The 'stats' we collect are now part of the endpoint - this is the best way to avoid threading issues. Using the worker is dangerous - there are many threads accessing the worker at the same time. Atomic operations may help, but they are not very portable and do have performance impact ( this is happening in the critical loop ). The downside of using the endpoint is that we'll have to agregate the data from all endpoints to get per/worker info. The data is in a struct that'll be in the scoreboard. Removed unused fields ( will be added in a later version, when we start adding new APIs ). Revision Changes Path 1.13 +25 -9 jakarta-tomcat-connectors/jk/native2/include/jk_endpoint.h Index: jk_endpoint.h =================================================================== RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native2/include/jk_endpoint.h,v retrieving revision 1.12 retrieving revision 1.13 diff -u -r1.12 -r1.13 --- jk_endpoint.h 3 May 2002 17:36:46 -0000 1.12 +++ jk_endpoint.h 14 May 2002 17:04:09 -0000 1.13 @@ -61,7 +61,7 @@ * Author: Gal Shachor <[EMAIL PROTECTED]> * Author: Dan Milstein <[EMAIL PROTECTED]> * Author: Henri Gomez <[EMAIL PROTECTED]> - * Version: $Revision: 1.12 $ + * Version: $Revision: 1.13 $ ***************************************************************************/ #ifndef JK_ENDPOINT_H @@ -80,10 +80,12 @@ #endif /* __cplusplus */ struct jk_endpoint; +struct jk_stat; struct jk_ws_service; struct jk_logger; struct jk_map; typedef struct jk_endpoint jk_endpoint_t; +typedef struct jk_stat jk_stat_t; /* XXX replace worker with channel, endpoints are specific to channels not workers */ @@ -151,8 +153,6 @@ */ struct jk_pool *cPool; - int proto; /* PROTOCOL USED AJP13/AJP14 */ - int sd; int reuse; @@ -170,20 +170,36 @@ struct jk_msg *post; struct jk_msg *request; /* original request storage */ - int uploadfd; /* future persistant storage id */ int recoverable; /* if exchange could be conducted on another TC ??? */ /* For redirecting endpoints like lb */ jk_endpoint_t *realEndpoint; - /* Ajp14-specific field, negotiate protocol features. - XXX Replace it with a name/value set */ - unsigned long negociation; - unsigned long negociated; - char *servletContainerName; + + /* The struct will be created in shm if available + */ + struct jk_stat *stats; + }; + +/** Statistics collected per endpoint + */ +struct jk_stat { + /* Number of requests served by this worker and the number of errors */ + int reqCnt; + int errCnt; + + /* Total time ( for average - divide by reqCnt ) and maxTime */ + long totalTime; + long maxTime; + + /* Active request + */ + char active[128]; +}; + #ifdef __cplusplus }
-- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>