cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Capture only methods that are execute after other certain methods

miguel_balsa
Dynatrace Mentor
Dynatrace Mentor

Is it possible to capture the return value of methods that are executed ONLY after a certain method? The picture explains the situation perfectly. I'd like to capture the return value of getUX() only if it is executed after saveScreen().

4 REPLIES 4

adam_gardner
Dynatrace Champion
Dynatrace Champion

Not as far as I'm aware, but if the getUX() call you're interested in will always be the first one in the purepath when the saveScreen() method is also in the purepath:

1) Set up your getUX return value measure to only evaluate on the first occurrence in the purepath (look for the "Only analyze first method occurrence per PurePath" checkbox).

2) Create a measure method invocation measure which tracks the saveScreen() method call.

3) Create a BT with two filters: The saveScreen method invocation AND the return value capture of the getUX method.

This BT will only produce data for purepaths containing saveScreen and getUX and it will only pull the return value for the first getUX call in the purepath.

Does that help??

miguel_balsa
Dynatrace Mentor
Dynatrace Mentor

Hi Adam! That's what I though also at first, but it is not useful in this situation. The solution is great, but the scenario is too unpredictable. Sometimes is not the first, and sometimes saveScreen() is not even in the PurePath.

The main problem is that the application design is not optimal in this case.

adam_gardner
Dynatrace Champion
Dynatrace Champion
and sometimes saveScreen() is not even in the PurePath.

So in that scenario you don't want to capture it?

Mike_L
Dynatrace Pro
Dynatrace Pro

Hi Miguel,

There is no way of doing this out of the box if it isn't the first or last method call each time. You could do it with a custom plugin if you really need it. Just poll the purepath details and go from there. It would take a few hours to create and test though and depending on the number of purepaths and their size it might be a burden on the server.

Mike