Hi all,

Do you guys think it's a good idea to implement annotations for PerfLogger?
Currently, we have to surround the code with a PerfLogBegin and a
PerfLogEnd to log execution time. There are many methods where the first
and last line are these. Instead, we could use AOP to create an annotation
and annotate a method.

I have done a small POC with AspectJ:
https://github.com/soumyakanti3578/hive/tree/annotated-perf-logger
<https://github.com/soumyakanti3578/hive/commit/ff7d94cfe77e00d48a9edb389816efd5c4cd6349>
I had to just add 2 dependencies to hive-exec, create an annotation
(@LogPerf), and an Aspect (PerfLoggerAspect). I tested it on my local
machine and it works well.

PerfLogBegin takes 2 arguments - callerName, and method. And PerfLogEnd
takes an additional argument - additionalInfo. These three arguments can be
passed through the annotation.

I think this will help clean up our source code a little bit. Please let me
know what you think about this.

Thanks,
Soumyakanti Das

Reply via email to