Announcement Announcement Module
Collapse
No announcement yet.
Using AOP to get timing data Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Using AOP to get timing data

    Hi,

    I need to get timing data to deterimine the length of time a method call takes. I thought that perhaps AOP would be a good approach. Then I could have some sort of class store a "start time" in a MethodBeforeAdvice and then work with that class in the AfterReturningAdvice. However, I'm not sure of the approach for storing this state. I was thinking about having a class that uses ThreadLocal, but so far my attempts don't appear to be working. Perhaps I'm misusing ThreadLocal?

  • #2
    You could use one of Spring's existing interceptors for this:

    http://www.springframework.org/docs/...terceptor.html

    Comment


    • #3
      I'll have to take a closer look at that. Thanks.

      Comment


      • #4
        mraible,

        Thanks.. that took my approach in a whole other direction that was far more effective. I appreciate you pointing that out.

        Comment

        Working...
        X