costin 02/05/14 10:13:23 Modified: jk/native2/common jk_endpoint.c Log: Add getters for the info we collect. Revision Changes Path 1.11 +20 -4 jakarta-tomcat-connectors/jk/native2/common/jk_endpoint.c Index: jk_endpoint.c =================================================================== RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native2/common/jk_endpoint.c,v retrieving revision 1.10 retrieving revision 1.11 diff -u -r1.10 -r1.11 --- jk_endpoint.c 8 May 2002 23:51:05 -0000 1.10 +++ jk_endpoint.c 14 May 2002 17:13:22 -0000 1.11 @@ -73,7 +73,7 @@ #include "jk_objCache.h" #include "jk_registry.h" -static char *myAttInfo[]={ "channel", "active", NULL }; +static char *myAttInfo[]={ "channel", "active", "reqCnt", "errCnt", NULL }; /** Will return endpoint specific runtime properties * @@ -92,9 +92,16 @@ } else if (strcmp( name, "active" )==0 ) { if( ep->currentRequest != NULL ) return ep->currentRequest->req_uri; - } else { - return NULL; + } else if (strcmp( name, "reqCnt" )==0 ) { + char *buf=env->tmpPool->calloc( env, env->tmpPool, 20 ); + sprintf( buf, "%d", ep->stats->reqCnt ); + return buf; + } else if (strcmp( name, "errCnt" )==0 ) { + char *buf=env->tmpPool->calloc( env, env->tmpPool, 20 ); + sprintf( buf, "%d", ep->stats->errCnt ); + return buf; } + return NULL; } @@ -105,8 +112,10 @@ { jk_endpoint_t *e = (jk_endpoint_t *)pool->alloc(env, pool, sizeof(jk_endpoint_t)); + jk_workerEnv_t *workerEnv; + jk_stat_t *stats; jk_pool_t *endpointPool = pool->create( env, pool, HUGE_POOL_SIZE ); - + if (e==NULL) { env->l->jkLog(env, env->l, JK_LOG_ERROR, "endpoint.factory() OutOfMemoryException\n"); @@ -135,5 +144,12 @@ result->object = e; e->mbean=result; + workerEnv=env->getByName( env, "workerEnv" ); + + /* XXX alloc it inside the shm */ + stats = (jk_stat_t *)pool->calloc( env, pool, sizeof( jk_stat_t ) ); + + e->stats=stats; + return JK_OK; }
-- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>