Commit c9c33f05 authored by Mohamed Heikal's avatar Mohamed Heikal Committed by Commit Bot

[Trybot] add limits to trybot_commit_size_checker.py gerrit plugin output

trybot_commit_size_checker.py outputs a json dict to be used by the
gerrit binary size plugin. This cl changes some text as well as adds
what the actual limits are for the metrics being measured so that they
are displayed to the user.

Bug: 921090
Change-Id: Ifbfc7d19e6d3de1d099875f48973fa0520bcd80b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1819970
Auto-Submit: Mohamed Heikal <mheikal@chromium.org>
Commit-Queue: Andrew Grieve <agrieve@chromium.org>
Reviewed-by: default avatarAndrew Grieve <agrieve@chromium.org>
Cr-Commit-Position: refs/heads/master@{#699833}
parent 6ac07da5
......@@ -118,7 +118,7 @@ def _CreateMethodCountDelta(symbols):
lines, net_added = _SymbolDiffHelper(symbols)
details = 'Refer to Dex Method Diff for list of added/removed methods.'
return lines, _SizeDelta('Dex Methods', 'methods',
return lines, _SizeDelta('Dex Methods Count', 'methods',
_MAX_DEX_METHOD_COUNT_INCREASE, net_added, details)
......@@ -158,6 +158,12 @@ def _CreateUncompressedPakSizeDeltas(symbols):
]
def _FormatSign(number):
if number > 0:
return '+{}'.format(number)
return '{}'.format(number)
def main():
parser = argparse.ArgumentParser()
parser.add_argument('--author', required=True, help='CL author')
......@@ -288,7 +294,8 @@ PASSING:
continue
listing = {
'name': delta.name,
'delta': '{} {}'.format(delta.actual, delta.units),
'delta': '{} {}'.format(_FormatSign(delta.actual), delta.units),
'limit': '{} {}'.format(_FormatSign(delta.expected), delta.units),
'allowed': delta.IsAllowable(),
}
binary_size_listings.append(listing)
......
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