blib/lib/Net/PulseMeter/Sensor/Timelined/Max.pm | |||
---|---|---|---|
Criterion | Covered | Total | % |
statement | 15 | 15 | 100.0 |
branch | n/a | ||
condition | n/a | ||
subroutine | 5 | 5 | 100.0 |
pod | 0 | 1 | 0.0 |
total | 20 | 21 | 95.2 |
line | stmt | bran | cond | sub | pod | time | code |
---|---|---|---|---|---|---|---|
1 | package Net::PulseMeter::Sensor::Timelined::Max; | ||||||
2 | 1 | 1 | 581 | use strict; | |||
1 | 2 | ||||||
1 | 29 | ||||||
3 | 1 | 1 | 4 | use warnings 'all'; | |||
1 | 2 | ||||||
1 | 33 | ||||||
4 | 1 | 1 | 614 | use Data::Uniqid qw/uniqid/; | |||
1 | 46060 | ||||||
1 | 69 | ||||||
5 | |||||||
6 | 1 | 1 | 10 | use base qw/Net::PulseMeter::Sensor::Timeline/; | |||
1 | 11 | ||||||
1 | 563 | ||||||
7 | |||||||
8 | sub aggregate_event { | ||||||
9 | 3 | 3 | 0 | 4 | my ($self, $key, $value) = @_; | ||
10 | 3 | 15 | $self->r->zadd( | ||||
11 | $key, | ||||||
12 | $value, | ||||||
13 | sprintf("%s::%s", $value, uniqid()) | ||||||
14 | ); | ||||||
15 | 3 | 17264 | $self->r->zremrangebyrank($key, 0, -2); | ||||
16 | } | ||||||
17 | |||||||
18 | 1; |