本文整理汇总了Python中WMCore.Services.WorkQueue.WorkQueue.WorkQueue.getChildQueuesAndStatus方法的典型用法代码示例。如果您正苦于以下问题:Python WorkQueue.getChildQueuesAndStatus方法的具体用法?Python WorkQueue.getChildQueuesAndStatus怎么用?Python WorkQueue.getChildQueuesAndStatus使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类WMCore.Services.WorkQueue.WorkQueue.WorkQueue
的用法示例。
在下文中一共展示了WorkQueue.getChildQueuesAndStatus方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: testWorkQueueService
# 需要导入模块: from WMCore.Services.WorkQueue.WorkQueue import WorkQueue [as 别名]
# 或者: from WMCore.Services.WorkQueue.WorkQueue.WorkQueue import getChildQueuesAndStatus [as 别名]
def testWorkQueueService(self):
# test getWork
specName = "RerecoSpec"
specUrl = self.specGenerator.createReRecoSpec(specName, "file",
assignKwargs={'SiteWhitelist': ['T2_XX_SiteA']})
globalQ = globalQueue(DbName='workqueue_t',
QueueURL=self.testInit.couchUrl,
UnittestFlag=True)
self.assertTrue(globalQ.queueWork(specUrl, specName, "teamA") > 0)
wqApi = WorkQueueDS(self.testInit.couchUrl, 'workqueue_t')
# overwrite default - can't test with stale view
wqApi.defaultOptions = {'reduce': True, 'group': True}
# This only checks minimum client call not exactly correctness of return
# values.
self.assertEqual(wqApi.getTopLevelJobsByRequest(),
[{'total_jobs': 339, 'request_name': specName}])
# work still available, so no childQueue
results = wqApi.getChildQueuesAndStatus()
self.assertItemsEqual(set([item['agent_name'] for item in results]), ["AgentNotDefined"])
result = wqApi.getElementsCountAndJobsByWorkflow()
self.assertEqual(len(result), 1)
self.assertEqual(result[specName]['Available']['Jobs'], 339)
results = wqApi.getChildQueuesAndPriority()
resultsPrio = set([item['priority'] for item in results if item['agent_name'] == "AgentNotDefined"])
self.assertItemsEqual(resultsPrio, [8000])
self.assertEqual(wqApi.getWMBSUrl(), [])
self.assertEqual(wqApi.getWMBSUrlByRequest(), [])