Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
Classes | Functions | Variables
webpages_playback Namespace Reference

Classes

class  DataStore
 
class  GoogleStorageDataStore
 
class  InvalidSKPException
 
class  LocalFileSystemDataStore
 
class  SkPicturePlayback
 

Functions

 remove_prefix (s, prefix)
 

Variables

str ROOT_PLAYBACK_DIR_NAME = 'playback'
 
str SKPICTURES_DIR_NAME = 'skps'
 
str GS_PREFIX = 'gs://'
 
str PARTNERS_GS_BUCKET = 'gs://chrome-partner-telemetry'
 
 LOCAL_REPLAY_WEBPAGES_ARCHIVE_DIR
 
 TMP_SKP_DIR = tempfile.mkdtemp()
 
 CREDENTIALS_FILE_PATH
 
str SKP_BENCHMARK = 'skpicture_printer'
 
int MAX_SKP_BASE_NAME_LEN = 31
 
dict DEVICE_TO_PLATFORM_PREFIX
 
int RETRY_RECORD_WPR_COUNT = 5
 
int RETRY_RUN_MEASUREMENT_COUNT = 3
 
str CREDENTIALS_GS_PATH = 'playback/credentials/credentials.json'
 
 X11_DISPLAY = os.getenv('DISPLAY', ':0')
 
 CHROMIUM_PAGE_SETS_PATH = os.path.join('tools', 'perf', 'page_sets')
 
dict CHROMIUM_PAGE_SETS_TO_PREFIX
 
dict PAGE_SETS_TO_EXCLUSIONS
 
 option_parser = optparse.OptionParser()
 
 help
 
 default
 
 action
 
 options
 
 unused_args
 
 playback = SkPicturePlayback(options)
 

Detailed Description

Archives or replays webpages and creates SKPs in a Google Storage location.

To archive webpages and store SKP files (archives should be rarely updated):

cd skia
python tools/skp/webpages_playback.py --data_store=gs://your-bucket-name \
--record --page_sets=all --skia_tools=/home/default/trunk/out/Debug/ \
--browser_executable=/tmp/chromium/out/Release/chrome

The above command uses Google Storage bucket 'your-bucket-name' to download
needed files.

To replay archived webpages and re-generate SKP files (should be run whenever
SkPicture.PICTURE_VERSION changes):

cd skia
python tools/skp/webpages_playback.py --data_store=gs://your-bucket-name \
--page_sets=all --skia_tools=/home/default/trunk/out/Debug/ \
--browser_executable=/tmp/chromium/out/Release/chrome


Specify the --page_sets flag (default value is 'all') to pick a list of which
webpages should be archived and/or replayed. Eg:

--page_sets=tools/skp/page_sets/skia_yahooanswers_desktop.py,\
tools/skp/page_sets/skia_googlecalendar_nexus10.py

The --browser_executable flag should point to the browser binary you want to use
to capture archives and/or capture SKP files. Majority of the time it should be
a newly built chrome binary.

The --data_store flag controls where the needed artifacts are downloaded from.
It also controls where the generated artifacts, such as recorded webpages and
resulting skp renderings, are uploaded to. URLs with scheme 'gs://' use Google
Storage. Otherwise use local filesystem.

The --upload=True flag means generated artifacts will be
uploaded or copied to the location specified by --data_store. (default value is
False if not specified).

The --non-interactive flag controls whether the script will prompt the user
(default value is False if not specified).

The --skia_tools flag if specified will allow this script to run
debugger, render_pictures, and render_pdfs on the captured
SKP(s). The tools are run after all SKPs are succesfully captured to make sure
they can be added to the buildbots with no breakages.

Function Documentation

◆ remove_prefix()

webpages_playback.remove_prefix (   s,
  prefix 
)

Definition at line 132 of file webpages_playback.py.

132def remove_prefix(s, prefix):
133 if s.startswith(prefix):
134 return s[len(prefix):]
135 return s
136
137

Variable Documentation

◆ action

webpages_playback.action

Definition at line 563 of file webpages_playback.py.

◆ CHROMIUM_PAGE_SETS_PATH

webpages_playback.CHROMIUM_PAGE_SETS_PATH = os.path.join('tools', 'perf', 'page_sets')

Definition at line 113 of file webpages_playback.py.

