Commit 782243d9 authored by Mohamed Heikal's avatar Mohamed Heikal Committed by Commit Bot

Add oneoff message to diagnose_bloat.py

prints a message in diagnose_bloat.py to help users upload a oneoff for
sharing. Also updates the oneoff message in libsupersize/console.py to
use the new urls for the viewer.

Change-Id: I92d16460826488b4a55a9bb56d9200264ab0b476
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2485772
Commit-Queue: Mohamed Heikal <mheikal@chromium.org>
Reviewed-by: default avatarAndrew Grieve <agrieve@chromium.org>
Cr-Commit-Position: refs/heads/master@{#818879}
parent 79b6e7f4
...@@ -502,9 +502,21 @@ class _DiffArchiveManager(object): ...@@ -502,9 +502,21 @@ class _DiffArchiveManager(object):
logging.info('Creating .sizediff') logging.info('Creating .sizediff')
_RunCmd(supersize_cmd) _RunCmd(supersize_cmd)
logging.info('Report created: %s', os.path.relpath(report_path)) unique_name = '{}_{}.sizediff'.format(before.rev, after.rev)
logging.info('View it here: ' msg = (
'https://chrome-supersize.firebaseapp.com/viewer.html') '\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 -a public-read {local} '
'gs://chrome-supersize/oneoffs/{unique_name}\n\n'
'Then view it at https://chrome-supersize.firebaseapp.com/viewer.html'
'?load_url=https://storage.googleapis.com/chrome-supersize/oneoffs/'
'{unique_name}'
'\n=====================\n')
msg = msg.format(local=os.path.relpath(report_path),
unique_name=unique_name)
logging.info(msg)
def Summarize(self): def Summarize(self):
path = os.path.join(self.archive_dir, 'last_diff_summary.txt') path = os.path.join(self.archive_dir, 'last_diff_summary.txt')
......
...@@ -166,10 +166,10 @@ class _Session(object): ...@@ -166,10 +166,10 @@ class _Session(object):
shortname = os.path.basename(os.path.normpath(to_file)) shortname = os.path.basename(os.path.normpath(to_file))
msg = ( msg = (
'Saved locally to {local}. To share, run:\n' 'Saved locally to {local}. To share, run:\n'
'> gsutil.py cp {local} gs://chrome-supersize/oneoffs && gsutil.py -m ' '> gsutil.py cp -a public-read {local} gs://chrome-supersize/oneoffs\n'
'acl ch -u AllUsers:R gs://chrome-supersize/oneoffs/{shortname}\n' ' Then view it at https://chrome-supersize.firebaseapp.com/viewer.html'
' Then view it at https://storage.googleapis.com/chrome-supersize' '?load_url=https://storage.googleapis.com/chrome-supersize/oneoffs/'
'/viewer.html?load_url=oneoffs%2F{shortname}') '{shortname}')
print(msg.format(local=to_file, shortname=shortname)) print(msg.format(local=to_file, shortname=shortname))
def _SaveDeltaSizeInfo(self, size_info, to_file=None): def _SaveDeltaSizeInfo(self, size_info, to_file=None):
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment