]> SALOME platform Git repositories - modules/kernel.git/commitdiff
Salome HOME
[EDF29150] : Ease manipulation of data
authorAnthony Geay <anthony.geay@edf.fr>
Fri, 9 Feb 2024 14:09:21 +0000 (15:09 +0100)
committerAnthony Geay <anthony.geay@edf.fr>
Fri, 9 Feb 2024 14:09:21 +0000 (15:09 +0100)
src/Container/SALOME_ContainerHelper.py

index 9e7e3db1d6a9289d6d2a1b506df3c327246e5222..e306aff1f66f8ff8607a5611b0009e100a1d370f 100644 (file)
@@ -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):