Sunday, November 29, 2009

Monitor Wicket page request using JAMon

clipped from blog.xebia.com
Monitor Wicket page request using JAMon

When monitoring these page requests I want to know which page was actually requested. I initially looked at the WicketFilter class as that is the entry point of your Wicket application. However I could not find a way to determine which page was actually requested there. So after a bit of investigation and confirmation from the wicket-user-group (very excellent and active user-group btw) it turned out the that the WebRequestCycle is the class we need to monitor. Wicket provides hooks which you need to override in your custom WebRequestCycle, namely onBeginRequest and onEndRequest. There is one tricky thing though: in the onBeginRequest the name of the requested Page is not yet available, so we need to store the start time of the request instead of the Monitor. In the onEndRequest we can determine which page is requested and can add the measured time to JAMon.

 blog it

Wicket in ActionPro Wicket (Expert's Voice in Java)

1 comments:

jcompagner said...

why not use/hook into the RequestLogger?