Bio::EnsEMBL::Hive AnalysisStats
SummaryPackage variablesSynopsisDescriptionGeneral documentationMethods
Toolbar
WebCvsRaw content
Summary
  Bio::EnsEMBL::Hive::AnalysisStats
Package variables
No package variables defined.
Included modules
Bio::EnsEMBL::Analysis
Bio::EnsEMBL::DBSQL::DBAdaptor
Bio::EnsEMBL::Hive::Worker
Synopsis
Description
Methods
adaptor
No description
Code
analysis_id
No description
Code
avg_input_msec_per_job
No description
Code
avg_msec_per_job
No description
Code
avg_output_msec_per_job
No description
Code
avg_run_msec_per_job
No description
Code
batch_size
No description
Code
behaviour
No description
Code
cpu_minutes_remaining
No description
Code
decrease_hive_capacity
No description
Code
determine_status
No description
Code
done_job_count
No description
Code
failed_job_count
No description
Code
failed_job_tolerance
No description
Code
get_analysis
No description
Code
get_running_worker_count
No description
Code
hive_capacity
No description
Code
increase_hive_capacity
No description
Code
input_capacity
No description
Code
max_retry_count
No description
Code
new
No description
Code
num_required_workers
No description
Code
num_running_workers
No description
Code
output_capacity
No description
Code
print_stats
No description
Code
refresh
No description
Code
remaining_job_count
No description
Code
running_job_count
No description
Code
seconds_since_last_update
No description
Code
status
No description
Code
sync_lock
No description
Code
total_job_count
No description
Code
unclaimed_job_count
No description
Code
update
No description
Code
update_status
No description
Code
Methods description
None available.
Methods code
adaptordescriptionprevnextTop
sub adaptor {
  my $self = shift;
  $self->{'_adaptor'} = shift if(@_);
  return $self->{'_adaptor'};
}
analysis_iddescriptionprevnextTop
sub analysis_id {
  my $self = shift;
  $self->{'_analysis_id'} = shift if(@_);
  return $self->{'_analysis_id'};
}
avg_input_msec_per_jobdescriptionprevnextTop
sub avg_input_msec_per_job {
  my $self = shift;
  $self->{'_avg_input_msec_per_job'} = shift if(@_);
  $self->{'_avg_input_msec_per_job'}=0 unless($self->{'_avg_input_msec_per_job'});
  return $self->{'_avg_input_msec_per_job'};
}
avg_msec_per_jobdescriptionprevnextTop
sub avg_msec_per_job {
  my $self = shift;
  $self->{'_avg_msec_per_job'} = shift if(@_);
  $self->{'_avg_msec_per_job'}=0 unless($self->{'_avg_msec_per_job'});
  return $self->{'_avg_msec_per_job'};
}
avg_output_msec_per_jobdescriptionprevnextTop
sub avg_output_msec_per_job {
  my $self = shift;
  $self->{'_avg_output_msec_per_job'} = shift if(@_);
  $self->{'_avg_output_msec_per_job'}=0 unless($self->{'_avg_output_msec_per_job'});
  return $self->{'_avg_output_msec_per_job'};
}
avg_run_msec_per_jobdescriptionprevnextTop
sub avg_run_msec_per_job {
  my $self = shift;
  $self->{'_avg_run_msec_per_job'} = shift if(@_);
  $self->{'_avg_run_msec_per_job'}=0 unless($self->{'_avg_run_msec_per_job'});
  return $self->{'_avg_run_msec_per_job'};
}
batch_sizedescriptionprevnextTop
sub batch_size {
  my $self = shift;
  $self->{'_batch_size'} = shift if(@_);
  $self->{'_batch_size'}=1 unless(defined($self->{'_batch_size'}));
  return $self->{'_batch_size'};
}
behaviourdescriptionprevnextTop
sub behaviour {
  my $self = shift;
  $self->{'_behaviour'} = shift if(@_);
  return $self->{'_behaviour'};
}
cpu_minutes_remainingdescriptionprevnextTop
sub cpu_minutes_remaining {
  my $self = shift;
  return ($self->avg_msec_per_job * $self->unclaimed_job_count / 60000);
}
decrease_hive_capacitydescriptionprevnextTop
sub decrease_hive_capacity {
  my ($self) = @_;
  return unless ($self->adaptor);
  $self->adaptor->decrease_hive_capacity($self->analysis_id);
}
determine_statusdescriptionprevnextTop
sub determine_status {
  my $self = shift;
  
  if($self->status ne 'BLOCKED') {
    if ($self->unclaimed_job_count == 0 and
        $self->total_job_count == $self->done_job_count + $self->failed_job_count) {
      my $failure_percentage = 0;
      if ($self->total_job_count) {
        $failure_percentage = $self->failed_job_count * 100 / $self->total_job_count;
} if ($failure_percentage > $self->failed_job_tolerance) { $self->status('FAILED'); print "\n", "##################################################\n", printf "## ERROR: %-35s ##\n", $self->get_analysis->logic_name." failed!"; printf "## %4.1f%% jobs failed (tolerance: %3d%%) ##\n", $failure_percentage, $self->failed_job_tolerance; print "##################################################\n\n"; } else { $self->status('DONE'); } } if($self->total_job_count == $self->unclaimed_job_count) { $self->status('READY'); } if($self->unclaimed_job_count>0 and $self->total_job_count > $self->unclaimed_job_count) { $self->status('WORKING'); } } return $self;
}
done_job_countdescriptionprevnextTop
sub done_job_count {
  my $self = shift;
  $self->{'_done_job_count'} = shift if(@_);
  return $self->{'_done_job_count'};
}
failed_job_countdescriptionprevnextTop
sub failed_job_count {
  my $self = shift;
  $self->{'_failed_job_count'} = shift if(@_);
  $self->{'_failed_job_count'} = 0 unless(defined($self->{'_failed_job_count'}));
  return $self->{'_failed_job_count'};
}
failed_job_tolerancedescriptionprevnextTop
sub failed_job_tolerance {
  my $self = shift;
  $self->{'_failed_job_tolerance'} = shift if(@_);
  $self->{'_failed_job_tolerance'} = 0 unless(defined($self->{'_failed_job_tolerance'}));
  return $self->{'_failed_job_tolerance'};
}
get_analysisdescriptionprevnextTop
sub get_analysis {
  my $self = shift;
  unless($self->{'_analysis'}) {
    $self->{'_analysis'} = $self->adaptor->db->get_AnalysisAdaptor->fetch_by_dbID($self->analysis_id);
  }
  return $self->{'_analysis'};
}
get_running_worker_countdescriptionprevnextTop
sub get_running_worker_count {
  my $self = shift;
  return unless ($self->adaptor);
  return $self->adaptor->get_running_worker_count($self);
}
hive_capacitydescriptionprevnextTop
sub hive_capacity {
  my $self = shift;
  $self->{'_hive_capacity'} = shift if(@_);
  return $self->{'_hive_capacity'};
}
increase_hive_capacitydescriptionprevnextTop
sub increase_hive_capacity {
  my ($self) = @_;
  return unless ($self->adaptor);
  $self->adaptor->increase_hive_capacity($self->analysis_id);
}
input_capacitydescriptionprevnextTop
sub input_capacity {
  my $self = shift;
  $self->{'_input_capacity'} = shift if(@_);
  return $self->{'_input_capacity'};
}
max_retry_countdescriptionprevnextTop
sub max_retry_count {
  my $self = shift;
  $self->{'_max_retry_count'} = shift if(@_);
  $self->{'_max_retry_count'} = 3 unless(defined($self->{'_max_retry_count'}));
  return $self->{'_max_retry_count'};
}
newdescriptionprevnextTop
sub new {
  my ($class,@args) = @_;
  my $self = bless {}, $class;
  return $self;
}
num_required_workersdescriptionprevnextTop
sub num_required_workers {
  my $self = shift;
  $self->{'_num_required_workers'} = shift if(@_);
  return $self->{'_num_required_workers'};
}
num_running_workersdescriptionprevnextTop
sub num_running_workers {
  my $self = shift;
  $self->{'_num_running_workers'} = shift if(@_);
  return $self->{'_num_running_workers'};
}
output_capacitydescriptionprevnextTop
sub output_capacity {
  my $self = shift;
  $self->{'_output_capacity'} = shift if(@_);
  return $self->{'_output_capacity'};
}
print_statsdescriptionprevnextTop
sub print_stats {
  my $self = shift;
  my $mode = shift;

  return unless($self->get_analysis);

  $mode=1 unless($mode);

  my $name = sprintf("%s(%d)", $self->get_analysis->logic_name, $self->analysis_id);
  while(length($name) < 27) { $name.=' ';}

  if($mode == 1) {
    # printf("%s(%d) %s %d:ms %d:cpu (%d:q %d:r %d:d %d:f %d:t) [%d/%d workers] (%d secs synched)\n",
#printf("%30s(%3d) %12s jobs(t:%d,q:%d,d:%d,f:%d) b:%d M:%d w:%d (%d secs old)\n",
printf("$name %11s %d:cpum job(%d/%d run:%d fail:%d %dms) worker[%d/%d] (sync %d)\n", $self->status, $self->cpu_minutes_remaining, $self->remaining_job_count, $self->total_job_count, $self->running_job_count, $self->failed_job_count, $self->avg_msec_per_job, $self->num_required_workers, $self->hive_capacity, $self->seconds_since_last_update, ); } elsif ($mode == 2) { printf("$name %11s [%d/%d workers] (%d secs synched)\n", $self->status, $self->num_required_workers, $self->hive_capacity, $self->seconds_since_last_update); printf(" msec_per_job : %d\n", $self->avg_msec_per_job); printf(" cpu_min_total : %d\n", $self->cpu_minutes_remaining); printf(" batch_size : %d\n", $self->batch_size); printf(" total_jobs : %d\n", $self->total_job_count); printf(" unclaimed jobs : %d\n", $self->unclaimed_job_count); printf(" running jobs : %d\n", $self->running_job_count); printf(" done jobs : %d\n", $self->done_job_count); printf(" failed jobs : %d\n", $self->failed_job_count); } } 1;
}
refreshdescriptionprevnextTop
sub refresh {
  my $self = shift;
  return unless($self->adaptor);
  $self->adaptor->refresh($self);
}
remaining_job_countdescriptionprevnextTop
sub remaining_job_count {
  my $self = shift;
  return $self->total_job_count
         - $self->done_job_count
         - $self->failed_job_count;
}
running_job_countdescriptionprevnextTop
sub running_job_count {
  my $self = shift;
  return $self->total_job_count
         - $self->done_job_count
         - $self->unclaimed_job_count
         - $self->failed_job_count;
}
seconds_since_last_updatedescriptionprevnextTop
sub seconds_since_last_update {
  my( $self, $value ) = @_;
  $self->{'_last_update'} = time() - $value if(defined($value));
  return time() - $self->{'_last_update'};
}
statusdescriptionprevnextTop
sub status {
  my ($self, $value ) = @_;

  if(defined $value) {
    $self->{'_status'} = $value;
  }
  return $self->{'_status'};
}
sync_lockdescriptionprevnextTop
sub sync_lock {
  my $self = shift;
  $self->{'_sync_lock'} = shift if(@_);
  return $self->{'_sync_lock'};
}
total_job_countdescriptionprevnextTop
sub total_job_count {
  my $self = shift;
  $self->{'_total_job_count'} = shift if(@_);
  return $self->{'_total_job_count'};
}
unclaimed_job_countdescriptionprevnextTop
sub unclaimed_job_count {
  my $self = shift;
  $self->{'_unclaimed_job_count'} = shift if(@_);
  return $self->{'_unclaimed_job_count'};
}
updatedescriptionprevnextTop
sub update {
  my $self = shift;
  return unless($self->adaptor);
  $self->adaptor->update($self);
}
update_statusdescriptionprevnextTop
sub update_status {
  my ($self, $status ) = @_;
  return unless($self->adaptor);
  $self->adaptor->update_status($self->analysis_id, $status);
  $self->status($status);
}
General documentation
CONTACTTop
  Contact Jessica Severin on EnsEMBL::Hive implemetation/design detail: jessica@ebi.ac.uk
Contact Ewan Birney on EnsEMBL in general: birney@sanger.ac.uk
APPENDIXTop
  The rest of the documentation details each of the object methods.
Internal methods are usually preceded with a _