blib/lib/Net/PulseMeter/Sensor/HashedCounter.pm | |||
---|---|---|---|
Criterion | Covered | Total | % |
statement | 13 | 13 | 100.0 |
branch | n/a | ||
condition | n/a | ||
subroutine | 4 | 4 | 100.0 |
pod | 0 | 1 | 0.0 |
total | 17 | 18 | 94.4 |
line | stmt | bran | cond | sub | pod | time | code |
---|---|---|---|---|---|---|---|
1 | package Net::PulseMeter::Sensor::HashedCounter; | ||||||
2 | 1 | 1 | 588 | use strict; | |||
1 | 3 | ||||||
1 | 28 | ||||||
3 | 1 | 1 | 4 | use warnings 'all'; | |||
1 | 2 | ||||||
1 | 32 | ||||||
4 | |||||||
5 | 1 | 1 | 5 | use base qw/Net::PulseMeter::Sensor::Counter/; | |||
1 | 1 | ||||||
1 | 456 | ||||||
6 | |||||||
7 | sub event { | ||||||
8 | 1 | 1 | 0 | 2 | my ($self, $data) = @_; | ||
9 | 1 | 5 | for (keys %$data) { | ||||
10 | 2 | 612 | $self->r->hincrby($self->value_key, $_, $data->{$_}); | ||||
11 | 2 | 1155 | $self->r->hincrby($self->value_key, "total", $data->{$_}); | ||||
12 | } | ||||||
13 | } | ||||||
14 | |||||||
15 | 1; |