Branch Coverage

blib/lib/Sys/Statistics/Linux/Processes.pm
Criterion Covered Total %
branch 45 84 53.5


line true false branch
185 0 3 ref $_[0] ? :
201 0 3 if (defined $$opts{'pids'})
202 0 0 if (ref $$opts{'pids'} ne 'ARRAY')
207 0 0 unless ($pid =~ /^\d+\z/)
219 0 3 if ($$opts{'pages_to_bytes'})
234 0 3 unless (exists $$self{'init'})
265 24 0 if (defined $stat)
290 0 168 unless (defined $data)
295 48 120 if ($key eq 'statm' or $key eq 'stat') { }
314 0 3 unless (defined $$istat{'time'} and defined $$lstat{'time'})
318 0 3 unless ($$istat{'time'} =~ /^-{0,1}\d+(?:\.\d+){0,1}\z/ and $$lstat{'time'} =~ /^-{0,1}\d+(?:\.\d+){0,1}\z/)
333 24 0 if ($ipid and $$ipid{'sttime'} == $$lpid{'sttime'}) { }
335 0 192 unless (defined $$ipid{$k})
338 0 192 unless ($$ipid{$k} =~ /^-{0,1}\d+(?:\.\d+){0,1}\z/ and $$lpid{$k} =~ /^-{0,1}\d+(?:\.\d+){0,1}\z/)
345 7 185 if ($$lpid{$k} > 0 and $time > 0) { }
355 21 147 if (defined $$ipid{'io'}{$k} and defined $$lpid{'io'}{$k})
356 0 21 unless ($$ipid{'io'}{$k} =~ /^-{0,1}\d+(?:\.\d+){0,1}\z/ and $$lpid{'io'}{$k} =~ /^-{0,1}\d+(?:\.\d+){0,1}\z/)
361 6 15 if ($$lpid{'io'}{$k} > 0 and $time > 0) { }
374 0 0 if ($p_uptime > 0) { }
386 0 0 if ($p_uptime > 0) { }
404 0 24 unless open my $fh, '<', "$$file{'path'}/$pid/$$file{'statm'}"
409 0 24 if (@line < 7)
415 0 24 if ($ptb) { }
430 0 48 unless open my $fh, '<', "$$file{'path'}/$pid/$$file{'stat'}"
435 0 48 if (@line < 38)
459 0 24 unless open my $fh, '<', "$$file{'path'}/$pid/$$file{'status'}"
463 24 168 if ($line =~ /^Uid:(?:\s+|\t+)(\d+)/)
477 0 24 unless open my $fh, '<', "$$file{'path'}/$pid/$$file{'cmdline'}"
483 0 24 unless (defined $cmdline)
498 0 24 unless open my $fh, '<', "$$file{'path'}/$pid/$$file{'wchan'}"
504 0 24 unless (defined $wchan)
517 48 0 if (open my $fh, '<', "$$file{'path'}/$pid/$$file{'io'}")
519 42 0 if ($line =~ /^([a-z_]+):\s+(\d+)/)
535 24 0 if (opendir my $dh, "$$file{'path'}/$pid/$$file{'fd'}")
537 18 102 if (my $target = readlink "$$file{'path'}/$pid/$$file{'fd'}/$link")
550 0 6 if ($$self{'pids'})
554 0 6 unless opendir my $dh, $$file{'path'}
565 54 0 $$file{'path'} ? :
566 0 54 unless open my $fh, '<', $filename
575 0 48 if $s >= 86400 and $d = sprintf('%i', $s / 86400)
576 0 48 if $s >= 3600 and $h = sprintf('%i', $s / 3600)
577 18 30 if $s >= 60 and $m = sprintf('%i', $s / 60)