Branch Coverage

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


line true false branch
86 1 1 unless (defined $Proc::NiceSleep::_lastsleeptime)
92 1 1 if (defined $param)
94 1 0 if ($Proc::NiceSleep::_havesetpriority and setpriority(0, 0, $param) != -1) { }
100 1 0 $Proc::NiceSleep::_havesetpriority ? :
122 0 6 unless (defined $Proc::NiceSleep::_lastsleeptime)
124 6 0 $Proc::NiceSleep::_havetimehires ? :
128 0 6 if ($Proc::NiceSleep::_minruntime and $timepassed < $Proc::NiceSleep::_minruntime)
129 6 0 if ($Proc::NiceSleep::_sleepfactor)
130 2 4 if ($Proc::NiceSleep::_totalsleeptime == 0) { }
137 4 0 if ($totalruntime > 0)
139 0 4 if ($actualratio < $Proc::NiceSleep::_sleepfactor)
144 0 4 if $timetosleep < 0
148 1 5 if ($Proc::NiceSleep::_maxload and $t1 - $Proc::NiceSleep::_lastloadchecktime >= 0.5)
152 1 0 if ($loads[0] and $loads[0] > $Proc::NiceSleep::_maxload)
163 2 4 if ($timetosleep)
164 0 2 if ($Proc::NiceSleep::_minsleeptime and $timetosleep < $Proc::NiceSleep::_minsleeptime)
165 0 0 if ($timetosleep <= 0)
168 2 0 if ($Proc::NiceSleep::_havetimehires) { }
172 0 0 if ($timetosleep <= 0)
175 2 0 $Proc::NiceSleep::_havetimehires ? :
186 1 3 unless (defined $Proc::NiceSleep::_lastsleeptime)
188 4 0 if (defined $param) { }
189 0 4 if $param < 0
196 0 0 unless (defined $Proc::NiceSleep::_lastsleeptime)
198 0 0 if (defined $param) { }
199 0 0 if $param < 0
206 2 2 unless (defined $Proc::NiceSleep::_lastsleeptime)
208 4 0 if (defined $param) { }
209 0 4 if $param < 0
216 1 0 unless (defined $Proc::NiceSleep::_lastsleeptime)
218 1 0 if (defined $param) { }
219 0 1 if $param < 0
226 0 1 unless (defined $Proc::NiceSleep::_lastsleeptime)
228 1 0 if (defined $param) { }
229 0 1 if $param < 0
236 0 2 unless (defined $Proc::NiceSleep::_lastsleeptime)
238 2 0 if (defined $param) { }
239 0 2 if $param < 0
247 0 1 unless (defined $Proc::NiceSleep::_lastsleeptime)
276 0 0 unless (defined $Proc::NiceSleep::_lastsleeptime)
281 0 0 if (not defined $v) { }
0 0 elsif ($v =~ /^([0-9.]+)$/ and int $v != $v) { }
294 0 2 unless (defined $Proc::NiceSleep::_lastsleeptime)
295 1 1 if (@_) { }
303 18 0 $Proc::NiceSleep::_havetimehires ? :
304 4 0 $Proc::NiceSleep::_havetimehires ? :
319 1 2 $_[0] ? :
320 1 2 if $_ > $max
326 0 6 if ($@) { }
337 0 0 unless @l > 2 and defined $l[0] and $l[0] =~ /^\s*[0-9]*\.?[0-9]+$/
339 6 0 if ($@) { }
343 0 6 if ($@) { }
346 6 0 if ($@) { }
374 1 0 unless (defined $Proc::NiceSleep::_lastsleeptime)
377 1 0 if ($Proc::NiceSleep::_havetimehires)
381 0 1 if ($Proc::NiceSleep::_havesyscpuload)
388 1 0 if ($Proc::NiceSleep::_havetimehires) { }
394 0 0 if $t1 != int $t1 or $t2 != int $t2
403 0 1 unless (defined $Proc::NiceSleep::_lastsleeptime)
406 1 0 if ($Proc::NiceSleep::_loadfunction)
408 1 0 if @L
411 0 0 if ($Proc::NiceSleep::_havesyscpuload)
414 0 0 if ($loads[0] == 0)
420 0 0 unless open UPTIME, '/usr/bin/uptime |'
423 0 0 unless close UPTIME
424 0 0 if ($out and $out =~ /([0-9.]+)\s+([0-9.]+)\s+([0-9.]+)\s*$/)