From 391208e538a1644e4607299c0ec0a806f9509d39 Mon Sep 17 00:00:00 2001 From: Anthony Geay Date: Fri, 9 Feb 2024 15:09:21 +0100 Subject: [PATCH] [EDF29150] : Ease manipulation of data --- src/Container/SALOME_ContainerHelper.py | 52 +++++++++++++++++++++++++ 1 file changed, 52 insertions(+) diff --git a/src/Container/SALOME_ContainerHelper.py b/src/Container/SALOME_ContainerHelper.py index 9e7e3db1d..e306aff1f 100644 --- a/src/Container/SALOME_ContainerHelper.py +++ b/src/Container/SALOME_ContainerHelper.py @@ -48,6 +48,10 @@ class ScriptExecInfo: remain = m%1024 m//=1024 return "{} {}".format(m,UNITS[3]) + + @classmethod + def SpeedRepr(cls,memInBytePerS): + return "{}/s".format( cls.MemRepr(memInBytePerS) ) def __init__(self): self._measure_time_resolution_ms = None @@ -136,6 +140,30 @@ class ScriptExecInfo: def outputMemStr(self): return ScriptExecInfo.MemRepr( self.outputMem ) + def inputReadHDDSize(self): + return self.inputHDDMem.getSizeOfFileRead() + + def inputReadHDDSizeRepr(self): + return ScriptExecInfo.MemRepr( self.inputReadHDDSize() ) + + def inputReadHDDSpeed(self): + return self.inputReadHDDSize() / ( self.endInputTime - self.startInputTime ).total_seconds() + + def inputReadHDDSpeedRepr(self): + return ScriptExecInfo.SpeedRepr( self.inputReadHDDSpeed() ) + + def outputWriteHDDSize(self): + return self.outputHDDMem.getSizeOfFileRead() + + def outputWriteHDDSizeRepr(self): + return ScriptExecInfo.MemRepr( self.outputWriteHDDSize() ) + + def outputWriteHDDSpeed(self): + return self.outputWriteHDDSize() / ( self.endOutputTime - self.startOutputTime ).total_seconds() + + def outputWriteHDDSpeedRepr(self): + return ScriptExecInfo.SpeedRepr( self.outputWriteHDDSpeed() ) + @property def inputHDDMem(self): return self._input_hdd_mem @@ -313,6 +341,30 @@ class ScriptExecInfoDeco: @property def outputHDDMem(self): return self.get().outputHDDMem + + def inputReadHDDSize(self): + return self.get().inputReadHDDSize() + + def inputReadHDDSizeRepr(self): + return self.get().inputReadHDDSizeRepr() + + def inputReadHDDSpeed(self): + return self.get().inputReadHDDSpeed() + + def inputReadHDDSpeedRepr(self): + return self.get().inputReadHDDSpeedRepr() + + def outputWriteHDDSize(self): + return self.get().outputWriteHDDSize() + + def outputWriteHDDSizeRepr(self): + return self.get().outputWriteHDDSizeRepr() + + def outputWriteHDDSpeed(self): + return self.get().outputWriteHDDSpeed() + + def outputWriteHDDSpeedRepr(self): + return self.get().outputWriteHDDSpeedRepr() @property def startInputTime(self): -- 2.39.2