tools/binary_size/diagnose_bloat.py
def GenerateHtmlReport(self, before_id, after_id, is_internal=False):
    """Generate HTML report given two build archives."""
    before = self.build_archives[before_id]
    after = self.build_archives[after_id]
    diff_path = self._DiffDir(before, after)
    if not self._CanDiff(before, after):
      logging.info(
          'Skipping HTML report for %s due to missing build archives.',
          diff_path)
      return

    supersize_path = os.path.join(_BINARY_SIZE_DIR, 'supersize')
    report_path = os.path.join(diff_path, 'diff.sizediff')

    supersize_cmd = [
        supersize_path, 'save_diff', before.archived_size_path,
        after.archived_size_path, report_path
    ]

    logging.info('Creating .sizediff')
    _RunCmd(supersize_cmd)
    oneoffs_dir = 'oneoffs'
    visibility = '-a public-read '
    if is_internal:
      oneoffs_dir = 'private-oneoffs'
      visibility = ''

    unique_name = '{}_{}.sizediff'.format(before.rev, after.rev)
    msg = (
        '\n=====================\n'
        'Saved locally to {local}. To view, upload to '
        'https://chrome-supersize.firebaseapp.com/viewer.html.\n'
        'To share, run:\n'
        '> gsutil.py cp {visibility}{local} '
        'gs://chrome-supersize/{oneoffs_dir}/{unique_name}\n\n'
        'Then view it at https://chrome-supersize.firebaseapp.com/viewer.html'
        '?load_url=https://storage.googleapis.com/chrome-supersize/'
        '{oneoffs_dir}/{unique_name}'
        '\n=====================\n')
    msg = msg.format(local=os.path.relpath(report_path),
                     unique_name=unique_name,
                     visibility=visibility,
                     oneoffs_dir=oneoffs_dir)
    logging.info(msg)
Generate HTML report given two build archives.
Generate HTML report given two build archives.
Generate HTML report given two build archives .
def GenerateHtmlReport(self, before_id, after_id, is_internal=False):
    before = self.build_archives[before_id]
    after = self.build_archives[after_id]
    diff_path = self._DiffDir(before, after)
    if not self._CanDiff(before, after):
      logging.info(
          'Skipping HTML report for %s due to missing build archives.',
          diff_path)
      return
    supersize_path = os.path.join(_BINARY_SIZE_DIR, 'supersize')
    report_path = os.path.join(diff_path, 'diff.sizediff')
    supersize_cmd = [
        supersize_path, 'save_diff', before.archived_size_path,
        after.archived_size_path, report_path
    ]
    logging.info('Creating .sizediff')
    _RunCmd(supersize_cmd)
    oneoffs_dir = 'oneoffs'
    visibility = '-a public-read '
    if is_internal:
      oneoffs_dir = 'private-oneoffs'
      visibility = ''
    unique_name = '{}_{}.sizediff'.format(before.rev, after.rev)
    msg = (
        '\n=====================\n'
        'Saved locally to {local}. To view, upload to '
        'https://chrome-supersize.firebaseapp.com/viewer.html.\n'
        'To share, run:\n'
        '> gsutil.py cp {visibility}{local} '
        'gs://chrome-supersize/{oneoffs_dir}/{unique_name}\n\n'
        'Then view it at https://chrome-supersize.firebaseapp.com/viewer.html'
        '?load_url=https://storage.googleapis.com/chrome-supersize/'
        '{oneoffs_dir}/{unique_name}'
        '\n=====================\n')
    msg = msg.format(local=os.path.relpath(report_path),
                     unique_name=unique_name,
                     visibility=visibility,
                     oneoffs_dir=oneoffs_dir)
    logging.info(msg)
def GenerateHtmlReport ( self , before_id , after_id , is_internal = False ) : before = self . build_archives [ before_id ] after = self . build_archives [ after_id ] diff_path = self . _DiffDir ( before , after ) if not self . _CanDiff ( before , after ) : logging . info ( 'Skipping HTML report for %s due to missing build archives.' , diff_path ) return supersize_path = os . path . join ( _BINARY_SIZE_DIR , 'supersize' ) report_path = os . path . join ( diff_path , 'diff.sizediff' ) supersize_cmd = [ supersize_path , 'save_diff' , before . archived_size_path , after . archived_size_path , report_path ] logging . info ( 'Creating .sizediff' ) _RunCmd ( supersize_cmd ) oneoffs_dir = 'oneoffs' visibility = '-a public-read ' if is_internal : oneoffs_dir = 'private-oneoffs' visibility = '' unique_name = '{}_{}.sizediff' . format ( before . rev , after . rev ) msg = ( '\n=====================\n' 'Saved locally to {local}. To view, upload to ' 'https://chrome-supersize.firebaseapp.com/viewer.html.\n' 'To share, run:\n' '> gsutil.py cp {visibility}{local} ' 'gs://chrome-supersize/{oneoffs_dir}/{unique_name}\n\n' 'Then view it at https://chrome-supersize.firebaseapp.com/viewer.html' '?load_url=https://storage.googleapis.com/chrome-supersize/' '{oneoffs_dir}/{unique_name}' '\n=====================\n' ) msg = msg . format ( local = os . path . relpath ( report_path ) , unique_name = unique_name , visibility = visibility , oneoffs_dir = oneoffs_dir ) logging . info ( msg )
Generate HTML report given two build archives.
Generate HTML report given two build archives .
"""Generate HTML report given two build archives."""
self
before_id
after_id
is_internal