Commit 0c15bb1b authored by Leo Gordon's avatar Leo Gordon
Browse files

fixed and cleaned up the code that outputs a list of workers

parent f270555b
......@@ -407,20 +407,29 @@ sub perform_cleanup {
}
sub print_worker {
my $self = shift;
print("WORKER: worker_id=",$self->dbID,
" analysis_id=(",$self->analysis->dbID,")",$self->analysis->logic_name,
" host=",$self->host,
" pid=",$self->process_id,
"\n");
print("\tbatch_size = ", $self->analysis->stats->get_or_estimate_batch_size(),"\n");
print("\tjob_limit = ", $self->job_limit,"\n") if(defined($self->job_limit));
print("\tlife_span = ", $self->life_span,"\n") if(defined($self->life_span));
if(my $worker_output_dir = $self->worker_output_dir) {
print("\tworker_output_dir = $worker_output_dir\n");
} else {
print("\tworker_output_dir = STDOUT/STDERR\n");
}
my $self = shift;
print $self->toString()."\n";
print("\tbatch_size = ", $self->analysis->stats->get_or_estimate_batch_size(),"\n");
print("\tjob_limit = ", $self->job_limit,"\n") if(defined($self->job_limit));
print("\tlife_span = ", $self->life_span,"\n") if(defined($self->life_span));
if(my $worker_output_dir = $self->worker_output_dir) {
print("\tworker_output_dir = $worker_output_dir\n");
} else {
print("\tworker_output_dir = STDOUT/STDERR\n");
}
}
sub toString {
my $self = shift @_;
return "Worker:\t".join(', ',
'analysis='.$self->analysis->logic_name.'('.$self->analysis->dbID.')',
'meadow='.$self->meadow_type.'/'.$self->meadow_name,
'process='.$self->process_id.'@'.$self->host,
'last_check_in='.$self->last_check_in,
);
}
......
......@@ -242,7 +242,13 @@ sub main {
$queen->print_analysis_status($analysis) unless($self->{'no_analysis_stats'});
$queen->print_running_worker_status;
show_running_workers($self, $queen) if($show_worker_stats);
if($show_worker_stats) {
print("===== List of live Workers according to the Queen: ======\n");
foreach my $worker (@{ $queen->fetch_overdue_workers(0) }) {
print $worker->toString()."\n";
}
print "\n";
}
$queen->schedule_workers($analysis); # show what would be submitted, but do not actually submit
$queen->get_remaining_jobs_show_hive_progress();
......@@ -271,32 +277,6 @@ sub main {
#######################
# --------------[worker reports]--------------------
sub show_given_workers {
my ($self, $worker_list, $verbose_stats) = @_;
foreach my $worker (@{$worker_list}) {
printf("%10d %35s(%5d) %5s:%15s %15s (%s)\n",
$worker->dbID,
$worker->analysis->logic_name,
$worker->analysis->dbID,
$worker->beekeeper,
$worker->process_id,
$worker->host,
$worker->last_check_in);
printf("%s\n", $worker->worker_output_dir) if ($verbose_stats);
}
}
sub show_running_workers {
my ($self, $queen) = @_;
print("===== running workers\n");
show_given_workers($self, $queen->fetch_overdue_workers(0), $queen->{'verbose_stats'});
}
sub generate_worker_cmd {
my ($self, $run_job_id) = @_;
......
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