Child pages
  • Profiling

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migrated to Confluence 5.3

...

Filtering profile information

Wiki Markup
{snippet:id=filteringDescription|javadoc=true|url=com.opensymphony.xwork2.util.profiling.UtilTimerStack}

...

One could filter out the profile logging by having a System property as follows:

Code Block

-Dxwork.profile.mintime=10000 

With this xwork.profile.mintime property, one could only log profile information when its execution time exceed those specified in xwork.profile.mintime system property. If no such property is specified, it will be assumed to be 0, hence all profile information will be logged.

Write profiling code

One could extend the profiling feature provided by Struts2 in their web application as well.

...

Profiled result is logged using commons-logging under the logger named 'com.opensymphony.xwork2.util.profiling.UtilTimerStack'. Depending on the underlying logging implementation, say if it is Log4j, one could direct the log to appear in a different file, being emailed to someone or have it stored in the db.

...