1
0
mirror of https://github.com/ARM-software/workload-automation.git synced 2025-04-18 08:40:47 +01:00

Simplify metric collection

This commit is contained in:
muendelezaji 2016-05-04 09:34:44 +01:00
parent c65878fee4
commit 1396c5404f
3 changed files with 8 additions and 9 deletions
wlauto/workloads/skypeecho

@ -14,7 +14,6 @@
#
import os
import re
import time
from wlauto import AndroidUiAutoBenchmark, Parameter
@ -106,14 +105,12 @@ class SkypeEcho(AndroidUiAutoBenchmark):
# process results and add them using
# context.result.add_metric
with open(results_file, 'r') as lines:
pattern = r'(?P<key>\w+)\s+(?P<value1>\d+)\s+(?P<value2>\d+)\s+(?P<value3>\d+)'
regex = re.compile(pattern)
for line in lines:
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'))
if line.startswith('timer:'):
res = line.split(' ')
context.result.add_metric(res[1] + '_start', res[2])
context.result.add_metric(res[1] + '_finish', res[3])
context.result.add_metric(res[1] + '_duration', res[4])
def teardown(self, context):
self.logger.info('===== teardown() ======')

@ -73,7 +73,8 @@ public class UiAutomation extends UxPerfUiAutomation {
start = timer.getStart();
finish = timer.getFinish();
duration = timer.getDuration();
out.write(entry.getKey() + " " + start + " " + finish + " " + duration + "\n");
// Format used to parse out results in workload's update_result function
out.write(String.format("timer: %s %d %d %d\n", entry.getKey(), start, finish, duration));
}
out.close();
}
@ -109,6 +110,7 @@ public class UiAutomation extends UxPerfUiAutomation {
// TODO Needs to be run on UI thread after sleep
public void endCall() {
final UiObject endButton = getUiObjectByResourceId(endCallButtonResourceId, "android.widget.ImageView");
final UiObject endButton = getUiObjectByResourceId(endCallButtonResourceId, "com.skype.android.widget.SymbolView");
new Handler(Looper.getMainLooper()).postDelayed(new Runnable() {
@Override
public void run() {