Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[aspectj-users] Re: aspectj-users Digest, Vol 34, Issue 4

Hi Ashley,

If you are trying to using the AspectJ for capturing performance metrics then you might consider using an alternative measurement and data source technique than what is outlined below. Logger is never going to be suitable for fine grain measurement. The overhead is enormous relatively to a tuned performance profiling or resource metering solution. Maybe you should consider not writing yet another tracing/logger aop adhoc solution and instead consider using AspectJ to integrate into a performance management solution that already offers this at a much less cost (overhead) with correct and automated analysis. There is at least one mature, scalable, and reliable solution on the market that offers integration with AspectJ - you only need to define your aop.xml or use the existing ones for various technologies. There are other solutions with varying levels of quality in the making.

Kind regards,

William

>Today's Topics:
>
> 1. Re: after throwing problem (Ashley Williams)
>
>
>----------------------------------------------------------------------
>
>Message: 1
>Date: Mon, 3 Dec 2007 10:26:32 +0000
>From: Ashley Williams <ashley.williams@xxxxxx>
>Subject: Re: [aspectj-users] after throwing problem
>To: aspectj-users@xxxxxxxxxxx
>Message-ID:
> <OFE9372C80.226BC761-ON802573A6.0038AFCC-802573A6.00395CD7@xxxxxx>
>Content-Type: text/plain; charset="us-ascii"
>
>Thanks for spending time on this. I've decided to exclusively use the
>language extentions
>for now and avoid using annotations as markers. This strategy seems to be
>working really
>well and my initial excitement with aspectj has now been rekindled.
>
>My next task will be to capture some better performance metrics. The
>rudimentary metrics
>I captured with the annotation style of development didn't look good:
>aspect tracing was
>10 times slower than hardcoded tracing for a single method called a
>million times. I obviously
>can't take this story to the team if I'm to persuade them to begin
>adoption of aspectj.
>
>However my tracing implementation is a lot simpler now without the need
>for annotation markers
>or pertypewithin facility. I will report back on my performance findings.
>
>- Ashley
>
>aspectj-users-bounces@xxxxxxxxxxx wrote on 01/12/2007 12:46:54:
>
>> I have a workaround for now if you need it, change the order of the
>> parameters in logException, from:
>>
>> public void logException(JoinPoint thisJoinPoint, Tracing tracing,
>> Throwable t) {
>>
>> to
>>
>> public void logException(JoinPoint thisJoinPoint, Throwable t, Tracing
>> tracing) {
>>
>> Andy.
>>
>> On 29/11/2007, Ashley Williams <ashley.williams@xxxxxx> wrote:
>> >
>> > Hi,
>> >
>> > Having converted my aspects to use the @AspectJ style, I'm now getting
>a
>> > strange error message when a compile my tracing aspect,.
>> > First here is the section of code:
>> >
>> >
>> > @Pointcut("execution(@Tracing * *(..)) &&
>@annotation(tracing)")
>> > void annotatedMethods(Tracing tracing) {
>> > }
>> >
>> > @AfterThrowing(pointcut = "annotatedMethods(tracing)",
>throwing =
>> > "t")
>> > public void logException(JoinPoint thisJoinPoint, Tracing
>tracing,
>> > Throwable t) {
>> > Level level = Level.toLevel(tracing.level());
>> > if (logger.isEnabledFor(level)) {
>> > logger.log(level,
>> > formatter.formatSignatureThrowing(thisJoinPoint),
>> > t);
>> > }
>> > }
>> >
>> > So I am matching on all methods annotated with @Tracing and logging
>the
>> > subclass of Throwable that may have been thrown.
>> > However when I run my test case i get the following error:
>> >
>> > java.lang.VerifyError: (class: com/db/abfo/tracing/PojoOne, method:
>> > calculate signature: ()V) catch_type not a subclass of Throwable
>> >
>> > This used to work when I used the aspectj after throwing language
>extention
>> > form:
>> >
>> >
>> > pointcut annotatedMethods(Tracing tracing) :
>execution(@Tracing *
>> > *(..)) && @annotation(tracing);
>> >
>> > after(Tracing tracing) throwing(Throwable t) :
>> > annotatedMethods(tracing) {
>> > Level level = tracing.level().getLevel();
>> > if (logger.isEnabledFor(level)) {
>> > logger.log(level,
>> > formatter.formatSignatureThrowing(thisJoinPoint),
>> > t);
>> > }
>> > }
>> >
>> > Any ideas?
>> > - Ashley
>> > ---
>> >
>> > This e-mail may contain confidential and/or privileged information.
>If you
>> > are not the intended recipient (or have received this e-mail in error)
>> > please notify the sender immediately and delete this e-mail. Any
>> > unauthorized copying, disclosure or distribution of the material in
>this
>> > e-mail is strictly forbidden.
>> >
>> > Please refer to
>> > http://www.db.com/en/content/eu_disclosures.htm for
>> > additional EU corporate and regulatory disclosures.
>> >
>> > _______________________________________________
>> > aspectj-users mailing list
>> > aspectj-users@xxxxxxxxxxx
>> > https://dev.eclipse.org/mailman/listinfo/aspectj-users
>> >
>> >
>> _______________________________________________
>> aspectj-users mailing list
>> aspectj-users@xxxxxxxxxxx
>> https://dev.eclipse.org/mailman/listinfo/aspectj-users
>
>
>---
>
>This e-mail may contain confidential and/or privileged information. If you are not the intended recipient (or have received this e-mail in error) please notify the sender immediately and delete this e-mail. Any unauthorized copying, disclosure or distribution of the material in this e-mail is strictly forbidden.
>
>Please refer to http://www.db.com/en/content/eu_disclosures.htm for additional EU corporate and regulatory disclosures.
>-------------- next part --------------
>An HTML attachment was scrubbed...
>URL: https://dev.eclipse.org/mailman/listinfo/aspectj-users/attachments/20071203/b41f19dc/attachment.html
>
>------------------------------
>
>_______________________________________________
>aspectj-users mailing list
>aspectj-users@xxxxxxxxxxx
>https://dev.eclipse.org/mailman/listinfo/aspectj-users
>
>
>End of aspectj-users Digest, Vol 34, Issue 4
>********************************************
>

Back to the top