我有一个 Java 应用程序,我想记录每个 REST 服务的所有执行时间。
如何衡量每个请求的执行时间?如何配置过滤器?
最佳答案
Jersey 事件监听器
一定是您所追求的。
在他们的 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.
关于java - Jersey 记录服务的所有响应时间,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26867669/