Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[aspectj-users] Question about profiling

Hello,

I am quite new to AspectJ and I would like to write a profiling aspect that hooks into all method calls of a package and its subpackages.

Before every call the current system time should be saved and after the
call the method execution time should be determined.

My problem is that I do not know where to store the variable for the
start time stamp. Storing it in the aspect does not work as it seems to
be global and is therefore destroyed by calls within the method.

Storing it in java.lang.Object does not work either as the weaver does
not have access to that class.

Is there a way to store a variable in an aspect in a way that it is unique to a method call (or at least to the object calling/being called)?

Sorry if this is a FAQ, but I've found nothing that would explain how to solve this.

Thanks in advance,

Johann Uhrmann



Back to the top