File Coverage

blib/lib/App/RecordStream/Clumper.pm
Criterion Covered Total %
statement 16 20 80.0
branch n/a
condition n/a
subroutine 6 7 85.7
pod 0 3 0.0
total 22 30 73.3


line stmt bran cond sub pod time code
1             package App::RecordStream::Clumper;
2              
3 69     69   430 use strict;
  69         178  
  69         1984  
4 69     69   366 use warnings;
  69         148  
  69         2064  
5              
6 69     69   16102 use App::RecordStream::BaseRegistry;
  69         218  
  69         2137  
7              
8 69     69   502 use base ('App::RecordStream::BaseRegistry');
  69         147  
  69         12134  
9              
10             sub make_clumper
11             {
12 9     9 0 21 my $registry_class = shift;
13 9         16 my $spec = shift;
14              
15 9         71 return $registry_class->parse_single_nameless_implementation($spec);
16             }
17              
18             sub typename
19             {
20 21     21 0 72 return "clumper";
21             }
22              
23             sub usage {
24 0     0 0   my $ret = "";
25 0           $ret .= <
26             CLUMPING:
27             __FORMAT_TEXT__
28             "Clumping" defines a way of taking a stream of input records and rearranging
29             them into to groups for consideration. The most common "consideration" for
30             such a group of records is the application of one or more aggregators by
31             recs-collate and the most common clumpers are those specifiable by
32             recs-collate's normal options. However, other recs scripts can use
33             "clumpers" and much more complex clumping is possible. A list of clumpers
34             can be found via the --list-clumpers option on recs-collate and
35             documentation for individual clumpers can be inspected via --show-clumper.
36             __FORMAT_TEXT__
37              
38             Examples:
39             Group adjacent records for each host and output each such group's size.
40             recs-collate -c keylru,host,1 -a ct
41             Output the successive differences of the time field.
42             recs-collate -c window,2 --dla 'time_delta=xform(recs, <<{{#1/time}} - {{#0/time}}>>)'
43              
44             Full list:
45             USAGE
46 0           $ret .= __PACKAGE__->list_implementations(" ");
47 0           return $ret;
48             }
49              
50             1;