Static and Dynamic Code Instrumentation

You have 3 different approaches to use SpyGlass Tracer:

  1. dynamic instrumentation during class loading (requires Java 1.5 or better)
  2. static bytecode instrumentation on compile time (requires Java 1.5 or better)
  3. on-the-fly instrumentation for already running applications (requires Java 1.6 or better)

Dynamic instrumentation is based on the idea that you can modify bytecode, adding probes, during class loading time. This is a really practical approach that doesn't require any source code or build script modification. This approach is based on standard Java Agent API and requires you to register SpyGlass Tracer Agent as a javaagent in java running scripts (see documentation for more details).

The second approach is based on an ant task that can be used during build time to produce java packages already configured to send statistics to SpyGlass Tracer Agent. In this configuration SpyGlass Tracer Agent is a simple jar you need to add to your lib folder. Pay attention to statically instrument all needed jar (this depends by your specific projects and may require some investigations).

The third approach is useful if you need to monitor an application that is not build or startup using previous techniques. You can connect to a remote JVM and load agent at runtime and request class reload and instrumentation. This solution requires Java 1.6 or better.

Ti informiamo che, per migliorare la tua esperienza di navigazione su questo sito, sono utilizzati cookie tecnici e cookie di terze parti e non cookie di profilazione.
Alla pagina privacy avere maggiori dettagli ai sensi dell'art. 13 del Codice della privacy.
Cliccando su 'Accetto' i cookie saranno attivati Accetto