From: Julien Tribino Date: Thu, 31 Jul 2014 11:46:49 +0000 (+0200) Subject: update the benchmark for OMF 6 X-Git-Tag: nepi-3.2.0~75^2~4 X-Git-Url: http://git.onelab.eu/?a=commitdiff_plain;h=6ae37d3b3849c36a7e505e6fb21915e29d1527d3;p=nepi.git update the benchmark for OMF 6 --- diff --git a/src/nepi/resources/omf/application.py b/src/nepi/resources/omf/application.py index 55ca9109..92e3fd40 100644 --- a/src/nepi/resources/omf/application.py +++ b/src/nepi/resources/omf/application.py @@ -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: diff --git a/src/nepi/resources/omf/channel.py b/src/nepi/resources/omf/channel.py index 3abbc14d..7cda160a 100644 --- a/src/nepi/resources/omf/channel.py +++ b/src/nepi/resources/omf/channel.py @@ -18,6 +18,7 @@ # Author: Alina Quereilhac # Julien Tribino +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: diff --git a/src/nepi/resources/omf/interface.py b/src/nepi/resources/omf/interface.py index c8c6f87f..cd09cc4c 100644 --- a/src/nepi/resources/omf/interface.py +++ b/src/nepi/resources/omf/interface.py @@ -19,6 +19,7 @@ # Julien Tribino 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')) diff --git a/src/nepi/resources/omf/node.py b/src/nepi/resources/omf/node.py index dab90528..74f17757 100644 --- a/src/nepi/resources/omf/node.py +++ b/src/nepi/resources/omf/node.py @@ -18,6 +18,7 @@ # Author: Alina Quereilhac # Julien Tribino +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)