File Coverage

blib/lib/App/RedisTop/Component/Save.pm
Criterion Covered Total %
statement 7 7 100.0
branch 1 2 50.0
condition n/a
subroutine 3 3 100.0
pod 0 1 0.0
total 11 13 84.6


line stmt bran cond sub pod time code
1             package App::RedisTop::Component::Save;
2 2     2   1188 use base 'App::RedisTop::Component';
  2         4  
  2         324  
3             sub new {
4 1     1 0 2 my $class = shift;
5              
6             my $self = bless {
7             group => 'save',
8             items => [
9             {
10             name => 'changes',
11             stat_key => sub {
12 1     1   2 my $redis_version = shift;
13 1 50       7 return $redis_version =~ /^2\.4/
14             ? 'changes_since_last_save'
15             : 'rdb_changes_since_last_save';
16             },
17             },
18 1         37 ],
19             width => 7,
20             unit => 1,
21             total => 1,
22             @_,
23             }, $class;
24             }
25              
26             1;