-
Notifications
You must be signed in to change notification settings - Fork 120
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Jetstream: Adding a workload to execute the #1102
base: master
Are you sure you want to change the base?
Conversation
wa/workloads/jetstream/__init__.py
Outdated
tests = ['3d-cube-SP', '3d-raytrace-SP', 'acorn-wtb', 'ai-astar', 'Air', 'async-fs', 'Babylon', 'babylon-wtb', | ||
'base64-SP', 'Basic', 'bomb-workers', 'Box2D', 'cdjs', 'chai-wtb', 'coffeescript-wtb', 'crypto', | ||
'crypto-aes-SP', 'crypto-md5-SP', 'crypto-sha1-SP', 'date-format-tofte-SP', 'date-format-xparb-SP', 'delta-blue', | ||
'earley-boyer', 'espree-wtb', 'first-inspector-code-load', 'FlightPlanner', 'float-mm.c', 'gaussian-blur', | ||
'gbemu', 'hash-map', 'jshint-wtb', 'json-parse-inspector', | ||
'json-stringify-inspector', 'lebab-wtb', 'mandreel', 'ML', 'multi-inspector-code-load', 'n-body-SP', | ||
'navier-stokes', 'octane-code-load', 'octane-zlib', 'OfflineAssembler', 'pdfjs', 'prepack-wtb', 'raytrace', | ||
'regex-dna-SP', 'regexp', 'richards', 'segmentation', | ||
'splay', 'stanford-crypto-aes', 'stanford-crypto-pbkdf2', 'stanford-crypto-sha256', 'string-unpack-code-SP', | ||
'tagcloud-SP', 'typescript', 'uglify-js-wtb', 'UniPoker'] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can these be organized a bit more uniformly?
wa/workloads/jetstream/__init__.py
Outdated
context.add_metric(test_name, result, 'score', lower_is_better=False) | ||
else: | ||
raise WorkloadError('score {} cannot be found'.format(regex)) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pylint: W293 blank line contains whitespace
wa/workloads/jetstream/__init__.py
Outdated
self.target.execute("uiautomator dump") | ||
self.target.pull('/sdcard/window_dump.xml', os.path.join(context.output_directory, 'screenDump.xml')) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can an explicit path using target.working_directory
be passed to these commands?
wa/workloads/jetstream/__init__.py
Outdated
self.target.execute("uiautomator dump") | ||
self.target.pull('/sdcard/window_dump.xml', os.path.join(context.output_directory, 'screenDump.xml')) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also out of curiosity have you found this is a more reliable method of extracting the scores rather than performing this from the java side?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We tried originally with the standard way of IDing and logging in the java side but it was constantly missing elements when we looped through it. This method is the most reliable for this workload.
wa/workloads/jetstream/__init__.py
Outdated
from wa.framework.exception import ValidationError, WorkloadError | ||
from wa.utils.types import list_of_strs | ||
from wa.utils.misc import unique |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Except for WorkloadError
are these unused imports?
pressEnter(); | ||
} | ||
|
||
public void clearTabs() throws Exception { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems like it becoming a common function, s it worth adding it as a clearChromeTabs
function to BaseUiAutomation
?
wa/workloads/jetstream/__init__.py
Outdated
|
||
def __init__(self, target, **kwargs): | ||
super(Jetstream, self).__init__(target, **kwargs) | ||
self.gui.timeout = 1500 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On my device this timeout was reached. (took ~33 mins to complete). Can this be raised to be greater then the timeout from the java side?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And can the commit message be updated?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can the commit message title be fixed to fit on a single line?
Pylint fixes: https://travis-ci.org/github/ARM-software/workload-automation/builds/695014614
/*public void clearTabs() throws Exception { | ||
UiObject tabselector = | ||
mDevice.findObject(new UiSelector().resourceId("com.android.chrome:id/tab_switcher_button") | ||
.className("android.widget.ImageButton")); | ||
if (!tabselector.exists()){ | ||
return; | ||
} | ||
tabselector.click(); | ||
UiObject menu = | ||
mDevice.findObject(new UiSelector().resourceId("com.android.chrome:id/menu_button") | ||
.className("android.widget.ImageButton")); | ||
menu.click(); | ||
UiObject closetabs = | ||
mDevice.findObject(new UiSelector().textContains("Close all tabs")); | ||
if (closetabs.exists()){ | ||
closetabs.click(); | ||
} | ||
}*/ | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove commented code.
wa/workloads/jetstream/__init__.py
Outdated
self.target.execute('uiautomator dump') | ||
self.target.pull(os.path.join('/sdcard/window_dump.xml'), os.path.join(context.output_directory, 'screenDump.xml')) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can an explicit path using target.working_directory
be passed to these commands to prevent relying on defaults?
Jetstream is a browser based benchmark. This workload executes the full suite of Jetstream tests and also includes the addition of the clearChromeTabs function to the base ui automation class.
|
UiObject scores = | ||
mDevice.findObject(new UiSelector().resourceId("result-summary")); | ||
scores.waitForExists(2100000); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe allow for the runtime of the benchmark to be configurable as the timeout is still hit on my device.
Also the results screen should be checked for here and raise the appropriate error otherwise the error about a missing score is misleading when the workload just hasn't finished yet.
total_score_match = total_score_regex.search(xml_str) | ||
if total_score_match: | ||
total_score = float(total_score_match.group(1)) | ||
context.add_metric('jetstream', total_score, 'score', lower_is_better=False) | ||
else: | ||
raise WorkloadError('Total score for jetstream could not be found') | ||
for regex in self.regex_tests: | ||
match = regex.search(xml_str) | ||
if match: | ||
result = float(match.group(1)) | ||
test_name = match.group(2) | ||
context.add_metric(test_name, result, 'score', lower_is_better=False) | ||
else: | ||
raise WorkloadError('score {} cannot be found'.format(regex)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This does not need to be within the with
statement.
for test in self.tests: | ||
formatted_string = 'text="([\d.]+)" resource-id="results-cell-({})-score"'.format(test) | ||
self.regex_tests.append(re.compile(formatted_string)) | ||
# Add regex for tests with annoyingly different resource id's | ||
self.regex_tests.append(re.compile(r'text="([\d.]+)" resource-id="wasm-score-id(gcc-loops-wasm)"')) | ||
self.regex_tests.append(re.compile(r'text="([\d.]+)" resource-id="wasm-score-id(HashSet-wasm)"')) | ||
self.regex_tests.append(re.compile(r'text="([\d.]+)" resource-id="wasm-score-id(quicksort-wasm)"')) | ||
self.regex_tests.append(re.compile(r'text="([\d.]+)" resource-id="wasm-score-id(richards-wasm)"')) | ||
self.regex_tests.append(re.compile(r'text="([\d.]+)" resource-id="wasm-score-id(tsf-wasm)"')) | ||
self.regex_tests.append(re.compile(r'text="([\d.]+)" resource-id="(wsl)-score-score"')) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a particular reason for all the tests to be specified explicitly? The workload doesn't seem to be configurable which tests are ran and looking at the code there appears to be 3 unique patterns for matching results so would it not be easier to match on the "generic" patterns?
jetstream suite of browser based tests.