← Index
NYTProf Performance Profile   « block view • line view • sub view »
For xt/tapper-mcp-scheduler-with-db-longrun.t
  Run on Tue May 22 17:18:39 2012
Reported on Tue May 22 17:23:41 2012

Filename/2home/ss5/perl5/perlbrew/perls/perl-5.12.3/lib/site_perl/5.12.3/Log/Log4perl/Config/BaseConfigurator.pm
StatementsExecuted 13 statements in 490µs
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
11116µs24µsLog::Log4perl::Config::BaseConfigurator::::BEGIN@3Log::Log4perl::Config::BaseConfigurator::BEGIN@3
1119µs67µsLog::Log4perl::Config::BaseConfigurator::::BEGIN@5Log::Log4perl::Config::BaseConfigurator::BEGIN@5
1117µs9µsLog::Log4perl::Config::BaseConfigurator::::BEGIN@4Log::Log4perl::Config::BaseConfigurator::BEGIN@4
0000s0sLog::Log4perl::Config::BaseConfigurator::::fileLog::Log4perl::Config::BaseConfigurator::file
0000s0sLog::Log4perl::Config::BaseConfigurator::::newLog::Log4perl::Config::BaseConfigurator::new
0000s0sLog::Log4perl::Config::BaseConfigurator::::parseLog::Log4perl::Config::BaseConfigurator::parse
0000s0sLog::Log4perl::Config::BaseConfigurator::::parse_post_processLog::Log4perl::Config::BaseConfigurator::parse_post_process
0000s0sLog::Log4perl::Config::BaseConfigurator::::textLog::Log4perl::Config::BaseConfigurator::text
Call graph for these subroutines as a Graphviz dot language file.
Line State
ments
Time
on line
Calls Time
in subs
Code
1package Log::Log4perl::Config::BaseConfigurator;
2
3318µs232µs
# spent 24µs (16+8) within Log::Log4perl::Config::BaseConfigurator::BEGIN@3 which was called: # once (16µs+8µs) by Log::Log4perl::Config::PropertyConfigurator::BEGIN@2 at line 3
use warnings;
# spent 24µs making 1 call to Log::Log4perl::Config::BaseConfigurator::BEGIN@3 # spent 8µs making 1 call to warnings::import
4318µs210µs
# spent 9µs (7+2) within Log::Log4perl::Config::BaseConfigurator::BEGIN@4 which was called: # once (7µs+2µs) by Log::Log4perl::Config::PropertyConfigurator::BEGIN@2 at line 4
use strict;
# spent 9µs making 1 call to Log::Log4perl::Config::BaseConfigurator::BEGIN@4 # spent 2µs making 1 call to strict::import
53441µs2124µs
# spent 67µs (9+58) within Log::Log4perl::Config::BaseConfigurator::BEGIN@5 which was called: # once (9µs+58µs) by Log::Log4perl::Config::PropertyConfigurator::BEGIN@2 at line 5
use constant _INTERNAL_DEBUG => 0;
# spent 67µs making 1 call to Log::Log4perl::Config::BaseConfigurator::BEGIN@5 # spent 58µs making 1 call to constant::import
6
714µs*eval_if_perl = \&Log::Log4perl::Config::eval_if_perl;
813µs*compile_if_perl = \&Log::Log4perl::Config::compile_if_perl;
912µs*leaf_path_to_hash = \&Log::Log4perl::Config::leaf_path_to_hash;
10
11################################################
12sub new {
13################################################
14 my($class, %options) = @_;
15
16 my $self = {
17 %options,
18 };
19
20 $self->file($self->{file}) if exists $self->{file};
21 $self->text($self->{text}) if exists $self->{text};
22
23 bless $self, $class;
24}
25
26################################################
27sub text {
28################################################
29 my($self, $text) = @_;
30
31 # $text is an array of scalars (lines)
32 if(defined $text) {
33 if(ref $text eq "ARRAY") {
34 $self->{text} = $text;
35 } else {
36 $self->{text} = [split "\n", $text];
37 }
38 }
39
40 return $self->{text};
41}
42
43################################################
44sub file {
45################################################
46 my($self, $filename) = @_;
47
48 open FILE, "<$filename" or die "Cannot open $filename ($!)";
49 $self->{text} = [<FILE>];
50 close FILE;
51}
52
53################################################
54sub parse {
55################################################
56 die __PACKAGE__ . "::parse() is a virtual method. " .
57 "It must be implemented " .
58 "in a derived class (currently: ", ref(shift), ")";
59}
60
61################################################
62sub parse_post_process {
63################################################
64 my($self, $data, $leaf_paths) = @_;
65
66 # [
67 # 'category',
68 # 'value',
69 # 'WARN, Logfile'
70 # ],
71 # [
72 # 'appender',
73 # 'Logfile',
74 # 'value',
75 # 'Log::Log4perl::Appender::File'
76 # ],
77 # [
78 # 'appender',
79 # 'Logfile',
80 # 'filename',
81 # 'value',
82 # 'test.log'
83 # ],
84 # [
85 # 'appender',
86 # 'Logfile',
87 # 'layout',
88 # 'value',
89 # 'Log::Log4perl::Layout::PatternLayout'
90 # ],
91 # [
92 # 'appender',
93 # 'Logfile',
94 # 'layout',
95 # 'ConversionPattern',
96 # 'value',
97 # '%d %F{1} %L> %m %n'
98 # ]
99
100 for my $path ( @{ Log::Log4perl::Config::leaf_paths( $data )} ) {
101
102 print "path=@$path\n" if _INTERNAL_DEBUG;
103
104 if(0) {
105 } elsif(
106 $path->[0] eq "appender" and
107 $path->[2] eq "trigger"
108 ) {
109 my $ref = leaf_path_to_hash( $path, $data );
110 my $code = compile_if_perl( $$ref );
111
112 if(_INTERNAL_DEBUG) {
113 if($code) {
114 print "Code compiled: $$ref\n";
115 } else {
116 print "Not compiled: $$ref\n";
117 }
118 }
119
120 $$ref = $code if defined $code;
121 } elsif (
122 $path->[0] eq "filter"
123 ) {
124 # do nothing
125 } elsif (
126 $path->[0] eq "appender" and
127 $path->[2] eq "warp_message"
128 ) {
129 # do nothing
130 } elsif (
131 $path->[0] eq "appender" and
132 $path->[3] eq "cspec" or
133 $path->[1] eq "cspec"
134 ) {
135 # could be either
136 # appender appndr layout cspec
137 # or
138 # PatternLayout cspec U value ...
139 #
140 # do nothing
141 } else {
142 my $ref = leaf_path_to_hash( $path, $data );
143
144 if(_INTERNAL_DEBUG) {
145 print "Calling eval_if_perl on $$ref\n";
146 }
147
148 $$ref = eval_if_perl( $$ref );
149 }
150 }
151
152 return $data;
153}
154
15514µs1;
156
157__END__