Default to using plugin data dir for new installations

Change Javamelody to default to using the <site_path>/data/javamelody
path for it's graph data. This makes it persist by default for
environments where /tmp is cleared after each reboot, or for containers
where it is lost on each container restart.

Javamelody defaults to using /tmp/javamelody/<app>_<hostname>. This can
be surprising as all other data from Gerrit is located under the sites
path.

Switch the code to use the same mechanism as the javamelody library to
determine the expected path for the system tmp directory, and should it
locate an existing /tmp/javamelody/ path, use the old path by default.

For all installations, if the user has not set the system property, then
if the old path does not exist, set the default path to
<site_path>/data/javamelody or use what the user has configured via
gerrit.config container.javaOptions value of
-Djavamelody.storage_directory parameter.

This should allow for metric data to be persisted by default through
system/container restarts.

Change-Id: I1ae7013d86cf429f0d15320aafdde18002409e78
1 file changed