Branch Coverage

blib/lib/Net/Statsd.pm
Criterion Covered Total %
branch 25 36 69.4


line true false branch
24 1 0 unless (defined $sample_rate)
57 0 10003 unless (defined $delta)
61 2 10001 unless (defined $sample_rate)
65 10002 1 if (not ref $stats) { }
0 1 elsif (ref $stats eq 'HASH') { }
82 0 6 unless defined $value
99 5079 4928 unless ($sampled_data)
105 1 4927 if (not $SOCK && $SOCK_PEER or "${HOST}:$PORT" ne $SOCK_PEER)
111 0 1 unless ($SOCK = 'IO::Socket::INET'->new('Proto', 'udp', 'PeerAddr', $HOST, 'PeerPort', $PORT))
113 0 0 unless $our $_warn_once{"${HOST}:$PORT"}++
129 5 4926 if (ref $value eq 'ARRAY') { }
139 0 4931 if (not defined $r) { }
0 4931 elsif ($r != length $packet) { }
156 0 20009 if (not $data or ref $data ne 'HASH')
160 1 20008 unless (defined $sample_rate)
165 8 20001 if ($sample_rate >= 1)
178 10009 9992 if (rand() <= $sample_rate)
186 0 15096 if (ref $value eq 'ARRAY') { }