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

trybot_commit_size_checker.py now outputs size improvements

trybot_commit_size_checker.py now specifies if a metric delta is a large
improvment (greater than the limit, in the opposite direction). A
boolean is set on the binary size gerrit plugin json object for each
metric if it is a large improvement. This allows the plugin to showcase
those differently on the CL page.

Bug: 921090
Change-Id: I0b809835289f8af9046d477826abdd7d7d9a7387
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2037958Reviewed-by: default avatarAndrew Grieve <agrieve@chromium.org>
Commit-Queue: Mohamed Heikal <mheikal@chromium.org>
Cr-Commit-Position: refs/heads/master@{#738679}
parent 5e9390e5
......@@ -65,6 +65,9 @@ class _SizeDelta(collections.namedtuple(
def IsAllowable(self):
return self.actual <= self.expected
def IsLargeImprovement(self):
return (self.actual * -1) >= self.expected
def __cmp__(self, other):
return cmp(self.name, other.name)
......@@ -213,6 +216,7 @@ def _GenerateBinarySizePluginDetails(metrics):
'limit': '{} {}'.format(_FormatNumber(delta.expected), delta.units),
'log_name': log_name,
'allowed': delta.IsAllowable(),
'large_improvement': delta.IsLargeImprovement(),
}
if log_name == _RESOURCE_SIZES_LOG:
listing['name'] = 'Android Binary Size'
......
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