我有一个Java应用程序,我想记录每个REST服务的所有执行时间.
如何衡量每个请求的执行时间?如何配置过滤器?
解决方法:
泽西事件听众必须是你所追求的.
有关监视和跟踪的docs中提到的这类事件监听器有两种:
ApplicationEventListener
for listening to application events, andRequestEventListener
for listening to events of request processingOnly 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.