开发者

Soap service - measuring response time

开发者 https://www.devze.com 2023-03-25 20:07 出处:网络
I\'m looking to measure the response time of a SOAP service from the time that the request is received (the soap message is demarshalled) to the point just before the response (that will go back to th

I'm looking to measure the response time of a SOAP service from the time that the request is received (the soap message is demarshalled) to the point just before the response (that will go back to the client) will be marshalled. I'm looking for some tips on how to accurately measure this? I don't suppose it matters that it's a SOAP service. Regardless, should I just use a timer or is there a tool out there that would suffice? I'm using JAX-WS and using the application server that ships with JAX-WS for testing web services, so I hav开发者_运维问答en't picked a web server yet.


Your servlet container is likely to offer you an option to log the time taken to process each request on the server. In tomcat this is done by registering a valve in server.xml:

<Valve className="org.apache.catalina.valves.AccessLogValve" 
   directory="/var/www/logs"  prefix="access_" 
   suffix=".log" pattern="%h %l %u %t &quot;%r&quot; %s %b, t=%D" 
   resolveHosts="false"/>

t=%D will show t=xx, where xx is the time taken (in millis). The element should be nested in your <Host> element.

If you want to measure only the processing time, without any request handling, marshalling, etc. then you need some AOP / interceptor / filter. It depends very much on your technology stack, but in either spring, EJB or CDI you can have interceptors around your services.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号