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.25";
4              
5 6     6   64910 use strict;
  6         20  
  6         137  
6 6     6   26 use warnings;
  6         11  
  6         126  
7              
8 6     6   373 use App::RecordStream::Aggregator::MapReduce;
  6         9  
  6         130  
9 6     6   356 use App::RecordStream::Aggregator;
  6         13  
  6         149  
10 6     6   391 use App::RecordStream::DomainLanguage::Registry;
  6         26  
  6         185  
11              
12 6     6   40 use base 'App::RecordStream::Aggregator::MapReduce';
  6         11  
  6         1292  
13              
14             sub map
15             {
16 199     199 0 332 return 1;
17             }
18              
19             sub reduce
20             {
21 124     124 0 209 my ($this, $cookie, $cookie2) = @_;
22              
23 124         274 return $cookie + $cookie2;
24             }
25              
26             sub argct
27             {
28 16     16 0 45 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;