Commit 3d9e6479 authored by Leo Gordon's avatar Leo Gordon
Browse files

slightly improved output

parent 0c15bb1b
...@@ -31,7 +31,7 @@ sub type { # should return 'LOCAL' or 'LSF' ...@@ -31,7 +31,7 @@ sub type { # should return 'LOCAL' or 'LSF'
sub toString { sub toString {
my $self = shift @_; my $self = shift @_;
return "Meadow[type='".$self->type."', name='".$self->name."']"; return "Meadow:\t".$self->type.'/'.$self->name;
} }
......
...@@ -819,10 +819,10 @@ sub print_analysis_status { ...@@ -819,10 +819,10 @@ sub print_analysis_status {
} }
sub print_running_worker_status { sub print_running_worker_counts {
my $self = shift; my $self = shift;
print "====== Live workers according to Queen:\n"; print "\n===== Stats of live Workers according to the Queen: ======\n";
my $sql = "SELECT logic_name, count(*) FROM worker, analysis ". my $sql = "SELECT logic_name, count(*) FROM worker, analysis ".
"WHERE worker.analysis_id=analysis.analysis_id AND worker.cause_of_death='' ". "WHERE worker.analysis_id=analysis.analysis_id AND worker.cause_of_death='' ".
"GROUP BY worker.analysis_id"; "GROUP BY worker.analysis_id";
...@@ -831,12 +831,11 @@ sub print_running_worker_status { ...@@ -831,12 +831,11 @@ sub print_running_worker_status {
my $sth = $self->prepare($sql); my $sth = $self->prepare($sql);
$sth->execute(); $sth->execute();
while((my $logic_name, my $worker_count)=$sth->fetchrow_array()) { while((my $logic_name, my $worker_count)=$sth->fetchrow_array()) {
printf("%20s : %d workers\n", $logic_name, $worker_count); printf("%30s : %d workers\n", $logic_name, $worker_count);
$total_workers += $worker_count; $total_workers += $worker_count;
} }
printf(" %d total workers\n", $total_workers);
print "===========================\n";
$sth->finish; $sth->finish;
printf("%30s : %d workers\n\n", '======= TOTAL =======', $total_workers);
} }
=head2 monitor =head2 monitor
......
...@@ -178,7 +178,7 @@ sub main { ...@@ -178,7 +178,7 @@ sub main {
my $valley = Bio::EnsEMBL::Hive::Valley->new( $config, $meadow_type, $pipeline_name ); my $valley = Bio::EnsEMBL::Hive::Valley->new( $config, $meadow_type, $pipeline_name );
my $current_meadow = $valley->get_current_meadow(); my $current_meadow = $valley->get_current_meadow();
warn "Current meadow: ".$current_meadow->toString."\n"; warn "Current ".$current_meadow->toString."\n\n";
$current_meadow->config_set('TotalRunningWorkersMax', $total_running_workers_max) if(defined $total_running_workers_max); $current_meadow->config_set('TotalRunningWorkersMax', $total_running_workers_max) if(defined $total_running_workers_max);
$current_meadow->config_set('PendingAdjust', $pending_adjust) if(defined $pending_adjust); $current_meadow->config_set('PendingAdjust', $pending_adjust) if(defined $pending_adjust);
...@@ -240,15 +240,14 @@ sub main { ...@@ -240,15 +240,14 @@ sub main {
$queen->synchronize_hive($analysis); $queen->synchronize_hive($analysis);
} }
$queen->print_analysis_status($analysis) unless($self->{'no_analysis_stats'}); $queen->print_analysis_status($analysis) unless($self->{'no_analysis_stats'});
$queen->print_running_worker_status;
if($show_worker_stats) { if($show_worker_stats) {
print("===== List of live Workers according to the Queen: ======\n"); print "\n===== List of live Workers according to the Queen: ======\n";
foreach my $worker (@{ $queen->fetch_overdue_workers(0) }) { foreach my $worker (@{ $queen->fetch_overdue_workers(0) }) {
print $worker->toString()."\n"; print $worker->toString()."\n";
} }
print "\n";
} }
$queen->print_running_worker_counts;
$queen->schedule_workers($analysis); # show what would be submitted, but do not actually submit $queen->schedule_workers($analysis); # show what would be submitted, but do not actually submit
$queen->get_remaining_jobs_show_hive_progress(); $queen->get_remaining_jobs_show_hive_progress();
...@@ -335,7 +334,7 @@ sub run_autonomously { ...@@ -335,7 +334,7 @@ sub run_autonomously {
$queen->check_for_dead_workers($valley, 0); $queen->check_for_dead_workers($valley, 0);
$queen->print_analysis_status unless($self->{'no_analysis_stats'}); $queen->print_analysis_status unless($self->{'no_analysis_stats'});
$queen->print_running_worker_status; $queen->print_running_worker_counts;
my $workers_to_run_by_rc_id = $queen->schedule_workers_resync_if_necessary($valley, $this_analysis); my $workers_to_run_by_rc_id = $queen->schedule_workers_resync_if_necessary($valley, $this_analysis);
......
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