本文整理汇总了Python中DIRAC.WorkloadManagementSystem.DB.JobLoggingDB.JobLoggingDB.getJobLoggingInfo方法的典型用法代码示例。如果您正苦于以下问题:Python JobLoggingDB.getJobLoggingInfo方法的具体用法?Python JobLoggingDB.getJobLoggingInfo怎么用?Python JobLoggingDB.getJobLoggingInfo使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DIRAC.WorkloadManagementSystem.DB.JobLoggingDB.JobLoggingDB
的用法示例。
在下文中一共展示了JobLoggingDB.getJobLoggingInfo方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: StalledJobAgent
# 需要导入模块: from DIRAC.WorkloadManagementSystem.DB.JobLoggingDB import JobLoggingDB [as 别名]
# 或者: from DIRAC.WorkloadManagementSystem.DB.JobLoggingDB.JobLoggingDB import getJobLoggingInfo [as 别名]
#.........这里部分代码省略.........
"""
result = self.jobDB.getHeartBeatData( jobID )
lastCPUTime = 0
lastWallTime = 0
lastHeartBeatTime = jobDict['StartExecTime']
if lastHeartBeatTime == "None":
lastHeartBeatTime = 0
if result['OK']:
for name, value, heartBeatTime in result['Value']:
if 'CPUConsumed' == name:
try:
value = int( float( value ) )
if value > lastCPUTime:
lastCPUTime = value
except ValueError:
pass
if 'WallClockTime' == name:
try:
value = int( float( value ) )
if value > lastWallTime:
lastWallTime = value
except ValueError:
pass
if heartBeatTime > lastHeartBeatTime:
lastHeartBeatTime = heartBeatTime
return lastCPUTime, lastWallTime, lastHeartBeatTime
def __checkLoggingInfo( self, jobID, jobDict ):
""" Get info from JobLogging
"""
logList = []
result = self.logDB.getJobLoggingInfo( jobID )
if result['OK']:
logList = result['Value']
startTime = jobDict['StartExecTime']
if not startTime or startTime == 'None':
# status, minor, app, stime, source
for items in logList:
if items[0] == 'Running':
startTime = items[3]
break
if not startTime or startTime == 'None':
startTime = jobDict['SubmissionTime']
if type( startTime ) in types.StringTypes:
startTime = fromString( startTime )
if startTime == None:
self.log.error( 'Wrong timestamp in DB', items[3] )
startTime = dateTime()
endTime = dateTime()
# status, minor, app, stime, source
for items in logList:
if items[0] == 'Stalled':
endTime = fromString( items[3] )
if endTime == None:
self.log.error( 'Wrong timestamp in DB', items[3] )
endTime = dateTime()
return startTime, endTime
def __kickStuckJobs( self ):
示例2: StalledJobAgent
# 需要导入模块: from DIRAC.WorkloadManagementSystem.DB.JobLoggingDB import JobLoggingDB [as 别名]
# 或者: from DIRAC.WorkloadManagementSystem.DB.JobLoggingDB.JobLoggingDB import getJobLoggingInfo [as 别名]
#.........这里部分代码省略.........
"""
result = self.jobDB.getHeartBeatData(jobID)
lastCPUTime = 0
lastWallTime = 0
lastHeartBeatTime = jobDict["StartExecTime"]
if lastHeartBeatTime == "None":
lastHeartBeatTime = 0
if result["OK"]:
for name, value, heartBeatTime in result["Value"]:
if "CPUConsumed" == name:
try:
value = int(float(value))
if value > lastCPUTime:
lastCPUTime = value
except ValueError:
pass
if "WallClockTime" == name:
try:
value = int(float(value))
if value > lastWallTime:
lastWallTime = value
except ValueError:
pass
if heartBeatTime > lastHeartBeatTime:
lastHeartBeatTime = heartBeatTime
return lastCPUTime, lastWallTime, lastHeartBeatTime
def __checkLoggingInfo(self, jobID, jobDict):
""" Get info from JobLogging
"""
logList = []
result = self.logDB.getJobLoggingInfo(jobID)
if result["OK"]:
logList = result["Value"]
startTime = jobDict["StartExecTime"]
if not startTime or startTime == "None":
# status, minor, app, stime, source
for items in logList:
if items[0] == "Running":
startTime = items[3]
break
if not startTime or startTime == "None":
startTime = jobDict["SubmissionTime"]
if type(startTime) in types.StringTypes:
startTime = fromString(startTime)
if startTime == None:
self.log.error("Wrong timestamp in DB", items[3])
startTime = dateTime()
endTime = dateTime()
# status, minor, app, stime, source
for items in logList:
if items[0] == "Stalled":
endTime = fromString(items[3])
if endTime == None:
self.log.error("Wrong timestamp in DB", items[3])
endTime = dateTime()
return startTime, endTime
def __kickStuckJobs(self):
""" Reschedule jobs stuck in initialization status Rescheduled, Matched