Deep Instrumentation or "Deep Tracing"

Document ID : KB000030484
Last Modified Date : 14/02/2018
Show Technical Document Details

Methods are instrumented with the Intelligent Instrumentation probes based on a very specific algorithm applied when a class is loaded.


Step 1 - If class is skipped by any regular PBD directive, then Intelligent Instrumentation also skips the class.
Step 2 - If the methods within the class are instrumented by regular tracers defined in PBD entries then only regular instrumentation is applied, Intelligent Instrumentation skips the method.
Step 3 - If the method is not instrumented by Step2 then the skip directives of intelligent instrumentation are checked.
Step 4 (If it passes Step 3), then byte code for the method is tokenized, parsed and is assigned a score based on method complexity (method size, presence of loops, calls into other packages, etc).
Step 5 - When the cumulative score of the method exceeds a configured value instrumentation level , the method is marked for Intelligent Instrumentation and the parsing stops.
Step 6 - If the parsing of the method finishes and the cumulative score of the method is below the instrumentation level, then the method is not instrumented.

CONSIDERATIONS:
We will discover interesting methods without requiring a PBD and the auto instrumented methods will appear in Transaction Traces and are referred to as deep components (these deep components will also show up in Error snapshots).


Talking about classes and this might be the confusion as deep tracing will discover methods instead of classes.  As an example,we can see TRACE messages in Agent.log if we add the following property:

log4j.logger.IntroscopeAgent.IntelligentInstrumentation=TRACE#com.wily.util.feedback.Log4JSeverityLevel, console, logfile

9/26/14 04:59:43 PM JST [TRACE]
[IntroscopeAgent.IntelligentInstrumentation] Token stream for: <init>()V[my/wily/introscope/agent/dummy/InheritanceTest]<METHOD_START>:<METHOD_START><PUBLIC>:<PUBLIC><CUSTOM_PACK_METHOD_CALL>:<CUSTOM_PACK_METHOD_CALL><METHOD_END>:<METHOD_END>.