Re: Execution time of called method from custom shared variable classes

Daniel Dekany <[email protected]> Sat, 13 Jul 2013 10:10:12 +0200
Newsgroups gmane.comp.web.freemarker.user
Message-ID <[email protected]>
You could extend BeansWrapper and override invokeMethod and measure
super.invokeMethod. However, there are two problems with it:

- You will also measure the overhead of Method.invoke and the time
  needed for wrapping the return value into TemplateModel.

- It's not a public method, so you can only override it if your new class
  will be in freemarker.ext.beans package. This means that you will
  have no backward-compatibility guarantees.

-- 
Thanks,
 Daniel Dekany


Friday, July 12, 2013, 1:18:47 PM, Jan Haderka wrote:

> Hi,
>
> I need to find out execution time of some class called from the
> template. It's the class with bunch of static methods and I would
> ideally need to know cumulative time spent in all those calls (as
> opposed to rendering itself). The examples of usages would be from
>
> ${classX.callA(some param)} 
>
> to
>
> [#if classX.doTest() ]
>
> etc.
>
> The class above is made available via shared variables.
>
> I understand that I need to modify the code was wondering if anyone
> could suggest what would be the best class to extend to add such
> monitoring and to collect the time. 
> Is there a singe point through which all calls to shared variable methods go?
> Is TemplateMethodModel.exec() the right place where to measure such
> thing or do I need to extend more (or something else then model)
> depending on where the call happens?
>
> Thanks in advance,
> --
> Jan
>


------------------------------------------------------------------------------
See everything from the browser to the database with AppDynamics
Get end-to-end visibility with application monitoring from AppDynamics
Isolate bottlenecks and diagnose root cause in seconds.
Start your free trial of AppDynamics Pro today!
http://pubads.g.doubleclick.net/gampad/clk?id=48808831&iu=/4140/ostg.clktrk