Commit 1e5ff11e authored by Jessica Severin's avatar Jessica Severin
Browse files

included a sum of failed jobs in the calculation of %completion

parent dbf16f37
...@@ -584,16 +584,17 @@ sub get_num_needed_workers { ...@@ -584,16 +584,17 @@ sub get_num_needed_workers {
sub get_hive_progress sub get_hive_progress
{ {
my $self = shift; my $self = shift;
my $sql = "SELECT sum(done_job_count ), sum(total_job_count) FROM analysis_stats"; my $sql = "SELECT sum(done_job_count), sum(failed_job_count), sum(total_job_count) FROM analysis_stats";
my $sth = $self->prepare($sql); my $sth = $self->prepare($sql);
$sth->execute(); $sth->execute();
my ($done, $total) = $sth->fetchrow_array(); my ($done, $failed, $total) = $sth->fetchrow_array();
$sth->finish; $sth->finish;
$done=0 unless($done); $done=0 unless($done);
$failed=0 unless($failed);
$total=0 unless($total); $total=0 unless($total);
my $completed=0.0; my $completed=0.0;
$completed = ((100.0 * $done)/$total) if($total>0); $completed = ((100.0 * ($done+$failed))/$total) if($total>0);
printf("hive %1.3f%% complete (%d done / %d total)\n", $completed, $done, $total); printf("hive %1.3f%% complete (%d done + %d failed / %d total)\n", $completed, $done, $failed, $total);
return $done, $total; return $done, $total;
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment