aboutsummaryrefslogtreecommitdiffstats
path: root/docs/sandbox/common/tracing/Logging.java
diff options
context:
space:
mode:
Diffstat (limited to 'docs/sandbox/common/tracing/Logging.java')
-rw-r--r--docs/sandbox/common/tracing/Logging.java28
1 files changed, 28 insertions, 0 deletions
diff --git a/docs/sandbox/common/tracing/Logging.java b/docs/sandbox/common/tracing/Logging.java
new file mode 100644
index 000000000..349abb235
--- /dev/null
+++ b/docs/sandbox/common/tracing/Logging.java
@@ -0,0 +1,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...
+ }
+}