1
0
mirror of https://github.com/ARM-software/workload-automation.git synced 2025-10-30 06:34:13 +00:00

Fix timing instrumentation logs for Skype and GooglePhotos

Bring both workloads in line with the standard way of regex searching the instrumentation logs.
This commit is contained in:
James Hartley
2016-05-10 18:20:47 +01:00
parent 60c94a79bd
commit cbfcf6eaba
2 changed files with 20 additions and 17 deletions

View File

@@ -74,19 +74,18 @@ class Googlephotos(AndroidUiAutoBenchmark):
def update_result(self, context):
super(Googlephotos, self).update_result(context)
if self.dumpsys_enabled:
self.device.pull_file(self.output_file, context.output_directory)
result_file = os.path.join(context.output_directory, self.instrumentation_log)
self.device.pull_file(self.output_file, context.output_directory)
result_file = os.path.join(context.output_directory, self.instrumentation_log)
with open(result_file, 'r') as wfh:
pattern = r'(?P<key>\w+)\s+(?P<value1>\d+)\s+(?P<value2>\d+)\s+(?P<value3>\d+)'
regex = re.compile(pattern)
for line in wfh:
match = regex.search(line)
if match:
context.result.add_metric((match.group('key') + "_start"), match.group('value1'))
context.result.add_metric((match.group('key') + "_finish"), match.group('value2'))
context.result.add_metric((match.group('key') + "_duration"), match.group('value3'))
with open(result_file, 'r') as wfh:
pattern = r'(?P<key>\w+)\s+(?P<value1>\d+)\s+(?P<value2>\d+)\s+(?P<value3>\d+)'
regex = re.compile(pattern)
for line in wfh:
match = regex.search(line)
if match:
context.result.add_metric((match.group('key') + "_start"), match.group('value1'))
context.result.add_metric((match.group('key') + "_finish"), match.group('value2'))
context.result.add_metric((match.group('key') + "_duration"), match.group('value3'))
def teardown(self, context):
super(Googlephotos, self).teardown(context)