The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

XAO::DO::Web::Benchmark - benchmarking helper

SYNOPSIS

  <%Benchmark mode='enter' tag='main'%>
  ....
  <%Benchmark mode='leave' tag='main'%>
  ...
  <%Benchmark mode='stats' tag='main'
    dprint
    template={'Count: <$COUNT$> Total: <$TOTAL$> Avg: <$AVERAGE$>'}
  %>
  ...
  <%Benchmark mode='stats'
    header.template='<ul>'
    template=       '<li>Tag: <$TAG/h$> Avg: <$AVERAGE$> Med: <$MEDIAN$></li>'
    footer.template='</ul>'
  %>

DESCRIPTION

Remembers timing at the given points during template processing and reports on them later. The tag is required for 'enter' and 'leave' modes.

System-wide benchmarking can also be controlled with 'system-start' and 'system-stop' modes. With that all sub-templates are individually benchmarked. The tags are automatically build based on their 'path' or 'template' arguments.

Results can be retrieved using 'stats' mode. With a 'dprint' parameter it will dump results using the dprint() call to be seen in the server log typically. Given a template or a path the results can be included in the rendered page.

EXPORTS

Nothing.

AUTHOR

Copyright (c) 2013 Andrew Maltsev

<am@ejelta.com> -- http://ejelta.com/xao/

SEE ALSO

Recommended reading: XAO::Web, XAO::DO::Web::Page.