Author image ☺唐鳳☻
and 1 contributors


MasonX::Profiler - Mason per-component profiler


This document describes version 0.06 of MasonX::Profiler, released June 22, 2004.


In the Mason handler:

    use MasonX::Profiler;
    my $ah = HTML::Mason::ApacheHandler->new(
        preamble => 'my $p = MasonX::Profiler->new($m, $r);',
        # ...

Note that CGIHandler and Apache2Handler works, too.

Alternatively, in httpd.conf, before loading your PerlHandler:

    PerlModule MasonX::Profiler
    PerlSetVar MasonPreamble "my $p = MasonX::Profiler->new($m, $r);"

Note that if you are using virtual hosts, the two lines above must be inside the <VirtualHost> block, not outside it.


This module prints per-component profiling information to STDERR (usually directed to the Apache error log). Its output looks like this:

    =Mason= - /NoAuth/webrt.css BEGINS {{{
    =Mason= -     /NoAuth/webrt.css {{{
    =Mason= -         /Elements/Callback {{{
    =Mason= -         /Elements/Callback }}} 0.0008
    =Mason= -     /NoAuth/webrt.css }}} 0.0072
    =Mason= - /NoAuth/webrt.css }}} ENDS

Each row contains five whitespace-separated fields: =Mason=, remote IP address, -, indented component name, and how many seconds did it take to process that component, including all subcomponents called by it.

The beginning and end of the initial request is represented by the special time fields BEGINS and ENDS.


Autrijus Tang <>


Copyright 2002, 2003, 2004 by Autrijus Tang <>.

This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.