Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>I think perhaps the question should be <em>why</em> you need to do this. Perhaps if you explained your use/business case, we can provide a cleaner (and easier) solution.</p> <p>From your very last lines, you are talking about wanting to profile the method. Generally speaking, it is rare to want to profile just one small tiny method in the middle of chain of processing. That being said, I can imagine some convoluted cases where this might occur. However, even at that, it should be a handful of cases that you would be able to code yourself.</p> <p>If it is a question of actual profiling, but you are not sure how to do it, and consequently feel that the only way is to call each method individually so you can "wrap" it with a start/stop timer, I would strongly recommend looking into <a href="http://en.wikipedia.org/wiki/Aspect-oriented_programming" rel="nofollow">AOP</a>. Both <a href="http://static.springsource.org/spring/docs/3.0.x/spring-framework-reference/html/aop.html" rel="nofollow">Spring</a> and <a href="http://www.eclipse.org/aspectj/" rel="nofollow">AspectJ</a> are great for AOP, with AspectJ able to do byte-weaving that Spring is unable to accomplish.</p> <p>Consequently, with AspectJ you would be able to create your own profiling timer classes and weave them into the byte-code at compile time and then run your standard tests, but visualize all the profiling info that you want/need on a per-method basis.</p> <p>And best of all, it would avoid you needing to come up with some convoluted scheme for producing random test data that isn't really relevant to the method being tested.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload