You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by gi...@apache.org on 2013/11/08 08:28:48 UTC
git commit: updated refs/heads/4.2 to ae852ad
Updated Branches:
refs/heads/4.2 b9547b07c -> ae852adab
CLOUDSTACK-4885: basic timing profiler for tests
This will add time taken in seconds along with start and end timestamp
logging facility for test cases.Currently this is not
available for console logs
Signed-off-by: Santhosh Edukulla <Sa...@citrix.com>
Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/ae852ada
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/ae852ada
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/ae852ada
Branch: refs/heads/4.2
Commit: ae852adabb70f43d6d349dd4ab56dc3116e10aed
Parents: b9547b0
Author: Santhosh Edukulla <Sa...@citrix.com>
Authored: Thu Oct 24 00:13:01 2013 +0530
Committer: Girish Shilamkar <gi...@clogeny.com>
Committed: Fri Nov 8 12:58:26 2013 +0530
----------------------------------------------------------------------
tools/marvin/marvin/marvinPlugin.py | 23 +++++++++++++++++++++--
1 file changed, 21 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/ae852ada/tools/marvin/marvin/marvinPlugin.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/marvinPlugin.py b/tools/marvin/marvin/marvinPlugin.py
index aded17c..3b282e4 100644
--- a/tools/marvin/marvin/marvinPlugin.py
+++ b/tools/marvin/marvin/marvinPlugin.py
@@ -22,6 +22,7 @@ import nose.core
from marvin.cloudstackTestCase import cloudstackTestCase
from marvin import deployDataCenter
from nose.plugins.base import Plugin
+import time
class MarvinPlugin(Plugin):
@@ -121,10 +122,28 @@ class MarvinPlugin(Plugin):
self.config = config
def beforeTest(self, test):
- testname = test.__str__().split()[0]
- self.testclient.identifier = '-'.join([self.identifier, testname])
+ self.testName = test.__str__().split()[0]
+ self.testclient.identifier = '-'.join([self.identifier, self.testName])
self.logger.name = test.__str__()
+ def startTest(self, test):
+ """
+ Currently used to record start time for tests
+ """
+ self.startTime = time.time()
+
+ def stopTest(self, test):
+ """
+ Currently used to record end time for tests
+ """
+ endTime = time.time()
+ if self.startTime is not None:
+ totTime = int(endTime - self.startTime)
+ self.logger.debug(
+ "****TestCaseName: %s; Time Taken: %s Seconds; \
+ StartTime: %s; EndTime: %s****"
+ % (self.testName, str(totTime), self.startTime, endTime))
+
def _injectClients(self, test):
self.debug_stream. \
setFormatter(logging.