| 1 | package Plack::Middleware::Profiler::KYTProf::Profile::TemplateEngine; | ||
| 2 | 2 | ▶ | use strict; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 3 | 2 | ▶ | use warnings; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 4 | |||
| 5 | 1 | ▶ | sub load { |
|
Subroutine
load: called CC=1 SCAR=0.0
Pod
undocumented
| |||
| 6 | 1 | my $class = shift; | |
| 7 | 1 | $class->_add_template_engine_profs; | |
| 8 | } | ||
| 9 | |||
| 10 | 1 | ▶ | sub _add_template_engine_profs { |
|
Subroutine
_add_template_engine_profs: called CC=1 SCAR=0.0
| |||
| 11 | 1 | my $class = shift; | |
| 12 | 1 | $class->_add_xslate_prof; | |
| 13 | 1 | $class->_add_tt2_prof; | |
| 14 | 1 | $class->_add_template_pro_prof; | |
| 15 | 1 | $class->_add_mojo_template_prof; | |
| 16 | } | ||
| 17 | |||
| 18 | 1 | ▶ | sub _add_xslate_prof { |
|
Subroutine
_add_xslate_prof: called CC=1 SCAR=1.2
| |||
| 19 | 1 | my $class = shift; | |
| 20 | |||
| 21 | Devel::KYTProf->add_prof( | ||
| 22 | "Text::Xslate", | ||
| 23 | "render", | ||
| 24 | 0 | ▶ | sub { |
|
Subroutine
__ANON__: not called CC=1 SCAR=6.9
| |||
| 25 | 0 | my ( $orig, $self, $file, $args ) = @_; | |
| 26 | return [ | ||
| 27 | 0 | '%s %s', | |
| 28 | ["render_method", "file"], | ||
| 29 | { | ||
| 30 | "render_method" => "render", | ||
| 31 | "file" => $file | ||
| 32 | }, | ||
| 33 | ]; | ||
| 34 | } | ||
| 35 | 1 | ); | |
| 36 | } | ||
| 37 | |||
| 38 | 1 | ▶ | sub _add_tt2_prof { |
|
Subroutine
_add_tt2_prof: called CC=1 SCAR=1.2
| |||
| 39 | 1 | my $class = shift; | |
| 40 | Devel::KYTProf->add_prof( | ||
| 41 | "Template", | ||
| 42 | "process", | ||
| 43 | 0 | ▶ | sub { |
|
Subroutine
__ANON__: not called CC=1 SCAR=6.9
| |||
| 44 | 0 | my ( $orig, $class, $file, $args ) = @_; | |
| 45 | return [ | ||
| 46 | 0 | '%s %s', | |
| 47 | ["render_method", "file"], | ||
| 48 | { | ||
| 49 | "render_method" => "process", | ||
| 50 | "file" => $file | ||
| 51 | }, | ||
| 52 | ]; | ||
| 53 | } | ||
| 54 | 1 | ); | |
| 55 | } | ||
| 56 | |||
| 57 | 1 | ▶ | sub _add_mojo_template_prof { |
|
Subroutine
_add_mojo_template_prof: called CC=1 SCAR=2.6
| |||
| 58 | Devel::KYTProf->add_prof( | ||
| 59 | "Mojo::Template", | ||
| 60 | "render_file", | ||
| 61 | 0 | ▶ | sub { |
|
Subroutine
__ANON__: not called CC=1 SCAR=6.9
| |||
| 62 | 0 | my ( $orig, $class, $file, $args ) = @_; | |
| 63 | return [ | ||
| 64 | 0 | '%s %s', | |
| 65 | ["render_method", "file"], | ||
| 66 | { | ||
| 67 | "render_method" => "render_file", | ||
| 68 | "file" => $file | ||
| 69 | }, | ||
| 70 | ]; | ||
| 71 | |||
| 72 | } | ||
| 73 | 1 | ); | |
| 74 | |||
| 75 | Devel::KYTProf->add_prof( | ||
| 76 | "Mojo::Template", | ||
| 77 | "render", | ||
| 78 | 0 | ▶ | sub { |
|
Subroutine
__ANON__: not called CC=1 SCAR=6.9
| |||
| 79 | 0 | my ( $orig, $class, $args ) = @_; | |
| 80 | |||
| 81 | return [ | ||
| 82 | 0 | '%s', | |
| 83 | ["render_method"], | ||
| 84 | { | ||
| 85 | "render_method" => "render", | ||
| 86 | }, | ||
| 87 | ]; | ||
| 88 | } | ||
| 89 | 1 | ); | |
| 90 | |||
| 91 | } | ||
| 92 | |||
| 93 | 1 | ▶ | sub _add_template_pro_prof { |
|
Subroutine
_add_template_pro_prof: called CC=1 SCAR=2.0
| |||
| 94 | 1 | my $class = shift; | |
| 95 | Devel::KYTProf->add_prof( | ||
| 96 | "HTML::Template::Pro", | ||
| 97 | "output", | ||
| 98 | 0 | ▶ | sub { |
|
Subroutine
__ANON__: not called CC=1 SCAR=6.9
| |||
| 99 | 0 | my ( $orig, $class, $args ) = @_; | |
| 100 | 0 | return sprintf '%s', "output"; | |
| 101 | |||
| 102 | return [ | ||
| 103 | 0 | '%s', | |
| 104 | ["render_method"], | ||
| 105 | { | ||
| 106 | "render_method" => "output", | ||
| 107 | }, | ||
| 108 | ] | ||
| 109 | } | ||
| 110 | 1 | ); | |
| 111 | } | ||
| 112 | |||
| 113 | 2 | 1; | |