Branch Coverage

blib/lib/Monitor/MetricsAPI/Collector.pm
Criterion Covered Total %
branch 29 54 53.7


line true false branch
46 0 12 if (@_ == 1 and ref $_[0] eq 'HASH') { }
12 0 elsif (@_ % 2 == 0) { }
52 9 3 if (exists $args{'metrics'})
53 9 0 if (ref $args{'metrics'} eq 'HASH') { }
56 2 12 if (ref $metric->[1] eq 'CODE') { }
75 2 10 if (exists $args{'listen'})
82 0 2 if exists $args{'servers'}{$listen}
99 13 16 if (ref $metrics->{$k} eq 'HASH') { }
112 33 16 if defined $_
120 0 3 unless defined $addr and $addr =~ /\S+/
122 0 3 if defined $port and $port ne '' and not $port =~ /^\d+$/
125 0 3 unless defined $port and $port ne ''
129 3 0 if ($addr eq '*') { }
133 0 0 if $err
137 0 0 if $err
192 0 81 unless (defined $name)
197 0 81 unless (exists $self->metrics->{$name})
216 0 1 unless defined $metrics and ref $metrics eq 'HASH'
219 0 2 if (ref $metric->[1] eq 'CODE') { }
256 0 1 unless (defined $name and defined $type)
261 0 1 if ($type eq 'callback' and !defined($callback) || ref $callback ne 'CODE')
266 0 1 if (exists $self->metrics->{$name})
267 0 0 if $self->metrics->{$name}->type eq $type
272 1 0 $type eq 'callback' ? :
278 0 1 unless (defined $metric)
309 0 1 unless defined $listen
315 0 1 if (exists $self->servers->{$listen})