| line | stmt | bran | cond | sub | pod | time | code | 
| 1 |  |  |  |  |  |  | package App::RecordStream::Clumper; | 
| 2 |  |  |  |  |  |  |  | 
| 3 | 69 |  |  | 69 |  | 416 | use strict; | 
|  | 69 |  |  |  |  | 121 |  | 
|  | 69 |  |  |  |  | 1727 |  | 
| 4 | 69 |  |  | 69 |  | 293 | use warnings; | 
|  | 69 |  |  |  |  | 119 |  | 
|  | 69 |  |  |  |  | 1783 |  | 
| 5 |  |  |  |  |  |  |  | 
| 6 | 69 |  |  | 69 |  | 15629 | use App::RecordStream::BaseRegistry; | 
|  | 69 |  |  |  |  | 150 |  | 
|  | 69 |  |  |  |  | 1752 |  | 
| 7 |  |  |  |  |  |  |  | 
| 8 | 69 |  |  | 69 |  | 384 | use base ('App::RecordStream::BaseRegistry'); | 
|  | 69 |  |  |  |  | 147 |  | 
|  | 69 |  |  |  |  | 13551 |  | 
| 9 |  |  |  |  |  |  |  | 
| 10 |  |  |  |  |  |  | sub make_clumper | 
| 11 |  |  |  |  |  |  | { | 
| 12 | 9 |  |  | 9 | 0 | 28 | my $registry_class = shift; | 
| 13 | 9 |  |  |  |  | 22 | my $spec = shift; | 
| 14 |  |  |  |  |  |  |  | 
| 15 | 9 |  |  |  |  | 49 | return $registry_class->parse_single_nameless_implementation($spec); | 
| 16 |  |  |  |  |  |  | } | 
| 17 |  |  |  |  |  |  |  | 
| 18 |  |  |  |  |  |  | sub typename | 
| 19 |  |  |  |  |  |  | { | 
| 20 | 21 |  |  | 21 | 0 | 65 | 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; |