Home | Trees | Indices | Help |
|
---|
|
1 #!/usr/bin/env python 2 3 import datetime 4 5 from starcluster.balancers import sge 6 from starcluster.tests import StarClusterTest 7 from starcluster.tests.templates import sge_balancer 8 911 stat_hash = None 12 host_hash = {} 136415 stat = sge.SGEStats() 16 self.host_hash = stat.parse_qhost(sge_balancer.qhost_xml) 17 assert len(self.host_hash) == 3 18 assert len(self.host_hash) == stat.count_hosts() 19 assert stat.count_total_slots() == 3 20 assert stat.slots_per_host() == 12123 stat = sge.SGEStats() 24 self.host_hash = stat.parse_qhost(sge_balancer.loaded_qhost_xml) 25 assert len(self.host_hash) == 10 26 assert len(self.host_hash) == stat.count_hosts() 27 assert stat.count_total_slots() == 80 28 assert stat.slots_per_host() == 82931 stat = sge.SGEStats() 32 self.stat_hash = stat.parse_qstat(sge_balancer.qstat_xml) 33 assert len(self.stat_hash) == 23 34 assert stat.first_job_id == 1 35 assert stat.last_job_id == 23 36 assert len(stat.get_queued_jobs()) == 20 37 assert len(stat.get_running_jobs()) == 3 38 assert stat.num_slots_for_job(21) == 1 39 oldest = datetime.datetime(2010, 6, 18, 23, 39, 14) 40 assert stat.oldest_queued_job_age() == oldest4143 stat = sge.SGEStats() 44 now = datetime.datetime.utcnow() 45 self.jobstats = stat.parse_qacct(sge_balancer.qacct_txt, now) 46 assert stat.avg_job_duration() == 90 47 assert stat.avg_wait_time() == 2634850 stat = sge.SGEStats() 51 self.stat_hash = stat.parse_qstat(sge_balancer.loaded_qstat_xml) 52 assert len(self.stat_hash) == 192 53 assert stat.first_job_id == 385 54 assert stat.last_job_id == 576 55 assert len(stat.get_queued_jobs()) == 188 56 assert len(stat.get_running_jobs()) == 4 57 assert stat.num_slots_for_job(576) == 20 58 oldest = datetime.datetime(2010, 7, 8, 4, 40, 32) 59 assert stat.oldest_queued_job_age() == oldest60
Home | Trees | Indices | Help |
|
---|
Generated by Epydoc 3.0.1 on Thu Jun 16 16:31:29 2011 | http://epydoc.sourceforge.net |