◆ CHROMIUM_PAGE_SETS_TO_PREFIX

dict webpages_playback.CHROMIUM_PAGE_SETS_TO_PREFIX
Initial value:
1= {
2}

Definition at line 116 of file webpages_playback.py.

◆ CREDENTIALS_FILE_PATH

webpages_playback.CREDENTIALS_FILE_PATH
Initial value:
1= os.path.join(
2 os.path.abspath(os.path.dirname(__file__)), 'page_sets', 'data',
3 'credentials.json'
4)

Definition at line 84 of file webpages_playback.py.

◆ CREDENTIALS_GS_PATH

str webpages_playback.CREDENTIALS_GS_PATH = 'playback/credentials/credentials.json'

Definition at line 108 of file webpages_playback.py.

◆ default

webpages_playback.default

Definition at line 561 of file webpages_playback.py.

◆ DEVICE_TO_PLATFORM_PREFIX

dict webpages_playback.DEVICE_TO_PLATFORM_PREFIX
Initial value:
1= {
2 'desktop': 'desk',
3 'mobile': 'mobi',
4 'tablet': 'tabl'
5}

Definition at line 96 of file webpages_playback.py.

◆ GS_PREFIX

str webpages_playback.GS_PREFIX = 'gs://'

Definition at line 73 of file webpages_playback.py.

◆ help

webpages_playback.help

Definition at line 560 of file webpages_playback.py.

◆ LOCAL_REPLAY_WEBPAGES_ARCHIVE_DIR

webpages_playback.LOCAL_REPLAY_WEBPAGES_ARCHIVE_DIR
Initial value:
1= os.path.join(
2 os.path.abspath(os.path.dirname(__file__)), 'page_sets', 'data')

Definition at line 78 of file webpages_playback.py.

◆ MAX_SKP_BASE_NAME_LEN

int webpages_playback.MAX_SKP_BASE_NAME_LEN = 31

Definition at line 93 of file webpages_playback.py.

◆ option_parser

webpages_playback.option_parser = optparse.OptionParser()

Definition at line 557 of file webpages_playback.py.

◆ options

webpages_playback.options

Definition at line 622 of file webpages_playback.py.

◆ PAGE_SETS_TO_EXCLUSIONS

dict webpages_playback.PAGE_SETS_TO_EXCLUSIONS
Initial value:
1= {
2 # See skbug.com/7348
3 'key_mobile_sites_smooth.py': '"(digg|worldjournal|twitter|espn)"',
4 # See skbug.com/7421
5 'top_25_smooth.py': '"(mail\.google\.com)"',
6}

Definition at line 119 of file webpages_playback.py.

◆ PARTNERS_GS_BUCKET

str webpages_playback.PARTNERS_GS_BUCKET = 'gs://chrome-partner-telemetry'

Definition at line 75 of file webpages_playback.py.

◆ playback

webpages_playback.playback = SkPicturePlayback(options)

Definition at line 624 of file webpages_playback.py.

◆ RETRY_RECORD_WPR_COUNT

int webpages_playback.RETRY_RECORD_WPR_COUNT = 5

Definition at line 103 of file webpages_playback.py.

◆ RETRY_RUN_MEASUREMENT_COUNT

int webpages_playback.RETRY_RUN_MEASUREMENT_COUNT = 3

Definition at line 105 of file webpages_playback.py.

◆ ROOT_PLAYBACK_DIR_NAME

str webpages_playback.ROOT_PLAYBACK_DIR_NAME = 'playback'

Definition at line 70 of file webpages_playback.py.

◆ SKP_BENCHMARK

str webpages_playback.SKP_BENCHMARK = 'skpicture_printer'

Definition at line 90 of file webpages_playback.py.

◆ SKPICTURES_DIR_NAME

str webpages_playback.SKPICTURES_DIR_NAME = 'skps'

Definition at line 71 of file webpages_playback.py.

◆ TMP_SKP_DIR

webpages_playback.TMP_SKP_DIR = tempfile.mkdtemp()

Definition at line 80 of file webpages_playback.py.

◆ unused_args

webpages_playback.unused_args

Definition at line 622 of file webpages_playback.py.

◆ X11_DISPLAY

webpages_playback.X11_DISPLAY = os.getenv('DISPLAY', ':0')

Definition at line 110 of file webpages_playback.py.