The AppMon Client enables you to analyze PurePaths down to the individual methods that have been instrumented in the context of the captured transaction. The PurePath contains information such as method arguments, execution time, and CPU time. When you identify a problematic method either in the PurePath view or in the Methods view of the AppMon Client, you can use the Source Code Lookup feature provided by the AppMon Client to go deeper in the source code that is associated with the method.
This insight into the source code provides deeper analysis of the captured data.
The AppMon Server keeps all metadata information for all classes that are loaded by the connected AppMon Agent. In combination with the data collected in the PurePath, this metadata enables the AppMon Client to perform different types of Source Code Lookup.
The following types of lookup are available:
- Open in IDE:Jumps to the source code line in your IDE if you have the Visual Studio Solution or Eclipse Project open.
- Decompile Byte Code: Decompiles the Java byte code and displays it in a human-readable format.
- Decompile IL Code: Decompiles the .NET intermediate code and displays it in a human-readable format.
- Decompile Source Code: Decompiles the Java source code and displays it in a human-readable format.
- Open in Reflector: Extracts the .NET assembly that contains the selected method and opens .NET Reflector to decompile it.
- Save Byte Code: Exports Java byte code to a file that can be analyzed with external tools.
Open in IDE (Eclipse or Visual Studio)
To use this feature, you must:
- Install AppMon CodeLink Add-In For Microsoft Visual Studio or Eclipse Integration Plugin, depending on the IDE you are using.
- Open the Visual Studio Solution or Eclipse Project that contains the source code you want to look up.
When you have a captured PurePath, right-click a method and select Source Lookup > Open in IDE.
If the source code lookup is not successful, the status bar in the AppMon Client displays the message
Source lookup was not successful. The likely reason is that the selected method was not part of the open Visual Studio Solution or Eclipse Project.
If you have more than one Visual Studio or Eclipse instance open, you are prompted to select a particular instance to perform the source code lookup.
If you have multiple projects in your IDE workspace that contain multiple matching method names, you are prompted to select the project for lookup.
Decompile Byte Code
Java code is compiled into byte code that is interpreted by the Java Runtime during execution. Use Decompile Byte Code to explore the byte code for any method, either your own code or code that runs in the Java Application. The byte code view shows a human-readable representation of the Java instructions that make up the method body.
To view the byte code of an instrumented method or the complete instrumented class, right-click the object and select Source Lookup > Decompile Byte Code.
Decompile IL Code
Any .NET language (for example, C# and VB.NET) is compiled into intermediate code that is interpreted by the .NET Runtime during execution.
Use Decompile IL Code to explore the intermediate code for any .NET method, either your own code or code that runs in the .NET application.
You can look up the intermediate code of an instrumented method or the complete instrumented class. The intermediate code view shows a human-readable representation of the .NET Runtime instructions that make up the method body.
Decompile Source Code
Java programming code is compiled into byte code that is interpreted by the Java Runtime during execution. Use Decompile Source Code to explore the Java programming code that is generated based on the Java byte code, either your own code or code that runs in your Java application.
You can look up the decompiled Java source code of an instrumented method or the complete instrumented class. The Source Code view shows a decompiled representation of the Java Runtime instructions that make up the method body.
Open in Reflector
The .NET Reflector is a tool that decompiles .NET Assemblies.
To use the Open in Reflector command, you must download and install the .NET Reflector Plugin.
When the plugin is installed and enabled, you can look up a method's source code through .NET Reflector.
Save Byte Code
Use Save Byte Code to export the Java byte code of the Java class that implements the selected method. You can use the exported file with any Java decompiler tool to analyze the internals of this method and all other methods of the class.
Right-click the method and select Save Byte Code. You are prompted to specify a target file name. Optionally, navigate to the folder where you want to save the file.
Views in AppMon Client that offer source code lookup
The following views allow Source Code Lookup:
- PurePath Tree
- Methods View
- Deployed Sensor View
Click any node in the PurePath tree and use the context menu to perform a Source Code Lookup.
In the Methods view, you can perform Source Code Lookup on packages, classes, and methods:
- Packages: You can save the byte code to a file, as previously described.
- Classes and methods: You can perform all lookups.
Deployed Sensor view
The Deployed Sensor view lets you perform source code lookup on every method deployed in the selected agent. The view is accessible from the Systems Overview view.
Source code viewer
For most of the Source Code Lookup commands, the Source Code Viewer shows the human-readable version of the .NET or Java byte code or source code. It first shows the complete decompiled class, then jumps to the first occurrence of the class or method name that you selected for the Source Code Lookup. The first occurrence of this text might not be the method or class that you are looking The viewer includes a search feature to navigate through all occurrences of the text.