From 3ce134955c31a66982306874e42862d017a997cf Mon Sep 17 00:00:00 2001 From: Anthony Geay Date: Sun, 28 Jan 2024 21:14:54 +0100 Subject: [PATCH] [EDF29150] : WIP --- src/Container/SALOME_ContainerHelper.py | 95 ++++++++++++++++++++++++- 1 file changed, 92 insertions(+), 3 deletions(-) diff --git a/src/Container/SALOME_ContainerHelper.py b/src/Container/SALOME_ContainerHelper.py index eb8490c5d..340746fd2 100644 --- a/src/Container/SALOME_ContainerHelper.py +++ b/src/Container/SALOME_ContainerHelper.py @@ -230,7 +230,7 @@ class ScriptExecInfo: def __str__(self): CPUMemDuringExecForStr = self.CPUMemDuringExecStr - if len > 30: + if len( CPUMemDuringExecForStr ) > 30: CPUMemDuringExecForStr = "{} ...".format( str(CPUMemDuringExecForStr) ) else: CPUMemDuringExecForStr = str( CPUMemDuringExecForStr ) @@ -267,6 +267,74 @@ class ScriptExecInfoDeco: with open(self.father.father.logfile,"rb") as f: cont = f.read() return cont[self._eff.tracePosStart:self._eff.tracePosStop].decode() + @property + def nodeName(self): + return self.father.get().nodeName + @property + def code(self): + return self.father.code + @property + def ns_entry(self): + return self.father.father.ns_entry + @property + def computingNode(self): + return self.father.computingNode + + @property + def freestyle(self): + return self.get().freestyle + + @property + def measureTimeResolution(self): + return self.get().measureTimeResolution + + @property + def CPUMemDuringExec(self): + return self.get().CPUMemDuringExec + + @property + def inputMem(self): + return self.get().inputMem + + @property + def outputMem(self): + return self.get().outputMem + + @property + def inputHDDMem(self): + return self.get().inputHDDMem + + @property + def outputHDDMem(self): + return self.get().outputHDDMem + + @property + def startInputTime(self): + return self.get().startInputTime + + @property + def endInputTime(self): + return self.get().endInputTime + + @property + def startExecTime(self): + return self.get().startExecTime + + @property + def endExecTime(self): + return self.get().endExecTime + + @property + def execTime(self): + return self.get().execTime + + @property + def startOutputTime(self): + return self.get().startOutputTime + + @property + def endOutputTime(self): + return self.get().endOutputTime class ScriptInfoAbstract: def __init__(self, scriptPtr): @@ -323,6 +391,18 @@ class ScriptInfoDeco: return self._father def get(self): return self._eff + @property + def nodeName(self): + return self.get().nodeName + @property + def code(self): + return self.get().code + @property + def ns_entry(self): + return self.father.ns_entry + @property + def computingNode(self): + return self.father.computingNode def __getitem__(self,i): return ScriptExecInfoDeco( self._eff[i], self ) def __len__(self): @@ -333,7 +413,8 @@ class ScriptInfoDeco: return self._eff.__repr__() class ContainerLogInfoAbstract: - + + @property def log(self): with open(self.logfile,"rb") as f: cont = f.read() @@ -347,6 +428,10 @@ class ContainerLogInfoAbstract: def logfile(self): return self._log_file + @property + def computingNode(self): + return ContainerLogInfoAbstract.ComputingNodeFromNSEntry( self.ns_entry ) + def __len__(self): return len( self._scripts ) @@ -354,7 +439,11 @@ class ContainerLogInfoAbstract: return ScriptInfoDeco( self._scripts[i], self) def __str__(self): - return """NS entry = {self.ns_entry} LogFile = {self.logfile}""".format(**locals()) + return """NS entry = {self.ns_entry} LogFile = {self.logfile}""".format(**locals()) + + @classmethod + def ComputingNodeFromNSEntry(cls, nsEntry): + return nsEntry.split("/")[2] class ContainerLogInfoClt(ContainerLogInfoAbstract): def __init__(self,contLogPtr): -- 2.39.2