[MOBY-dev] an easy way to see the input/output sizewhenusingjMoby?

Iván Párraga García ivanp at mmb.pcb.ub.es
Mon May 28 00:12:29 UTC 2007


Thanks a lot for your help Martin. Tomorrow I'll change my logging
system to use the new features.

Cheers,

------------------------------------------------
Iván Párraga García
Computer Scientist
Molecular Modelling & Bioinformatics Unit
INB - Instituto Nacional de Bioinformática
Josep Samitier 1-5
08028 Barcelona
Spain
tel.: +34 93 403 71 55
fax.: +34 93 403 71 57
e-mail: ivanp at mmb.pcb.ub.es
group page: http://mmb.pcb.ub.es 
pgp key: http://mmb.pcb.ub.es/~ivanp/pubkey.asc
------------------------------------------------



Martin Senger escribió:
>> However, the best would be to have a realistic size in bytes but it's
>> not a real need.
>>     
>
>
> To comply with the Ivan's request, I have added few new methods to the
> BaseService (the class that is used by all Moses-based services):
>
> * getHTTPHeaders() will allow the service to inspect what headers were used
> to deliver a request
>
> * getRequestLength() is only a convenient method extracting one particular
> header from the HTTP headers
>
> * getServletRequest() accessing all the richness of the servlet context.
>
> Together with already existing method getCallerAddr() you can, for example,
> have in your service the following code:
>
> log.info ("Request length: " + getRequestLength());
> log.info ("Request from: " + getCallerAddr());
> log.debug ("Request URL: " + getServletRequest().getRequestURL());
> log.debug ("Request headers: " + getHTTPHeaders().toString());
>
> In the src/samples, there is a new testing service (registered in the usual
> Central registry) TestServiceNotes that prints similar things in the service
> notes.
>
> Cheers,
> Martin
>
>   



More information about the MOBY-dev mailing list