From: Marius Gavrilescu Date: Mon, 16 Mar 2015 15:44:34 +0000 (+0200) Subject: Improve gmpb check X-Git-Tag: 5999.000_014~55 X-Git-Url: http://git.ieval.ro/?a=commitdiff_plain;h=de599ce61e347edbf3f5cc4f2a4c1986aaeb016e;p=gruntmaster-data.git Improve gmpb check --- diff --git a/gruntmaster-problem b/gruntmaster-problem index 816f919..20f6a4f 100755 --- a/gruntmaster-problem +++ b/gruntmaster-problem @@ -151,13 +151,13 @@ sub cmd_check { $_->rerun for @jobs; sleep 1 while $db->jobs->search({problem => $id, result_text => undef})->count; - my (@good_times, @fail_times, $fail); + my (%pass, %fail, $fail); for (@jobs) { $_->discard_changes; - my @times = map { $_->{time} } @{decode_json $_->results}; - push @good_times, @times if $_->reference == 0; - push @fail_times, @times if $_->reference == 3; + my $time = max map { $_->{time} } @{decode_json $_->results}; + $pass{$_->format} = max ($pass{$_->format} // (), $time) if $_->reference == 0; + $fail{$_->format} = max ($fail{$_->format} // (), $time) if $_->reference == 3; if ($_->result == $_->reference) { say 'Job ' . $_->id . ' OK' } else { @@ -166,8 +166,8 @@ sub cmd_check { } } - say 'Max time for AC: ' . max @good_times if @good_times; - say 'Min time for TLE: ' . min @fail_times if @fail_times; + printf "Min timeout for %s: %.2fs\n", $_, $pass{$_} for keys %pass; + printf "Max timeout for %s: %.2fs\n", $_, $fail{$_} for keys %fail; say $fail ? 'Test failed' : 'Test successful'; exit $fail if $fail; }