aboutsummaryrefslogtreecommitdiffstats
path: root/sonar-batch
diff options
context:
space:
mode:
authorSimon Brandhof <simon.brandhof@gmail.com>2013-02-14 18:44:34 +0100
committerSimon Brandhof <simon.brandhof@gmail.com>2013-02-14 18:47:34 +0100
commitf46c76cb0a4d1bac991a8568c754e6fe7a6bd3ca (patch)
treeeb3f7a63a24b97e8bb62e3d7613ca107ca3283a3 /sonar-batch
parent2151dc3d68f5d1eefa4bbbf5dc27a04a5df8dc81 (diff)
downloadsonarqube-f46c76cb0a4d1bac991a8568c754e6fe7a6bd3ca.tar.gz
sonarqube-f46c76cb0a4d1bac991a8568c754e6fe7a6bd3ca.zip
SONAR-3317 improve memory usage in export of dry run db
Diffstat (limited to 'sonar-batch')
-rw-r--r--sonar-batch/src/main/java/org/sonar/batch/bootstrap/DryRunDatabase.java4
1 files changed, 4 insertions, 0 deletions
diff --git a/sonar-batch/src/main/java/org/sonar/batch/bootstrap/DryRunDatabase.java b/sonar-batch/src/main/java/org/sonar/batch/bootstrap/DryRunDatabase.java
index 837e60d0731..a1ae25d3b6d 100644
--- a/sonar-batch/src/main/java/org/sonar/batch/bootstrap/DryRunDatabase.java
+++ b/sonar-batch/src/main/java/org/sonar/batch/bootstrap/DryRunDatabase.java
@@ -20,6 +20,7 @@
package org.sonar.batch.bootstrap;
import com.google.common.base.Throwables;
+import org.apache.commons.io.FileUtils;
import org.apache.commons.lang.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -74,6 +75,9 @@ public class DryRunDatabase implements BatchComponent {
private void downloadDatabase(String projectKey, File toFile) {
try {
server.download("/batch_bootstrap/db?project=" + projectKey, toFile);
+ if (LOG.isDebugEnabled()) {
+ LOG.debug("Dry Run database size: {}", FileUtils.byteCountToDisplaySize(FileUtils.sizeOf(toFile)));
+ }
} catch (SonarException e) {
Throwable rootCause = Throwables.getRootCause(e);
if ((rootCause instanceof HttpException) && (((HttpException) rootCause).getResponseCode() == 401)) {