简体   繁体   English

肥皂服务-测量响应时间

[英]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. 我正在寻找一个从接收请求(将肥皂消息进行了编组)到响应(将返回给客户端)之前的点之间的SOAP服务的响应时间。 I'm looking for some tips on how to accurately measure this? 我正在寻找一些技巧,以准确地衡量这一点? I don't suppose it matters that it's a SOAP service. 我认为这是SOAP服务并不重要。 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. 我正在使用JAX-WS并使用JAX-WS附带的应用程序服务器来测试Web服务,因此我还没有选择Web服务器。

Your servlet container is likely to offer you an option to log the time taken to process each request on the server. 您的servlet容器可能会为您提供一个选项,以记录在服务器上处理每个请求所花费的时间。 In tomcat this is done by registering a valve in server.xml: 在tomcat中,这是通过在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). t=%D将显示t=xx ,其中xx是花费的时间(以毫秒为单位)。 The element should be nested in your <Host> element. 该元素应嵌套在您的<Host>元素中。

If you want to measure only the processing time, without any request handling, marshalling, etc. then you need some AOP / interceptor / filter. 如果你想测量处理时间,没有任何请求处理,编组,等等,那么你需要一些AOP /拦截器/过滤器。 It depends very much on your technology stack, but in either spring , EJB or CDI you can have interceptors around your services. 它在很大程度上取决于您的技术堆栈,但是在springEJBCDI中,您可以在服务周围使用拦截器。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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