def endExecTime(self,value):
self._end_exec_time = value
+ @property
+ def execTime(self):
+ return self.endExecTime - self.startExecTime
+
@property
def startOutputTime(self):
return self._start_output_time
return ScriptExecInfo.GetRepresentationOfTimeDelta(self.endOutputTime,self.startOutputTime)
def __str__(self):
+ CPUMemDuringExecForStr = self.CPUMemDuringExecStr
+ if len > 30:
+ CPUMemDuringExecForStr = "{} ...".format( str(CPUMemDuringExecForStr) )
+ else:
+ CPUMemDuringExecForStr = str( CPUMemDuringExecForStr )
return """start exec time = {self.startExecTime}
end exec time = {self.endExecTime}
exec_time = {self.execTimeStr}
if int(offset) != len(structData):
raise RuntimeError("Something went wrong during unserialization phase.")
return logManagerInst
+
+def ListAllExecContainIn( listOfContainerLogInfo ):
+ """
+ For all ContainerLogInfo contained in listOfContainerLogInfo extract all ScriptExecInfo contained recursively
+ in it.
+
+ Args:
+ -----
+
+ listOfContainerLogInfo (list<ContainerLogInfo>) : instance typically returned by salome.LogManagerLoadFromFile
+
+ Returns
+ -------
+
+ list<ScriptExecInfoDeco> : all ScriptExecInfoDeco instance contained recursively in all input ContainerLogInfo instances
+
+ """
+ return sum( [sum( [[myexec for myexec in ps] for ps in cont],[] ) for cont in listOfContainerLogInfo], [] )
+
+def IsExecTimeHigherThan( execInstDeco, limitDuration ):
+ """
+ Example of Usage :
+
+ [elt for elt in allexecs if IsExecTimeHigherThan(elt,datetime.timedelta(hours=1))]
+
+ Args:
+ -----
+
+ execInstDeco (ScriptExecInfoDeco)
+ limitDuration (datetime.timedelta) Ex (datetime.timedelta(hours=1))
+
+ """
+ if execInstDeco.get() is not None:
+ return execInstDeco.get().execTime > limitDuration
+ else:
+ return False
\ No newline at end of file