File Coverage

blib/lib/App/RecordStream/Aggregator/Count.pm
Criterion Covered Total %
statement 22 24 91.6
branch n/a
condition n/a
subroutine 9 11 81.8
pod 0 5 0.0
total 31 40 77.5


line stmt bran cond sub pod time code
1             package App::RecordStream::Aggregator::Count;
2              
3             our $VERSION = "4.0.24";
4              
5 6     6   85873 use strict;
  6         12  
  6         143  
6 6     6   27 use warnings;
  6         11  
  6         128  
7              
8 6     6   291 use App::RecordStream::Aggregator::MapReduce;
  6         11  
  6         110  
9 6     6   273 use App::RecordStream::Aggregator;
  6         12  
  6         135  
10 6     6   346 use App::RecordStream::DomainLanguage::Registry;
  6         12  
  6         144  
11              
12 6     6   31 use base 'App::RecordStream::Aggregator::MapReduce';
  6         12  
  6         1093  
13              
14             sub map
15             {
16 199     199 0 413 return 1;
17             }
18              
19             sub reduce
20             {
21 124     124 0 233 my ($this, $cookie, $cookie2) = @_;
22              
23 124         366 return $cookie + $cookie2;
24             }
25              
26             sub argct
27             {
28 16     16 0 44 return 0;
29             }
30              
31             sub long_usage
32             {
33 0     0 0   return <
34             Usage: count
35             Counts number of (non-unique) records.
36             EOF
37             }
38              
39             sub short_usage
40             {
41 0     0 0   return "counts (non-unique) records";
42             }
43              
44             App::RecordStream::Aggregator->register_implementation('count', __PACKAGE__);
45             App::RecordStream::Aggregator->register_implementation('ct', __PACKAGE__);
46              
47             App::RecordStream::DomainLanguage::Registry::register_ctor(__PACKAGE__, 'count');
48             App::RecordStream::DomainLanguage::Registry::register_ctor(__PACKAGE__, 'ct');
49              
50             1;