简体   繁体   中英

Soap service - measuring response time

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 haven'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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM