update the benchmark for OMF 6
authorJulien Tribino <julien.tribino@inria.fr>
Thu, 31 Jul 2014 11:46:49 +0000 (13:46 +0200)
committerJulien Tribino <julien.tribino@inria.fr>
Thu, 31 Jul 2014 11:46:49 +0000 (13:46 +0200)
src/nepi/resources/omf/application.py
src/nepi/resources/omf/channel.py
src/nepi/resources/omf/interface.py
src/nepi/resources/omf/node.py

index 55ca910..92e3fd4 100644 (file)
@@ -20,6 +20,7 @@
 
 import os
 
+from nepi.util.timefuncs import tnow
 from nepi.execution.resource import ResourceManager, clsinit_copy, \
         ResourceState, reschedule_delay
 from nepi.execution.attribute import Attribute, Flags 
@@ -97,6 +98,14 @@ class OMFApplication(OMFResource):
         self.release_id = None
         self._release_cnt = 0
 
+        # For performance tests
+        self.begin_deploy_time = None
+        self.begin_start_time = None
+        self.begin_release_time = None
+        self.dperf = True
+        self.sperf = True
+        self.rperf = True
+
         self.add_set_hook()
 
     def _init_command(self):
@@ -175,6 +184,11 @@ class OMFApplication(OMFResource):
             self.ec.schedule(reschedule_delay, self.deploy)
             return
 
+        ## For performance test
+        if self.dperf:
+            self.begin_deploy_time = tnow()
+            self.dperf = False
+
         self._init_command()
 
         self.set('xmppUser',self.node.get('xmppUser'))
@@ -204,6 +218,9 @@ class OMFApplication(OMFResource):
                self.get('xmppPassword'), exp_id = self.exp_id)
 
         if self.get('version') == "5":
+
+            self.begin_deploy_time = tnow()
+
             if self.get('sources'):
                 gateway = ResourceGateway.AMtoGateway[self.get('xmppServer')]
                 user = self.get('sshUser') or self.get('xmppUser')
@@ -256,11 +273,16 @@ class OMFApplication(OMFResource):
          to execute the application. 
 
         """
+        ## For performance test
+        if self.sperf:
+            self.begin_start_time = tnow()
+            self.sperf = False
 
         if not self.get('env'):
             self.set('env', " ")
 
         if self.get('version') == "5":
+            self.begin_start_time = tnow()
             # Some information to check the command for OMF5
             msg = " " + self.get_rtype() + " ( Guid : " + str(self._guid) +") : " + \
                 self.get('appid') + " : " + self._path + " : " + \
@@ -334,6 +356,11 @@ class OMFApplication(OMFResource):
         """ Clean the RM at the end of the experiment and release the API.
 
         """
+        ## For performance test
+        if self.rperf:
+            self.begin_release_time = tnow()
+            self.rperf = False
+
         if self._omf_api:
             if self.get('version') == "6" and self._topic_app:
                 if not self.release_id:
index 3abbc14..7cda160 100644 (file)
@@ -18,6 +18,7 @@
 # Author: Alina Quereilhac <alina.quereilhac@inria.fr>
 #         Julien Tribino <julien.tribino@inria.fr>
 
+from nepi.util.timefuncs import tnow
 from nepi.execution.resource import ResourceManager, clsinit_copy, \
         ResourceState, reschedule_delay
 from nepi.execution.attribute import Attribute, Flags 
@@ -81,6 +82,11 @@ class OMFChannel(OMFResource):
 
         self._omf_api = None
 
+        # For performance tests
+        self.perf = True
+        self.begin_deploy_time = None
+
+
     @property
     def exp_id(self):
         return self.ec.exp_id
@@ -139,6 +145,12 @@ class OMFChannel(OMFResource):
         using OMF 5.4 or 6 protocol to configure the channel.
 
         """   
+
+      ## For performance test
+        if self.perf:
+            self.begin_deploy_time = tnow()
+            self.perf = False
+
         if not self.get('channel'):
             msg = "Channel's value is not initialized"
             self.error(msg)
@@ -149,7 +161,6 @@ class OMFChannel(OMFResource):
             super(OMFChannel, self).do_deploy()
             return
 
-
         if not self.get('xmppServer'):
             msg = "XmppServer is not initialzed. XMPP Connections impossible"
             self.error(msg)
@@ -167,8 +178,6 @@ class OMFChannel(OMFResource):
 
         self._nodes_guid = self._get_target(self._connections)
 
-
-
         if self._nodes_guid == "reschedule" :
             self.ec.schedule("1s", self.deploy)
         else:
index c8c6f87..cd09cc4 100644 (file)
@@ -19,6 +19,7 @@
 #         Julien Tribino <julien.tribino@inria.fr>
 
 import os, time
+from nepi.util.timefuncs import tnow
 from nepi.execution.resource import ResourceManager, clsinit_copy, \
         ResourceState, reschedule_delay
 from nepi.execution.attribute import Attribute, Flags 
@@ -82,6 +83,9 @@ class OMFWifiInterface(OMFResource):
         self._omf_api = None
         self._type = ""
 
+        # For performance tests
+        self.perf = True
+        self.begin_deploy_time = None
 
     def valid_connection(self, guid):
         """ Check if the connection with the guid in parameter is possible. 
@@ -211,6 +215,11 @@ class OMFWifiInterface(OMFResource):
             self.ec.schedule(reschedule_delay, self.deploy)
             return
 
+        ## For performance test
+        if self.perf:
+            self.begin_deploy_time = tnow()
+            self.perf = False
+
         self.set('xmppUser',self.node.get('xmppUser'))
         self.set('xmppServer',self.node.get('xmppServer'))
         self.set('xmppPort',self.node.get('xmppPort'))
index dab9052..74f1775 100644 (file)
@@ -18,6 +18,7 @@
 # Author: Alina Quereilhac <alina.quereilhac@inria.fr>
 #         Julien Tribino <julien.tribino@inria.fr>
 
+from nepi.util.timefuncs import tnow
 from nepi.execution.resource import ResourceManager, clsinit_copy, \
         ResourceState, reschedule_delay
 from nepi.execution.attribute import Attribute, Flags 
@@ -68,6 +69,11 @@ class OMFNode(OMFResource):
 
         self._omf_api = None 
 
+        # For performance tests
+        self.perf = True
+        self.begin_deploy_time = None
+
+
     @property
     def exp_id(self):
         return self.ec.exp_id
@@ -99,6 +105,11 @@ class OMFNode(OMFResource):
             to enroll the node into the experiment.
 
         """ 
+      ## For performance test
+        if self.perf:
+            self.begin_deploy_time = tnow()
+            self.perf = False
+
         if not self.get('xmppServer'):
             msg = "XmppServer is not initialzed. XMPP Connections impossible"
             self.error(msg)