Skip to content

Model based instrumentation #58

@miho

Description

@miho

Instead of a Groovy based transform we need a model based instrumentation in the future to ensure that instrumentation also works for other (potential) language bindings. Instead of a special utility method the idea is to directly insert pre/post events into the source.

Example 1:

int a;
a=2;

will be transformed to something like:

preEvent("declare a");
int a;
postEvent("declare a");
preEvent("assign a");
a=2;
postEvent("assign a");

For chained invocations and operators we need to introduce additional tmp-variables:

Example 2:

if(a < b) {
  //
}

will be transformed to something like:

preEvent("LESS Operator");
boolean __vrl__tmpVar_1 = a < b;
postEvent("LESS Operator");
preEvent("if");
if(__vrl__tmpVar_1) {
  //
}
postEvent("if");

We will also need to introduce a mapping between events and visual nodes to use the instrumentation from the ui.

Loops:

Loops need special treatment:

while(a<b){
  //
}

will be transformed to:

boolean __vrl_tmpVar_1 = true;
while(true) {
  preEvent("LESS Operator");
  __vrl_tmpVar_1 = a < b;
  postEvent("LESS Operator");
  if(!__vrl_tmpVar_1) break;
  //
}

For complex condition arguments we need to extract the whole invocation chain and move it into the while loop.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions