Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

What is sensor assignment

...

  • Timer sensor
  • HTTP sensor
  • Exception sensor
  • JDBC Connection sensor
  • JDBC Statement sensor
  • JDBC Prepared Statement sensor
  • JDBC Prepared Parameter sensor
  • Logging sensor for log4j
  • Image ModifiedInvocation sequence sensor (although this senor type exists it can not assigned directly, please check the Advanced sensor options below for more information) 

...

The user would expect that the inspectIT Agent record constructors calling other constructors it like in methods: That is if constructor A executes constructor B, then the invocation tracer for example will visualize it that way. That is NOT true for constructors. The problem here is that the this or super calls must remain ALWAYS as the first call. This is a limitation of the JVM which cannot be avoided.

Real call tree
Method A (Class X)
-->Constructor A (Class Y)
----->Constructor B (Class Z)
-------->Constructor C (Class Z)
Shown in inspectIT
Method A (Class X)
-->Constructor C (Class Y)
-->Constructor B (Class Z)
-->Constructor A (Class Z)

The user thinks that Method A creates 2 new instances of Class Z and 1 new instance of Y, first calling constructor C, then B and last A. The worst part here is now that the Timer records the time for each constructor whereas each of them is correct, but in the context of an invocation tracer, the exclusive time could not be calculated correctly anymore. Because Constructor A is the only time that should be subtracted from method A, but instead, CB and A are subtracted.

...

Sensor specific options

Examples

...

This chapter provides examples of how instrumentation can be done.

Instrumentation Configuration

Description

Image Added

A sensor of the type Image AddedTimer sensor is defined on the method msg with the parameter java.lang.String of the class novatec.SubTest.

Image Added

Image AddedTimer sensor is added to the method msg with the parameter type int for all classes that match the class expression novatec.Sub* which will hold true for novatec.Sub andnovatec.Sub2 but also for novatec.Sub.some.other.package.SomeClass.

Image Added

Image AddedTimer sensor is added to the method msg with a parameter type matching the expression *String of the class novatec.SubTest. So the method msg(java.lang.String) and the method msg(my.own.String) and msg(my.own.SuperString) will be instrumented.

Image Added

This example shows different usages of wild-card.

Image Added

This example shows how to instrument classes based on their status that they implement some interface. So this test will instrument all methods of all classes that implement the interface novatec.ITest.

Image Added

A sensor is defined on methods that start with the character m and have exactly one parameter whose type match the expression *String of all classes that extend a class matching the classpattern nova*.Te*. (quite powerful isn't it :))

Image Added

A Image AddedTimer sensor that starts invocation is defined on novatec.SubTest class on msg(int) method. The interesting part here is the minduration definition, which is specified so that all invocations taking less than 10 ms will be discarded.

Image Added

Instruments all public methods which name starts with 'do' in classes that implement the novatec.ITest interface

Image Added

Instruments all public methods in classes that have been annotated with novatec.annotation.ClassAnnotation and are in package novatec.*

Image Added

This sensor instruments all constructors of the class novatec.SubTest

Image Added

A specific constructor is instrumented here: The method signature has to contain one single parameter of type java.lang.String.

Image Added

Instruments all constructors in novatec.SubTest class that have been annotated with novatec.annotation.DefaultConstructor