mirror of
				https://github.com/ARM-software/workload-automation.git
				synced 2025-10-30 22:54:18 +00:00 
			
		
		
		
	vellamo: Fixed geting values from logcat
The previous method of getting results out of logcat does not work if the format of logcat changes.
This commit is contained in:
		| @@ -15,6 +15,9 @@ | ||||
|  | ||||
| import os | ||||
| import logging | ||||
| import json | ||||
| import re | ||||
|  | ||||
| from HTMLParser import HTMLParser | ||||
| from collections import defaultdict, OrderedDict | ||||
| from distutils.version import StrictVersion | ||||
| @@ -146,22 +149,18 @@ class Vellamo(AndroidUiAutoBenchmark): | ||||
|  | ||||
|     def non_root_update_result(self, context): | ||||
|         failed = [] | ||||
|         with open(self.logcat_log) as logcat: | ||||
|             metrics = OrderedDict() | ||||
|             for line in logcat: | ||||
|                 if 'VELLAMO RESULT:' in line: | ||||
|                     info = line.split(':') | ||||
|                     parts = info[2].split(" ") | ||||
|                     metric = parts[1].strip() | ||||
|                     value = int(parts[2].strip()) | ||||
|                     metrics[metric] = value | ||||
|         with open(self.logcat_log) as fh: | ||||
|             iteration_result_regex = re.compile("VELLAMO RESULT: (Browser|Metal|Multicore) (\d+)") | ||||
|             for line in fh: | ||||
|                 if 'VELLAMO ERROR:' in line: | ||||
|                     self.logger.warning("Browser crashed during benchmark, results may not be accurate") | ||||
|             for key, value in metrics.iteritems(): | ||||
|                 key = key.replace(' ', '_') | ||||
|                 context.result.add_metric(key, value) | ||||
|                 if value == 0: | ||||
|                     failed.append(key) | ||||
|                 result = iteration_result_regex.findall(line) | ||||
|                 if result: | ||||
|                     for (metric, score) in result: | ||||
|                         if not score: | ||||
|                             failed.append(metric) | ||||
|                         else: | ||||
|                             context.result.add_metric(metric, score) | ||||
|         if failed: | ||||
|             raise WorkloadError("The following benchmark groups failed: {}".format(", ".join(failed))) | ||||
|  | ||||
|   | ||||
		Reference in New Issue
	
	Block a user