Merge branch 'stable-2.15' into stable-2.16

* stable-2.15:
  Add .apt_generated to .gitignore

Change-Id: Icdd96889f87155974f48d286ef590f26f698266e
diff --git a/.bazelversion b/.bazelversion
index 9084fa2..227cea2 100644
--- a/.bazelversion
+++ b/.bazelversion
@@ -1 +1 @@
-1.1.0
+2.0.0
diff --git a/WORKSPACE b/WORKSPACE
index 1b0f99b..e23e294 100644
--- a/WORKSPACE
+++ b/WORKSPACE
@@ -3,7 +3,7 @@
 load("//:bazlets.bzl", "load_bazlets")
 
 load_bazlets(
-    commit = "f53f51fb660552d0581aa0ba52c3836ed63d56a3",
+    commit = "577450c73780560972f8a1a92c91410192ff7224",
     #local_path = "/home/<user>/projects/bazlets",
 )
 
diff --git a/external_plugin_deps.bzl b/external_plugin_deps.bzl
index 863d1ab..e41712a 100644
--- a/external_plugin_deps.bzl
+++ b/external_plugin_deps.bzl
@@ -3,8 +3,8 @@
 def external_plugin_deps():
     maven_jar(
         name = "javamelody-core",
-        artifact = "net.bull.javamelody:javamelody-core:1.80.0",
-        sha1 = "9499869f068a1e57efefa392a06b5a7635613359",
+        artifact = "net.bull.javamelody:javamelody-core:1.81.0",
+        sha1 = "0514c4ab7b8f482b29fe5bf1c140508a05012a4f",
     )
 
     maven_jar(
diff --git a/src/main/java/com/googlesource/gerrit/plugins/javamelody/CapabilityChecker.java b/src/main/java/com/googlesource/gerrit/plugins/javamelody/CapabilityChecker.java
index fc7bef2..c8bb48b 100644
--- a/src/main/java/com/googlesource/gerrit/plugins/javamelody/CapabilityChecker.java
+++ b/src/main/java/com/googlesource/gerrit/plugins/javamelody/CapabilityChecker.java
@@ -45,7 +45,7 @@
   public boolean canMonitor() {
     try {
       permissionBackend
-          .user(userProvider)
+          .user(userProvider.get())
           .checkAny(
               ImmutableSet.of(
                   GlobalPermission.ADMINISTRATE_SERVER,
diff --git a/src/main/java/com/googlesource/gerrit/plugins/javamelody/GerritMonitoringFilter.java b/src/main/java/com/googlesource/gerrit/plugins/javamelody/GerritMonitoringFilter.java
index 488fe94..f1b188b 100644
--- a/src/main/java/com/googlesource/gerrit/plugins/javamelody/GerritMonitoringFilter.java
+++ b/src/main/java/com/googlesource/gerrit/plugins/javamelody/GerritMonitoringFilter.java
@@ -15,6 +15,7 @@
 package com.googlesource.gerrit.plugins.javamelody;
 
 import com.google.common.base.Strings;
+import com.google.common.flogger.FluentLogger;
 import com.google.gerrit.extensions.annotations.PluginData;
 import com.google.gerrit.extensions.annotations.PluginName;
 import com.google.gerrit.httpd.AllRequestFilter;
@@ -39,12 +40,10 @@
 import net.bull.javamelody.Parameter;
 import net.bull.javamelody.internal.common.HttpParameter;
 import net.bull.javamelody.internal.common.Parameters;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
 
 @Singleton
 class GerritMonitoringFilter extends AllRequestFilter {
-  private static final Logger log = LoggerFactory.getLogger(GerritMonitoringFilter.class);
+  private static final FluentLogger log = FluentLogger.forEnclosingClass();
   private final JavamelodyFilter monitoring;
 
   @Inject
@@ -165,8 +164,8 @@
       // default to old path for javamelody storage-directory if it exists
       final Path tmp = Paths.get(System.getProperty("java.io.tmpdir")).resolve(JAVAMELODY_PREFIX);
       if (Files.isDirectory(tmp)) {
-        log.warn(
-            "Javamelody data exists in 'tmp' [{}]. Configuration (if any) will be ignored.", tmp);
+        log.atWarning().log(
+            "Javamelody data exists in 'tmp' [%s]. Configuration (if any) will be ignored.", tmp);
         return tmp.toString();
       }
 
@@ -177,7 +176,8 @@
         try {
           Files.createDirectories(storageDir);
         } catch (IOException e) {
-          log.error("Creation of javamelody data dir [{}] failed.", storageDir, e);
+          log.atSevere().withCause(e).log(
+              "Creation of javamelody data dir [%s] failed.", storageDir);
           throw new RuntimeException(e);
         }
       }
diff --git a/src/main/resources/Documentation/about.md b/src/main/resources/Documentation/about.md
index f45afd3..725280d 100644
--- a/src/main/resources/Documentation/about.md
+++ b/src/main/resources/Documentation/about.md
@@ -8,3 +8,8 @@
 or the 'Administrate Server' capability.
 
 It adds top menu item "Monitoring" to access java melody page.
+
+Gerrit's own metrics can be accessed from within Javamelody monitoring page:
+`<gerrit_host_url>/monitoring?part=mbeans`. The pre-requisite for this is
+[JMX metrics plugin](https://gerrit.googlesource.com/plugins/metrics-reporter-jmx)
+that must be also installed.