title: How to get method execution flow in spring mvc interceptor
body: <p>I want to get the complete execution flow along with their execution time in spring mvc project.</p>
  
  <pre><code>public class MetricsInterceptor extends HandlerInterceptorAdapter {
  
  @Override
  public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {
      if (handler instanceof HandlerMethod) {
          HandlerMethod hm = (HandlerMethod) handler;
          Method method = hm.getMethod();
          if (method.getDeclaringClass().isAnnotationPresent(Controller.class)) {
              if (method.isAnnotationPresent(Metrics.class)) {
                 // System.out.println(method.getAnnotation(Metrics.class).value());
                  System.out.println(method.getName());
              }
          }
      }
      return super.preHandle(request, response, handler);
  }
  
  @Override
  public void postHandle(HttpServletRequest request, HttpServletResponse response, Object handler, ModelAndView modelAndView) throws Exception {
      super.postHandle(request, response, handler, modelAndView);
  }
  
  @Override
  public void afterCompletion(HttpServletRequest request, HttpServletResponse response, Object handler, Exception ex) throws Exception {
      super.afterCompletion(request, response, handler, ex);
  }
  </code></pre>
  
  <p>}</p>
  
  <p>I am getting controller classes and method with @Metrics annotation to log metrics of few methods. What i want is to get entire method execution flow(Controller-->Service-->DAO) along time spent in each method. Is there anyway to get that information in postHandle() or afterCompletion(). Please suggest.</p>