Profiling Wickets

Are there any good tools or methods for profiling Wicket applications? What I'm looking for is what will give me a breakdown of what is going on inside Wicket, processing the request.

It doesn't have to be as fantastic as understanding Spring.

I'm new to Wicket, and all the anonymous inner classes that are spreading all over the place are very hard to see when something happens.

+3
source share
4 answers

At least for Wicket 1.4, you can take a look at the internal method org.apache.wicket.RequestCycle.steps(). Basically, this is the place where a request that has been identified as a request to the Wicket application goes through the corresponding steps in the Wicket request processing cycle. At the beginning of the class, the RequestCyclemain steps are represented by each int constant. The higher the int value, the later the step enters the loop. The method RequestCycle.step()that is called from RequestCycle.steps()has a switch statement to delegate the various steps to the responsible infrastructure methods, which are delegated further.

The steps or phases, if you wish, are in order in the request loop:

  • NOT_STARTED - initial value
  • PREPARE_REQUEST - preparation for further processing, calls onBeginRequest
  • RESOLVE_TARGET - Define the appropriate request target
  • PROCESS_EVENTS - , RESPOND
  • RESPOND - ,
  • DETACH_REQUEST -
  • DONE - DETACH_REQUEST

, , , IRequestCycleProcessor IRequestTarget.

+6

.

org.apache.wicket.response.filter.ServerAndClientTimeFilter org.apache.wicket.response.filter.AjaxServerAndClientTimeFilter org.apache.wicket.devutils.inspector.RenderPerformanceListener org.apache.wicket.protocol.http.RequestLogger

, . . , Yourkit (http://www.yourkit.com), .

+6

You can create profiles using jvisualvm, like any other Java application. With the right set of class filters, you can see how long your code takes and hopefully fix it.

+1
source

I found that it wicket-devutilscomes with a panel called DebugBarthat provides access to a lot of debugging information.

This can be seen here: http://wicket.apache.org/apidocs/1.4/org/apache/wicket/devutils/debugbar/DebugBar.html

+1
source

All Articles