Branch Coverage

blib/lib/Proc/NiceSleep.pm
Criterion Covered Total %
branch 61 132 46.2


line true false branch
83 1 1 unless (defined $Proc::NiceSleep::_lastsleeptime)
89 1 1 if (defined $param)
91 1 0 if ($Proc::NiceSleep::_havesetpriority and setpriority(0, 0, $param) != -1) { }
97 1 0 $Proc::NiceSleep::_havesetpriority ? :
119 0 6 unless (defined $Proc::NiceSleep::_lastsleeptime)
121 6 0 $Proc::NiceSleep::_havetimehires ? :
125 0 6 if ($Proc::NiceSleep::_minruntime and $timepassed < $Proc::NiceSleep::_minruntime)
126 6 0 if ($Proc::NiceSleep::_sleepfactor)
127 2 4 if ($Proc::NiceSleep::_totalsleeptime == 0) { }
134 4 0 if ($totalruntime > 0)
136 0 4 if ($actualratio < $Proc::NiceSleep::_sleepfactor)
141 0 4 if $timetosleep < 0
145 1 5 if ($Proc::NiceSleep::_maxload and $t1 - $Proc::NiceSleep::_lastloadchecktime >= 0.5)
149 1 0 if ($loads[0] and $loads[0] > $Proc::NiceSleep::_maxload)
160 2 4 if ($timetosleep)
161 0 2 if ($Proc::NiceSleep::_minsleeptime and $timetosleep < $Proc::NiceSleep::_minsleeptime)
162 0 0 if ($timetosleep <= 0)
165 2 0 if ($Proc::NiceSleep::_havetimehires) { }
169 0 0 if ($timetosleep <= 0)
172 2 0 $Proc::NiceSleep::_havetimehires ? :
183 1 3 unless (defined $Proc::NiceSleep::_lastsleeptime)
185 4 0 if (defined $param) { }
186 0 4 if $param < 0
193 0 0 unless (defined $Proc::NiceSleep::_lastsleeptime)
195 0 0 if (defined $param) { }
196 0 0 if $param < 0
203 2 2 unless (defined $Proc::NiceSleep::_lastsleeptime)
205 4 0 if (defined $param) { }
206 0 4 if $param < 0
213 1 0 unless (defined $Proc::NiceSleep::_lastsleeptime)
215 1 0 if (defined $param) { }
216 0 1 if $param < 0
223 0 1 unless (defined $Proc::NiceSleep::_lastsleeptime)
225 1 0 if (defined $param) { }
226 0 1 if $param < 0
233 0 2 unless (defined $Proc::NiceSleep::_lastsleeptime)
235 2 0 if (defined $param) { }
236 0 2 if $param < 0
244 0 1 unless (defined $Proc::NiceSleep::_lastsleeptime)
273 0 0 unless (defined $Proc::NiceSleep::_lastsleeptime)
278 0 0 if (not defined $v) { }
0 0 elsif ($v =~ /^([0-9.]+)$/ and int $v != $v) { }
291 0 2 unless (defined $Proc::NiceSleep::_lastsleeptime)
292 1 1 if (@_) { }
300 18 0 $Proc::NiceSleep::_havetimehires ? :
301 4 0 $Proc::NiceSleep::_havetimehires ? :
316 1 2 $_[0] ? :
317 1 2 if $_ > $max
323 0 6 if ($@) { }
334 0 0 unless @l > 2 and defined $l[0] and $l[0] =~ /^\s*[0-9]*\.?[0-9]+$/
336 6 0 if ($@) { }
340 0 6 if ($@) { }
343 6 0 if ($@) { }
371 1 0 unless (defined $Proc::NiceSleep::_lastsleeptime)
374 1 0 if ($Proc::NiceSleep::_havetimehires)
378 0 1 if ($Proc::NiceSleep::_havesyscpuload)
385 1 0 if ($Proc::NiceSleep::_havetimehires) { }
391 0 0 if $t1 != int $t1 or $t2 != int $t2
400 0 1 unless (defined $Proc::NiceSleep::_lastsleeptime)
403 1 0 if ($Proc::NiceSleep::_loadfunction)
405 1 0 if @L
408 0 0 if ($Proc::NiceSleep::_havesyscpuload)
411 0 0 if ($loads[0] == 0)
417 0 0 unless open UPTIME, '/usr/bin/uptime |'
420 0 0 unless close UPTIME
421 0 0 if ($out and $out =~ /([0-9.]+)\s+([0-9.]+)\s+([0-9.]+)\s*$/)