编程语言
首页 > 编程语言> > java – Jersey记录服务的所有响应时间

java – Jersey记录服务的所有响应时间

作者:互联网

我有一个Java应用程序,我想记录每个REST服务的所有执行时间.

如何衡量每个请求的执行时间?如何配置过滤器?

解决方法:

泽西事件听众必须是你所追求的.

有关监视和跟踪的docs中提到的这类事件监听器有两种:

  • ApplicationEventListener for listening to application events, and
  • RequestEventListener for listening to events of request processing

Only the first type, ApplicationEventListener can be directly
registered as an application-wide provider. The RequestEventListener
is designed to be specific to every request and can be only returned
from the ApplicationEventListener as such.

标签:restful-url,java,jersey
来源: https://codeday.me/bug/20190728/1560702.html