commit | 4c3eca2e9c88daaad98f3eeb6593361e1edadf15 | [log] [tgz] |
---|---|---|
author | Jacek Centkowski <geminica.programs@gmail.com> | Wed Jul 02 07:45:38 2025 +0200 |
committer | Jacek Centkowski <geminica.programs@gmail.com> | Thu Jul 03 07:09:01 2025 +0200 |
tree | 68798b16dac42d808360716a1b0da940f132173d | |
parent | a55869f1dc747078fc21344c14817c466a4e35fb [diff] |
Introduce the `*metricscollectiontime` meta metrics The git repo metrics plugin, in order to spare system's resources, typically collects metrics periodically and then serves them from cache. Each group of metrics (git, fs, refs) is collected independently and also requires different amount of time for collection. The change introduces `[git|fs|refs]metricscollectiontime` meta metrics (in millis) to indicate when was the last time that particular group of metrics was collected. Note that metrics are populated upon successful collection. Bug: Issue 427093248 Change-Id: I4b22920bfcdaeb55259842261a0cf8cab7601aa8
This plugin allows a systematic collection of repository metrics. It‘s primary use-case is with Gerrit, however it’s possible for it to work with multiple Git SCM systems, including bare Git repositories.
Metrics are updated either upon a ref-update
receive or on a time based refresh interval. ref-update
events are received only on primary nodes, so on replicas gracePeriod
will need to be set.
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://gerrit.googlesource.com/gerrit git clone https://gerrit.googlesource.com/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.
This plugin can also work with Git repositories hosted by other Git based SCM tools, however the metrics are still expose via Gerrit, so a dedicated Gerrit instance running alongside the current SCM tool is still required. So to make this plugin work with other Git SCM tools, a Gerrit installation needs to be set-up and the basePath
needs to be set to the git data directory of the tool of choice. You will also need to set gracePeriod
and forceCollection
, as when using a different SCM tool than Gerrit the usual hooks aren't triggered. Finally, a configuration option will need to be specified to indicate which Backend is being used. Currently supported backend, other than GERRIT are:
Find more in the configuration section below.
More information about the plugin configuration can be found in the config.md file.