"release_channel",choices=['nightly','beta','release','debug'],help="the release channel to measure"
)
parser.add_argument(
"startup_type",choices=['cold_main','cold_view'],help="the type of start up to measure. see https://wiki.mozilla.org/Performance/Fenix#Terminology for descriptions of cold/warm/hot and main/view"
"test_name",choices=TESTS,help="the start up test to run; see https://wiki.mozilla.org/Performance/Fenix#Terminology for descriptions of cold/warm/hot and main/view"
)
parser.add_argument("path",help="the path to save the measurement results; will be overwritten")
parser.add_argument("path",help="the path to save the measurement results; will abort if file exists")
assertlen(page_start_lines)==2# One for about:blank & one for target URL.
returnline_to_datetime(page_start_lines[1])# 2nd PageStart is for target URL.
logcat=logcat_bytes.decode('UTF-8')# Easier to work with and must for strptime.
lines=logcat.split('\n')
# We measure the time from process start, rather than the earlier START
# activity line, because I assume we have no control over the duration
# before our process starts. If we wanted to put in more time, we could
# double-check this assumption by seeing what values `am start -W` returns
# compared to the time stamps.
elapsed_seconds=(get_page_start_datetime()-get_proc_start_datetime()).total_seconds()# values < 1s are expressed in decimal.
elapsed_millis=round(elapsed_seconds*1000)
returnelapsed_millis
defsave_measurements(path,measurements):
withopen(path,'w')asf:
formeasurementinmeasurements:
@ -145,11 +207,11 @@ def main():
# Exceptions and script piping like these are why we prefer mozperftest. :)
print("Clear the onboarding experience manually, if it's desired and you haven't already done so.")
print("\nYou can use this script to find the average from the results file: https://github.com/mozilla-mobile/perf-tools/blob/9dd8bf1ea0ea8b2663e21d341a1572c5249c513d/average_times.py")
print("\nYou can use this script to find the average from the results file: https://github.com/mozilla-mobile/perf-tools/blob/master/analyze_durations.py")