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.

上一篇:java – jax-rs泽西@Post响应实体为空


下一篇:java – 使用一个不完全是JSON的主体