Package starcluster :: Package balancers :: Package sge :: Class SGEStats
[hide private]
[frames] | no frames]

Class SGEStats

source code


SunGridEngine stats parser

Instance Methods [hide private]
 
parse_qhost(self, string)
this function parses qhost -xml output and makes a neat array takes in a string, so we can pipe in output from ssh.exec('qhost -xml')
source code
 
parse_qstat(self, string, fields=None)
This method parses qstat -xml output and makes a neat array
source code
 
job_multiply(self, hash)
This function deals with sge jobs with a task range.
source code
 
qacct_to_datetime_tuple(self, qacct)
Takes the SGE qacct formatted time and makes a datetime tuple format is: Tue Jul 13 16:24:03 2010
source code
 
parse_qacct(self, string, dtnow)
This method parses qacct -j output and makes a neat array and calculates some statistics.
source code
 
is_jobstats_empty(self)
This function will return True if half of the queue is empty, False if there are enough entries in it.
source code
 
get_running_jobs(self)
returns an array of the running jobs, values stored in dictionary
source code
 
get_queued_jobs(self)
returns an array of the queued jobs, values stored in dictionary
source code
 
count_hosts(self)
returns a count of the hosts in the cluster
source code
 
count_total_slots(self)
returns a count of total slots available in this cluser
source code
 
slots_per_host(self)
returns the number of slots per host.
source code
 
oldest_queued_job_age(self)
This returns the age of the oldest job in the queue
source code
 
is_node_working(self, node)
This function returns true if the node is currently working on a task, or false if the node is currently idle.
source code
 
num_slots_for_job(self, job_id)
returns the number of slots requested for the given job id returns -1 if job_id is invalid
source code
 
avg_job_duration(self) source code
 
avg_wait_time(self) source code
 
on_first_job(self)
returns true if the cluster is processing the first job, False otherwise
source code
 
get_loads(self)
returns an array containing the loads on each host in cluster
source code
 
_add(self, x, y) source code
 
get_all_stats(self) source code
 
write_stats_to_csv(self, filename)
Write important SGE stats to CSV file Appends one line to the CSV
source code

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __init__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Class Variables [hide private]
  jobstat_cachesize = 200
  hosts = []
  jobs = []
  jobstats = [None, None, None, None, None, None, None, None, No...
  max_job_id = 0
  _default_fields = ['JB_job_number', 'state', 'JB_submission_ti...
Properties [hide private]
  first_job_id
  last_job_id

Inherited from object: __class__

Method Details [hide private]

job_multiply(self, hash)

source code 

This function deals with sge jobs with a task range. For example, 'qsub -t 1-20:1' makes 20 jobs. self.jobs needs to represent that it is 20 jobs instead of just 1.

parse_qacct(self, string, dtnow)

source code 

This method parses qacct -j output and makes a neat array and calculates some statistics. Takes the string to parse, and a datetime object of the remote host's current time.

slots_per_host(self)

source code 

returns the number of slots per host. If for some reason the cluster is inconsistent, this will return -1 for example, if you have m1.large and m1.small in the same cluster


Class Variable Details [hide private]

jobstats

Value:
[None,
 None,
 None,
 None,
 None,
 None,
 None,
 None,
...

_default_fields

Value:
['JB_job_number',
 'state',
 'JB_submission_time',
 'queue_name',
 'slots',
 'tasks']

Property Details [hide private]

first_job_id

Get Method:
unreachable.first_job_id(self)

last_job_id

Get Method:
unreachable.last_job_id(self)