Customizing the JXInsight Traces
 


Introduction
In a previous Insight article I showed how JXInsight can perform distributed performance profiling via a sample CORBA client-server application that ships with the product which can be found in /samples/corba. In this article I will show a new feature introduced in JXInsight 4.1 that allows customers to extend the console by including custom icons for user defined trace extensions. This is the first step in creating a customized version of JXInsight suitable for embedding in commercial products that require built-in performance management capabilities for operations and product support staff.


Sample Application
In JXInsight 4.1 the CORBA sample application client source code has been edited to introduce explicit trace profile points. The call, Tracer.add("{myapp}=Client"), creates a logical grouping that aggregates nested traces. The type of the trace is "myapp" the identifier of the trace is "Client". Creating a trace via the add operation pops a trace identifier onto the trace stack without metrics or Java call stacks recording - metrics are derived from nested traces. The call, Tracer.start("${myapp.mycomp}=Adder"), starts a trace with metric counters and Java call stacks recorded. The trace type is "myapp.mycomp" and the trace identifier "Adder".

Further information regarding the Tracer API can be found in the Java documentation shipped with the product or online.



File Naming Pattern
Custom trace extensions can install icons for trace types by placing gif images of size (16 x 16 pixels) in the /icons directory of the console installation. When displaying a trace in the profile or timeline analysis modes the console will look for an icon that starts with the trace type and ends with ".trace16.gif". When a trace type contains the character '.' then each namespace is parsed and an attempt is made to load the icon. For example a trace type of "myapp.mycomp.myclass" will result in the following icon searches

/icons/myapp.mycomp.myclass.trace16.gif
/icons/myapp.mycomp.trace16.gif
/icons/myapp.trace16.gif

If no suitable icon is found then the default trace icon, trace16.gif, distributed within the JXInsight console distributed is used. Sample Adobe Photoshop PSD files and gif files that can serve as the basis for trace icon can be found in samples/icons directory.


Installation
Using the sample trace icons shipped with the product distribution and connecting the console to the CORBA client and server JVM processes the custom trace icons are now loaded into the console when traces with the custom types are displayed. The following screen shot shows custom trace icons displayed in a table within the Trace perspectives of the Profile analysis mode.



The following screen shot shows the introduction of the custom trace icons into the timeline analysis visualizations.




Benefits
Today many developers spend a significant amount of their time introducing logging and trace statements into the code. The benefits of such instrumentation are not being realized because of poor tooling support, insufficient metric capture and correlation as well as high performance overhead. With JXInsight's Tracer API and its management console software engineers can embed a powerful agent within applications and software products delivering an sophisticated performance management solution to operations and support personnel.


Future Articles
In Part 2 I will show how AOP technologies such as AspectJ can be used to inject custom JXInsight traces into Java applications and the benefits of using the Tracer API such as low performance overhead and efficient performance profile visualizations in the JXInsight award winning application management console.

William Louth, JXInsight Product Architect