blib/lib/Net/PulseMeter/Sensor/Timelined/Min.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::Min; | ||||||
2 | 1 | 1 | 766 | use strict; | |||
1 | 2 | ||||||
1 | 38 | ||||||
3 | 1 | 1 | 5 | use warnings 'all'; | |||
1 | 1 | ||||||
1 | 43 | ||||||
4 | 1 | 1 | 866 | use Data::Uniqid qw/uniqid/; | |||
1 | 55790 | ||||||
1 | 83 | ||||||
5 | |||||||
6 | 1 | 1 | 8 | use base qw/Net::PulseMeter::Sensor::Timeline/; | |||
1 | 12 | ||||||
1 | 644 | ||||||
7 | |||||||
8 | sub aggregate_event { | ||||||
9 | 3 | 3 | 0 | 5 | my ($self, $key, $value) = @_; | ||
10 | 3 | 7 | $self->r->zadd( | ||||
11 | $key, | ||||||
12 | $value, | ||||||
13 | sprintf("%s::%s", $value, uniqid()) | ||||||
14 | ); | ||||||
15 | 3 | 18502 | $self->r->zremrangebyrank($key, 1, -1); | ||||
16 | } | ||||||
17 | |||||||
18 | 1; |