diff options
author | Simon Brandhof <simon.brandhof@sonarsource.com> | 2015-01-26 18:07:25 +0100 |
---|---|---|
committer | Simon Brandhof <simon.brandhof@sonarsource.com> | 2015-01-26 18:07:34 +0100 |
commit | 6a34538e5be94079dfa7d22e7f441714080f8893 (patch) | |
tree | 6fb54068ab2822af83e2d2391a94564c9030a7c5 /sonar-batch | |
parent | 705b0ed37aa4243e9df7348ee9dd5fba801231ef (diff) | |
download | sonarqube-6a34538e5be94079dfa7d22e7f441714080f8893.tar.gz sonarqube-6a34538e5be94079dfa7d22e7f441714080f8893.zip |
Add profiling logs to analysis report exchange protocol
Diffstat (limited to 'sonar-batch')
-rw-r--r-- | sonar-batch/src/main/java/org/sonar/batch/report/PublishReportJob.java | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/sonar-batch/src/main/java/org/sonar/batch/report/PublishReportJob.java b/sonar-batch/src/main/java/org/sonar/batch/report/PublishReportJob.java index 22aa61b0d1a..3469f1dd262 100644 --- a/sonar-batch/src/main/java/org/sonar/batch/report/PublishReportJob.java +++ b/sonar-batch/src/main/java/org/sonar/batch/report/PublishReportJob.java @@ -83,15 +83,21 @@ public class PublishReportJob implements BatchComponent { private File prepareReport() { try { + long startTime = System.currentTimeMillis(); File reportDir = temp.newDir("batch-report"); ReportHelper reportHelper = ReportHelper.create(reportDir); for (ReportPublisher publisher : publishers) { publisher.export(reportHelper); } + long stopTime = System.currentTimeMillis(); + LOG.debug("Analysis reports generated in " + (stopTime - startTime) + "ms"); + startTime = System.currentTimeMillis(); File reportZip = temp.newFile("batch-report", ".zip"); ZipUtils.zipDir(reportDir, reportZip); FileUtils.deleteDirectory(reportDir); + stopTime = System.currentTimeMillis(); + LOG.debug("Analysis reports compressed in " + (stopTime - startTime) + "ms, zip size=" + FileUtils.byteCountToDisplaySize(FileUtils.sizeOf(reportZip))); return reportZip; } catch (IOException e) { throw new IllegalStateException("Unable to prepare batch report", e); @@ -101,6 +107,7 @@ public class PublishReportJob implements BatchComponent { @VisibleForTesting void uploadMultiPartReport(File report) { LOG.debug("Publish results"); + long startTime = System.currentTimeMillis(); URL url; try { int snapshotId = resourceCache.get(project.getEffectiveKey()).snapshotId(); @@ -125,6 +132,8 @@ public class PublishReportJob implements BatchComponent { } throw new IllegalStateException(String.format("Fail to execute request [code=%s, url=%s]: %s", responseCode, url, request.body())); } + long stopTime = System.currentTimeMillis(); + LOG.debug("Analysis reports sent to server in " + (stopTime - startTime) + "ms"); } @VisibleForTesting |