3
0
mirror of https://github.com/pragma-/pbot.git synced 2024-11-26 22:09:26 +01:00

Compiler CPU watchdog: print message only when there's load

This commit is contained in:
Pragmatic Software 2015-04-21 01:10:45 -07:00
parent 00203f1705
commit bc99ac001f

View File

@ -43,7 +43,7 @@ while (1) {
if ($pids->{$ppid}->{fname} eq 'compiler_server') { if ($pids->{$ppid}->{fname} eq 'compiler_server') {
my $pctcpu = `top -b -n 1 -p $p | tail -n 1 | awk '{print \$9}'`; my $pctcpu = `top -b -n 1 -p $p | tail -n 1 | awk '{print \$9}'`;
$pctcpu =~ s/^\s+|\s+$//g; $pctcpu =~ s/^\s+|\s+$//g;
print scalar localtime, " :: Got compiler qemu pid: $p; using $pctcpu cpu\n"; print scalar localtime, " :: Got compiler qemu pid: $p; using $pctcpu cpu\n" if $pctcpu > 0;
if ($pctcpu >= $last_pctcpu and $last_pctcpu >= $MAX_PCTCPU) { if ($pctcpu >= $last_pctcpu and $last_pctcpu >= $MAX_PCTCPU) {
reset_vm; reset_vm;