use of org.sonar.scanner.util.ProgressReport in project sonarqube by SonarSource.
the class IssueTransition method execute.
public void execute() {
if (localIssueTracking != null) {
localIssueTracking.init();
}
ScannerReportReader reader = new ScannerReportReader(reportPublisher.getReportDir());
int nbComponents = inputComponentStore.all().size();
if (nbComponents == 0) {
return;
}
ProgressReport progressReport = new ProgressReport("issue-tracking-report", TimeUnit.SECONDS.toMillis(10));
progressReport.start("Performing issue tracking");
int count = 0;
try {
for (InputComponent component : inputComponentStore.all()) {
trackIssues(reader, (DefaultInputComponent) component);
count++;
progressReport.message(count + "/" + nbComponents + " components tracked");
}
} finally {
progressReport.stop(count + "/" + nbComponents + " components tracked");
}
}
use of org.sonar.scanner.util.ProgressReport in project sonarqube by SonarSource.
the class FileIndexer method index.
void index(DefaultModuleFileSystem fileSystem) {
int threads = Math.max(1, Runtime.getRuntime().availableProcessors() - 1);
this.executorService = Executors.newFixedThreadPool(threads, new ThreadFactoryBuilder().setNameFormat("FileIndexer-%d").build());
progressReport = new ProgressReport("Report about progress of file indexation", TimeUnit.SECONDS.toMillis(10));
progressReport.start("Index files");
exclusionFilters.prepare();
Progress progress = new Progress();
indexFiles(fileSystem, progress, fileSystem.sources(), InputFile.Type.MAIN);
indexFiles(fileSystem, progress, fileSystem.tests(), InputFile.Type.TEST);
waitForTasksToComplete();
progressReport.stop(progress.count() + " " + pluralizeFiles(progress.count()) + " indexed");
if (exclusionFilters.hasPattern()) {
LOG.info("{} {} ignored because of inclusion/exclusion patterns", progress.excludedByPatternsCount(), pluralizeFiles(progress.excludedByPatternsCount()));
}
}
Aggregations