Merge branch 'stable-2.16' into stable-3.0

* stable-2.16:
  Error Prone: Enable and fix OperatorPrecedence
  GerritBaseTests: Activate test logging
  Revert "Enable optional DEBUG level logs for query tests"
  Allow to control the Gerrit log level for running tests from system var
  Revert "Acceptance: set log threshold level for tests"
  Reduce log level for tests to INFO
  Bazel: Update time attribute of file entries in plugin artifact
  Add Jetty connection metrics
  Add additional JGit WindowCache metrics
  Update JGit to 5.1.13.202002110435-r
  BucketedCallback: fix prune() to remove unset sub-metrics from registry
  Modify draft ref updates commits to point to an empty parent

CommentsIT: Adapt to the 3.0 version of Gerrit.

Change-Id: I532d092329bdd94a85cccdf2b34dd150944a6699
This commit is contained in:
Marco Miller
2020-02-17 11:04:07 -05:00
27 changed files with 503 additions and 224 deletions

View File

@@ -22,6 +22,7 @@ import com.google.common.collect.Maps;
import com.google.gerrit.metrics.Description;
import com.google.gerrit.metrics.Field;
import java.util.Map;
import java.util.Set;
import java.util.concurrent.ConcurrentHashMap;
/** Abstract callback metric broken down into buckets. */
@@ -66,7 +67,13 @@ abstract class BucketedCallback<V> implements BucketedMetric {
}
void doPrune() {
cells.entrySet().removeIf(objectValueGaugeEntry -> !objectValueGaugeEntry.getValue().set);
Set<Map.Entry<Object, BucketedCallback<V>.ValueGauge>> entries = cells.entrySet();
for (Map.Entry<Object, ValueGauge> e : entries) {
if (!e.getValue().set) {
entries.remove(e);
registry.remove(submetric(e.getKey()));
}
}
}
void doEndSet() {