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

how can i create a plugin to measure interval execution of methods


i would like to create a bt that measures the interval between two executions, so whenever i see a getconnection i get elapsed time and whenever i see close i get elapsed time and i would like to substract them and give a measure.

but i dont know any example of creating this, perhaps it is not possible, it is? it would be nice to have such plugin

thank you



Hi Oscar, I can't think of a way that it would be possible to track this as a measure.

Directly as a BT result: at the method level all of our measures are based on the amount of time spent in a method (or the different breakdowns thereof) not when the method occured in the PurePath.

Using a plugin, however this may be possible as you can export node level details in XML using the RESTful Interface, using the parameter ?purePathDetails=ALL

So here you could create a plugin to read through each PurePath in XML and capture each of your method nodes. Each node then has the "relativeStart" parameter which indicates how much time since the beginning of the PurePath has elapsed, so subtracting one relative Start from the other would give you your answer!

You could then write this back as a measure to give the average time between method executions for a period.

Best regards,


is ok ... but how to do that always in background? i should be asking always for purepaths url and if there are new process them?

i think it would be nice to do that as a bt manner ... but if they dont store the relativestart ... it would be difficult. to do that as a business transaction would be helpfully 😞

how would you do this? (always store the measure for every purepath)

Hi Oscar,

So unfortunately I don't believe that this is possible in the context of a business transactions as no measures in AppMon (that I know of) return the relative start time of a particular node.

To do this as a plugin, you would write a monitor plugin and then execute it on a schedule (e.g. every minute). It would not be possible to store the measure for every PurePath, but by running it as a monitor you could have the average, max and min values of the time between method executions each time the monitor executes, e.g. (the average max and min every minute in this example).

Best regards,


i am thinking in cronning a job every "minute"?? "5 minutes"? that gets that data and puts as measures with each time resolution would be possible? the data pushed what would be the average calculated by plugin or path by path? if it is not a drill down would be difficult ... to use this

Yes, the average calculated would be per interval, so you would get one measure each time the monitor runs, e.g. each 5 mins, not 1 meaure per PurePath.