本文整理汇总了Python中Cobalt.Proxy.ComponentProxy.add_event方法的典型用法代码示例。如果您正苦于以下问题:Python ComponentProxy.add_event方法的具体用法?Python ComponentProxy.add_event怎么用?Python ComponentProxy.add_event使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Cobalt.Proxy.ComponentProxy
的用法示例。
在下文中一共展示了ComponentProxy.add_event方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: ClusterQsim
# 需要导入模块: from Cobalt.Proxy import ComponentProxy [as 别名]
# 或者: from Cobalt.Proxy.ComponentProxy import add_event [as 别名]
#.........这里部分代码省略.........
try:
ComponentProxy(REMOTE_QUEUE_MANAGER).set_mate_job_dict(remote_mate_job_dict)
except:
self.logger.error("failed to connect to remote queue-manager component!")
self.coscheduling = False
print "number of mate job pairs: %s, proportion in cluster jobs: %s%%" \
% (len(self.mate_job_dict.keys()), round(proportion *100, 1) )
self.max_holding_sys_util = DEFAULT_MAX_HOLDING_SYS_UTIL
def get_current_time(self):
'''this function overrid the get_current_time in bgsched, bg_base_system, and cluster_base_system'''
return self.event_manager.get_current_time()
def get_current_time_sec(self):
return self.event_manager.get_current_time()
def get_current_time_date(self):
return self.event_manager.get_current_date_time()
def insert_time_stamp(self, timestamp, type, info):
'''insert time stamps in the same order'''
if type not in SET_event:
print "invalid event type,", type
return
evspec = {}
evspec['jobid'] = info.get('jobid', 0)
evspec['type'] = type
evspec['datetime'] = sec_to_date(timestamp)
evspec['unixtime'] = timestamp
evspec['machine'] = MACHINE_ID
self.event_manager.add_event(evspec)
def _get_queuing_jobs(self):
return [job for job in self.queues.get_jobs([{'is_runnable':True}])]
queuing_jobs = property(_get_queuing_jobs)
def _get_running_jobs(self):
return [job for job in self.queues.get_jobs([{'has_resources':True}])]
running_jobs = property(_get_running_jobs)
def add_queues(self, specs):
'''add queues'''
return self.queues.add_queues(specs)
add_queues = exposed(query(add_queues))
def get_queues(self, specs):
'''get queues'''
return self.queues.get_queues(specs)
get_queues = exposed(query(get_queues))
def init_queues(self):
'''parses the work load log file, initializes queues and sorted time
stamp list'''
print "Initializing cluster jobs, one moment please..."
raw_jobs = parse_work_load(self.workload_file)
specs = []
tag = 0
for key in raw_jobs:
spec = {}
tmp = raw_jobs[key]