line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package App::RecordStream::Aggregator; |
2
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
our $VERSION = "4.0.25"; |
4
|
|
|
|
|
|
|
|
5
|
27
|
|
|
27
|
|
141070
|
use strict; |
|
27
|
|
|
|
|
56
|
|
|
27
|
|
|
|
|
654
|
|
6
|
27
|
|
|
27
|
|
117
|
use warnings; |
|
27
|
|
|
|
|
51
|
|
|
27
|
|
|
|
|
692
|
|
7
|
|
|
|
|
|
|
|
8
|
27
|
|
|
27
|
|
5453
|
use App::RecordStream::BaseRegistry; |
|
27
|
|
|
|
|
55
|
|
|
27
|
|
|
|
|
608
|
|
9
|
27
|
|
|
27
|
|
154
|
use App::RecordStream::Site; |
|
27
|
|
|
|
|
52
|
|
|
27
|
|
|
|
|
548
|
|
10
|
|
|
|
|
|
|
|
11
|
27
|
|
|
27
|
|
130
|
use base ('App::RecordStream::BaseRegistry'); |
|
27
|
|
|
|
|
76
|
|
|
27
|
|
|
|
|
12226
|
|
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
sub make_aggregators |
14
|
|
|
|
|
|
|
{ |
15
|
18
|
|
|
18
|
0
|
42251
|
my $registry_class = shift; |
16
|
|
|
|
|
|
|
|
17
|
18
|
|
|
|
|
45
|
my %ret; |
18
|
|
|
|
|
|
|
|
19
|
18
|
|
|
|
|
59
|
for my $input (@_) |
20
|
|
|
|
|
|
|
{ |
21
|
22
|
|
|
|
|
59
|
my $spec = $input; |
22
|
22
|
|
|
|
|
33
|
my $name; |
23
|
|
|
|
|
|
|
|
24
|
22
|
100
|
|
|
|
97
|
if($spec =~ /^(.*)=(.*)$/) |
25
|
|
|
|
|
|
|
{ |
26
|
3
|
|
|
|
|
8
|
$name = $1; |
27
|
3
|
|
|
|
|
8
|
$spec = $2; |
28
|
|
|
|
|
|
|
} |
29
|
|
|
|
|
|
|
|
30
|
22
|
100
|
|
|
|
74
|
if(!defined($name)) |
31
|
|
|
|
|
|
|
{ |
32
|
19
|
|
|
|
|
69
|
my @spec = split(/,/, $spec); |
33
|
19
|
|
|
|
|
67
|
$name = join("_", map { my $n = $_; $n =~ s!/!_!; $n } @spec); |
|
23
|
|
|
|
|
53
|
|
|
23
|
|
|
|
|
71
|
|
|
23
|
|
|
|
|
89
|
|
34
|
|
|
|
|
|
|
} |
35
|
|
|
|
|
|
|
|
36
|
22
|
|
|
|
|
123
|
$ret{$name} = $registry_class->parse_single_nameless_implementation($spec); |
37
|
|
|
|
|
|
|
} |
38
|
|
|
|
|
|
|
|
39
|
18
|
|
|
|
|
62
|
return \%ret; |
40
|
|
|
|
|
|
|
} |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
sub map_initial |
43
|
|
|
|
|
|
|
{ |
44
|
71
|
|
|
71
|
0
|
134
|
my ($aggrs) = @_; |
45
|
|
|
|
|
|
|
|
46
|
71
|
|
|
|
|
96
|
my %ret; |
47
|
71
|
|
|
|
|
155
|
for my $name (keys(%$aggrs)) |
48
|
|
|
|
|
|
|
{ |
49
|
87
|
|
|
|
|
271
|
$ret{$name} = $aggrs->{$name}->initial(); |
50
|
|
|
|
|
|
|
} |
51
|
|
|
|
|
|
|
|
52
|
71
|
|
|
|
|
275
|
return \%ret; |
53
|
|
|
|
|
|
|
} |
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
sub map_combine |
56
|
|
|
|
|
|
|
{ |
57
|
149
|
|
|
149
|
0
|
260
|
my ($aggrs, $cookies, $record) = @_; |
58
|
|
|
|
|
|
|
|
59
|
149
|
|
|
|
|
180
|
my %ret; |
60
|
149
|
|
|
|
|
280
|
for my $name (keys(%$aggrs)) |
61
|
|
|
|
|
|
|
{ |
62
|
197
|
|
|
|
|
503
|
$ret{$name} = $aggrs->{$name}->combine($cookies->{$name}, $record); |
63
|
|
|
|
|
|
|
} |
64
|
|
|
|
|
|
|
|
65
|
149
|
|
|
|
|
426
|
return \%ret; |
66
|
|
|
|
|
|
|
} |
67
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
sub map_squish |
69
|
|
|
|
|
|
|
{ |
70
|
74
|
|
|
74
|
0
|
142
|
my ($aggrs, $cookies) = @_; |
71
|
|
|
|
|
|
|
|
72
|
74
|
|
|
|
|
201
|
my $return_record = App::RecordStream::Record->new(); |
73
|
74
|
|
|
|
|
142
|
for my $name (keys(%$aggrs)) |
74
|
|
|
|
|
|
|
{ |
75
|
90
|
|
|
|
|
134
|
my $aggregator = $aggrs->{$name}; |
76
|
90
|
|
|
|
|
263
|
my $value = $aggregator->squish($cookies->{$name}); |
77
|
90
|
|
|
|
|
128
|
${$return_record->guess_key_from_spec($name)} = $value; |
|
90
|
|
|
|
|
179
|
|
78
|
|
|
|
|
|
|
} |
79
|
|
|
|
|
|
|
|
80
|
74
|
|
|
|
|
323
|
return $return_record; |
81
|
|
|
|
|
|
|
} |
82
|
|
|
|
|
|
|
|
83
|
|
|
|
|
|
|
sub typename |
84
|
|
|
|
|
|
|
{ |
85
|
19
|
|
|
19
|
0
|
50
|
return "aggregator"; |
86
|
|
|
|
|
|
|
} |
87
|
|
|
|
|
|
|
|
88
|
|
|
|
|
|
|
1; |