blob: 349abb235c6f7014a8e4041aa4bb20345df34979 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
|
package tracing;
import org.aspectj.lang.Signature;
/**
* @author Wes Isberg
*/
aspect A {
// START-SAMPLE tracing-simpleTiming Record time to execute public methods
/** record time to execute my public methods */
Object around() : execution(public * com.company..*.* (..)) {
long start = System.currentTimeMillis();
try {
return proceed();
} finally {
long end = System.currentTimeMillis();
recordTime(start, end,
thisJoinPointStaticPart.getSignature());
}
}
// implement recordTime...
// END-SAMPLE tracing-simpleTiming
void recordTime(long start, long end, Signature sig) {
// to implement...
}
}
|