diff options
author | Sébastien Lesaint <sebastien.lesaint@sonarsource.com> | 2015-12-16 17:37:20 +0100 |
---|---|---|
committer | Sébastien Lesaint <sebastien.lesaint@sonarsource.com> | 2015-12-17 10:44:05 +0100 |
commit | 9c311c559136c62930e6463c525dd735b3ecac16 (patch) | |
tree | 574a82a4ce2662de9ce2abd23096c1a6af69a46d /server/sonar-server-benchmarks/src | |
parent | 212000d472e0c9a818de55cf54f5688d03febf03 (diff) | |
download | sonarqube-9c311c559136c62930e6463c525dd735b3ecac16.tar.gz sonarqube-9c311c559136c62930e6463c525dd735b3ecac16.zip |
SONAR-6990 strongly reduce HEAP usage of the DuplicationRepository
Diffstat (limited to 'server/sonar-server-benchmarks/src')
-rw-r--r-- | server/sonar-server-benchmarks/src/test/java/org/sonar/server/benchmark/PersistFileSourcesStepTest.java | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/server/sonar-server-benchmarks/src/test/java/org/sonar/server/benchmark/PersistFileSourcesStepTest.java b/server/sonar-server-benchmarks/src/test/java/org/sonar/server/benchmark/PersistFileSourcesStepTest.java index 722b99b9238..8cfa29b8274 100644 --- a/server/sonar-server-benchmarks/src/test/java/org/sonar/server/benchmark/PersistFileSourcesStepTest.java +++ b/server/sonar-server-benchmarks/src/test/java/org/sonar/server/benchmark/PersistFileSourcesStepTest.java @@ -23,6 +23,7 @@ package org.sonar.server.benchmark; import java.io.File; import java.io.IOException; import java.util.ArrayList; +import java.util.Arrays; import java.util.List; import org.apache.commons.io.FileUtils; import org.junit.Rule; @@ -43,7 +44,10 @@ import org.sonar.server.computation.batch.BatchReportReaderImpl; import org.sonar.server.computation.batch.TreeRootHolderRule; import org.sonar.server.computation.component.Component; import org.sonar.server.computation.component.ReportComponent; +import org.sonar.server.computation.duplication.Duplicate; +import org.sonar.server.computation.duplication.Duplication; import org.sonar.server.computation.duplication.DuplicationRepositoryRule; +import org.sonar.server.computation.duplication.InnerDuplicate; import org.sonar.server.computation.duplication.TextBlock; import org.sonar.server.computation.scm.ScmInfoRepositoryImpl; import org.sonar.server.computation.source.SourceHashRepositoryImpl; @@ -141,9 +145,13 @@ public class PersistFileSourcesStepTest { LineData lineData = new LineData(); for (int line = 1; line <= NUMBER_OF_LINES; line++) { lineData.generateLineData(line); - - duplicationRepository.addDuplication(fileRef, new TextBlock(line, line), new TextBlock(line + 1, line + 1)); - + duplicationRepository.add( + fileRef, + new Duplication( + new TextBlock(line, line), + Arrays.<Duplicate>asList(new InnerDuplicate(new TextBlock(line + 1, line + 1))) + ) + ); } writer.writeComponent(BatchReport.Component.newBuilder() .setRef(fileRef) |