Browse files

Use metric to compile all unresponsive times into one value (useful f…

…or determining regression)
  • Loading branch information...
1 parent 36b63f2 commit 0a95aac639d38cd80c03ade0aa84cc55facd8a65 @ahal ahal committed Nov 22, 2011
Showing with 15 additions and 8 deletions.
  1. +9 −6 peptest/pepprocess.py
  2. +5 −1 peptest/pepresults.py
  3. +1 −1 peptest/runpeptests.py
View
15 peptest/pepprocess.py
@@ -72,8 +72,10 @@ def processOutputLine(self, line):
elif tokens[1] == 'TEST-END':
if len(results.fails[results.currentTest]) == 0:
self.logger.testPass(results.currentTest)
- self.logger.testEnd(results.currentTest +
- ' | finished in: ' + tokens[3].rstrip() + ' ms')
+ self.logger.testEnd(
+ results.currentTest +
+ ' | finished in: ' + tokens[3].rstrip() + ' ms' +
+ ' | metric: ' + results.get_metric(results.currentTest))
results.currentTest = None
elif tokens[1] == 'ACTION-START':
results.currentAction = tokens[3].rstrip()
@@ -85,11 +87,12 @@ def processOutputLine(self, line):
line = line[len('PEP ' + tokens[1])+1:]
getattr(self.logger, tokens[1].lower())(line.rstrip())
if tokens[1] == 'ERROR':
- results.fails[str(results.currentTest)].append("fail")
+ results.fails[str(results.currentTest)].append(0)
else:
line = line[len('PEP'):]
self.logger.debug(line.rstrip())
elif tokens[0] == 'MOZ_EVENT_TRACE' and results.currentAction is not None:
- self.logger.testFail(results.currentTest + ' | ' + results.currentAction +
- ' | unresponsive time: ' + tokens[3].rstrip() + ' ms')
- results.fails[results.currentTest].append(tokens[3].rstrip())
+ self.logger.testFail(
+ results.currentTest + ' | ' + results.currentAction +
+ ' | unresponsive time: ' + tokens[3].rstrip() + ' ms')
+ results.fails[results.currentTest].append(int(tokens[3].rstrip()))
View
6 peptest/pepresults.py
@@ -53,8 +53,12 @@ def __init__(self):
self.currentAction = None
self.fails = {}
- def hasFails(self):
+ def has_fails(self):
for k, v in self.fails.iteritems():
if len(v) > 0:
return True
return False
+
+ def get_metric(self, test):
+ s = sum([x*x / 1000.0 for x in self.fails[test]])
+ return str(s)
View
2 peptest/runpeptests.py
@@ -129,7 +129,7 @@ def start(self):
crashed = self.checkForCrashes(results.currentTest)
self.stop()
- if crashed or results.hasFails():
+ if crashed or results.has_fails():
return 1
return 0

0 comments on commit 0a95aac

Please sign in to comment.