Dashboard > WebWork > ... > Interceptors > Timer Interceptor
  WebWork Log In View a printable version of the current page.  
  Timer Interceptor
Added by Onyeje Bose, last edited by Onyeje Bose on Oct 18, 2005  (view change)
Labels: 
(None)

This interceptor logs the amount of time in milliseconds. In order for this interceptor to work properly, the logging framework must be set to at least the INFO level. This interceptor relies on the Commons Logging API to report its execution-time value.

Parameters

  • logLevel (optional) - what log level should we use (trace, debug, info, warn, error, fatal)? - defaut is info
  • logCategory (optional) - If provided we would use this category (eg. com.mycompany.app). Default is to use com.opensymphony.xwork.interceptor.TimerInterceptor.

The parameters above enables us to log all action execution times in our own logfile.

Extending the Interceptor

This interceptor can be extended to provide custom message format. Users should override the invokeUnderTiming method.

Examples

<!-- records only the action's execution time -->
<action name="someAction" class="com.examples.SomeAction">
    <interceptor-ref name="completeStack"/>
    <interceptor-ref name="timer"/>
    <result name="success">good_result.ftl</result>
</action>

<!-- records action's execution time as well as other interceptors-->
<action name="someAction" class="com.examples.SomeAction">
    <interceptor-ref name="timer"/>
    <interceptor-ref name="completeStack"/>
    <result name="success">good_result.ftl</result>
</action>

Site powered by a free Open Source Project / Non-profit License (more) of Confluence - the Enterprise wiki.
Learn more or evaluate Confluence for your organisation.
Powered by Atlassian Confluence, the Enterprise Wiki. (Version: 2.2.9 Build:#527 Sep 07, 2006) - Bug/feature request - Contact Administrators