Performance monitoring with AspectJ, Part 2


News: Performance monitoring with AspectJ, Part 2

  1. Performance monitoring with AspectJ, Part 2 (6 messages)

    In Performance Monitoring with AspectJ Rob Bodkin demonstrates how to extend the Glassbox Inspector to provide information about the performance of a more complex set of interactions within a web application. The article demonstrates Spring, Struts, JSP and WebServices integration.
    In this second half of my foray into performance monitoring with AspectJ, I extend the Glassbox Inspector to provide more meaningful information about application performance by adding monitors that track the interaction of controllers for the Struts and Spring Web application frameworks, as well as serving and requesting Web services operations. I also extend the system to support multiple applications and add an error-handling layer and the ability to easily enable and disable monitoring at run time. I conclude the article by showing you how to deploy the Glassbox Inspector using load-time weaving and how to measure the resulting overhead.

    The Glassbox Inspector, a product of the Glassbox project, is a low overhead performance-monitoring tool that can be used in production environments. It combines AspectJ and JMX to capture important performance metrics. Metrics such as total counts, total time, and worst case performance for requests are maintained by the system for further downstream analysis.
  2. Great project!! So many things to check out and so little time.. All the best Ron! In the past, I have used hacks with dynaop and javassist to modify class files while they were being loaded. Used threadlocal to get a nested context. I could specify my "pointcuts" in a properties file along with info about whether I wanted a time snapshot or "peek" info (parameters+return val). Would view all of this by "tailing" a log file. Low tech and simple, but a hack in every sense.<br><br>Glad to see that you are doing it right! I have been forcing myself to chew on the AspectJ syntax lately, and it is good to have your project to play around with as an implementation. Hopefully, it will help with the indigestion :-).
  3. Congratulations on the Glassbox team! Their work is mostly impressive, even is a bit memory hungry for my liking (see end of article).

    Another alternative to web-application monitoring is MessAdmin, which does not use code weaving at all. MessAdmin enables you to monitor HttpSessions, including sending messages to remote users. It is very light-weight, and exposes everything though an integrated WebApp of its own and via JMX. Go see for yourself!
  4. The AOP@Work series contains some great articles, and this one is no exception. You can see the full set of articles here ( - and there are more in the pipeline.

    It's especially nice to see some of the new AspectJ 5 features exercised in this article. We've just released milestone 5 of the AspectJ compiler (see, and the latest AJDT builds have integrated launch profile support for load-time weaving (see

    I expect memory and start-up times with LTW to reduce significantly as we begin to optimise the weaver for use in this mode :- a lot of the required infrastructure for this support is already in the AJ 5 codebase, but we have more still to do...
  5. Great article and great tool (AspectJ). I'm playing little bit with AspectJ for some time. I wrote also some peroformance monitoring tools, however not so great as your. What is for me problem with AspectJ:
    - Strange syntax for pointcuts. It will be nice to have some wizard in Eclipse which will help to write poincut patterns. I'm really good in writing regexp (sed, vim, ...) but pointcuts make me headache.
    - Certification for some servers. For now we are not able to use it in production environment (financial institution). It will be nice to have certification for WebSphere, Tomcat, Sun JDK, IBM JDK, BEA WebLogic.
    - PerPointcut designator ... I guess you know what I mean.

    Anyway thanks for great tool which after years of hard work smell like good piece of IT science applied in practice.
  6. Hi,
    you should look towards the infrared project, which seems similar to glassbox, but done with aspectwerkz:


  7. Thanks and Please Participate[ Go to top ]

    Thank you all for the positive feedback. I think there's a great opportunity with this open source project to create effective performance monitoring, that leverages the power of AOP and lets you easily extend and configure how it works without having to become an AspectJ expert overnight.

    I'm really excited at the opportunity to collaborate with others to test and document how to work in different environments. We'd love to help projects try the technology and make it work for you. And we'd be very interested in contributions and in helping others extend it to work with their servers and code bases.
    As the article and Adrian echoed, AspectJ 5 hasn't been released yet. We've been working with the AspectJ committers to tune the performance and memory characteristics of AspectJ 5 load-time weaving in general, and of course for the Inspector in particular.