Clone this repo:


  1. 28912ae Merge "Replace bazel-genfiles with bazel-bin in" by Edwin Kempin · 8 months ago master
  2. ce585c4 Remove bazel-genfiles from .gitignore by David Pursehouse · 8 months ago
  3. b244068 Replace bazel-genfiles with bazel-bin in by David Pursehouse · 8 months ago
  4. f5b6326 Adapt to changed REST interfaces in Gerrit core by Edwin Kempin · 10 months ago
  5. d607a02 Format with google-java-format 1.7 by Dave Borowitz · 1 year, 2 months ago

Binary Size Plugin for Gerrit

How it works

The plugin queries tryjobs for the current patchset on Gerrit, and gets the binary_sizes property from each of them. It also queries the equivalent CI jobs for the same base revision, and gets the same property from them. It then displays the results in a table, with rows being the files (keys in binary_sizes dict), and the columns being:

Size before | Size after | Size difference (including %) | File | Builder


This plugin is configured via the binary-size.config file present in the repo‘s refs/meta/config ref, as well as the same file in all repositories in the repo’s inheritance chain (up to and including All-Projects).

See an example of binary-size.config:

Also a short snippet below:

    git = ""
    gerrit = ""

[builder "luci.webrtc.try/linux_rel"]
    base = " Release"

[builder "luci.webrtc.try/win_x64_clang_rel"]
    base = " Release (Clang)"

This contains a mapping between tryjob builders and equivalent postsubmit builders. Equivalent in the sense that if they ran with the same code, they would produce the same binary_sizes. The plugin queries builds only from buckets that are mentioned at least once. It is OK to specify builders that don't provide a binary_sizes property, they will just be ignored.

Note that populating the binary_sizes property is a separate responsibility, and it is up to you to implement in your recipes. It needs to be a dict like {"": 123456, ...}. The values of the dict are treated as sizes in bytes.

All changes to binary-size.config files are instantly reflected. There is no caching period or need to restart the server.


This plugin requires the buildbucket plugin in order to search builds. Ensure that they are both installed, or prepare to see errors in the browser's console.


git clone --recursive
cd gerrit/plugins

git clone
cd buildbucket
ln -s src/main/resources/static static  # May be unneeded in the future.
cd ..

git clone
cd binary-size

Run the polygerrit-ui server against live data

Use the script (based on polygerrit-ui/ You may change some paths by setting environment variables, for example:

GERRIT_DIR="$HOME/gerrit" ./


# Install dependencies.
npm install -g bower
npm install -g web-component-tester
cd test/
bower install

# Run the tests from the directory root.
cd ../

Note: Testing is disabled for Safari due to this issue.