Introduce metric for caches that fall back to default config

Cache chroniclemap relies heavily on configuration (especially on
average key and values sizes) so that its performance can be optimal.
What is more starting with `stable-3.4` there are 7 core caches that
are missing their configuration in Defaults and use fall-back
configuration. It is strongly adviced to auto-tune them (see
'tuning.md') and store dedicated configuration in 'gerrit.config'.

Issuing a warning in such case is not a perfect solution as Gerrit core
caches are initiated very early during the server start hence messages
are not always visible in the log. For this reason the following metric
was introduced:

* 'cache/chroniclemap/caches_without_configuration' that could be used
  as an alarm source as it contains the total number of caches that
  miss the dedicated configuration in 'gerrit.config' and use defaults

Notes:
* adding cache configuration to `gerrit.config` is not considered as
  default configuration
* additionally, the 'auto-adjust-caches' command was extended with
  'adjust-caches-on-defaults' option (see the tuning.md for details)
  that it can be used to tune all caches that fall back to defaults

Bug: Issue 15865
Change-Id: I8b0835c6d8a8ae96832371b79afd2a11f69f09b9
11 files changed
tree: fcfd87c220e07253fac0f1b3e6aad10b64f6536b
  1. src/
  2. .gitignore
  3. BUILD
  4. external_plugin_deps.bzl
  5. Jenkinsfile
  6. LICENSE
  7. README.md
README.md

Persistent cache for Gerrit, based on ChronicleMap

Non-blocking and super-fast on-disk cache libModule for Gerrit Code Review based on ChronicleMap on-disk implementation.

How to build

This libModule is built like a Gerrit in-tree plugin, using Bazelisk. See the build instructions for more details.

Setup

  • Install cache-chronicalmap module

Install the chronicle-map module into the $GERRIT_SITE/lib directory.

Add the cache-chroniclemap module to $GERRIT_SITE/etc/gerrit.config as follows:

[gerrit]
  installModule = com.googlesource.gerrit.modules.cache.chroniclemap.ChronicleMapCacheModule

For further information and supported options, refer to config documentation.

Migration from H2 caches

You can check how to migrate from H2 to chronicle-map here.