line |
true |
false |
branch |
24
|
4 |
3 |
if ($$self{'db_file'}) |
43
|
3 |
4 |
if ($$self{'db'}->exists) |
50
|
2 |
1 |
if ($$self{'data'}{'chain'} and $$self{'data'}{'chain'}{'max_items'} != $options{'max_items'} || $$self{'data'}{'chain'}{'interval'} != $options{'interval'}) |
57
|
1 |
2 |
if ($options{'reset'} or not $$self{'db'}->backend_store_ok) |
63
|
6 |
1 |
if ($create) |
64
|
0 |
6 |
unless $$self{'db'}->create(\%options) |
84
|
2 |
4 |
if ($$self{'changed'}) |
135
|
26 |
23 |
if (exists $options{'key'}) { } |
156
|
3 |
2 |
if (exists $options{'key'}) { } |
245
|
0 |
6 |
unless ($$self{'max_items'} and $$self{'interval'}) |
250
|
6 |
0 |
unless ($$self{'nof_buckets'}) |
254
|
1 |
5 |
if ($$self{'nof_buckets'} > $$self{'interval'}) |
317
|
1 |
120 |
if $$self{'current_idx'} == $$self{'tail_bucket_idx'} |
320
|
0 |
120 |
if $$self{'current_idx'} > $#{$$self{'buckets'};} |
342
|
0 |
0 |
unless (scalar keys %{$$b{'count'};}) |
382
|
2 |
1 |
if $$self{'tail_bucket_idx'} > $#{$$self{'buckets'};} |
385
|
1 |
2 |
if $$self{'head_bucket_idx'} > $#{$$self{'buckets'};} |
397
|
0 |
1 |
unless defined $time |
406
|
0 |
1 |
if ($self->last_bucket->{'time'}{'stop'} >= $time) |
415
|
0 |
1 |
if ($$self{'buckets'}[$$self{'tail_bucket_idx'}]{'time'}->max < $time - $$self{'interval'}) |
444
|
26 |
24 |
if ($$last_bucket{'time'}->member($time)) |
450
|
23 |
121 |
if ($$b{'time'}->member($time)) |
467
|
26 |
25 |
if defined $options{'key'} |
474
|
45 |
369 |
if exists $$self{'buckets'}[$_]{'count'}{$key} |
487
|
26 |
23 |
if defined $options{'key'} |
490
|
22 |
27 |
if defined $options{'time'} |
493
|
0 |
49 |
if defined $options{'count'} |
496
|
2 |
47 |
if defined $options{'force'} |
502
|
1 |
48 |
unless ($b) |
510
|
13 |
36 |
if ($val >= $$self{'max_items'}) { } |
511
|
1 |
12 |
if ($force) { } |
536
|
3 |
2 |
if defined $options{'key'} |
542
|
5 |
45 |
if (exists $$self{'buckets'}[$_]{'count'}{$key}) |
620
|
0 |
2 |
unless (-f $$self{'db_file'}) |
628
|
0 |
2 |
if ($@) |
668
|
0 |
15 |
unless open $$self{'fh'}, '+<', $$self{'db_file'} |