use of org.sonar.api.utils.log.Profiler in project sonarqube by SonarSource.
the class ProjectRepositoriesProvider method provide.
public ProjectRepositories provide(ProjectRepositoriesLoader loader, ProjectKey projectKey, DefaultAnalysisMode mode) {
if (project == null) {
Profiler profiler = Profiler.create(LOG).startInfo(LOG_MSG);
project = loader.load(projectKey.get(), mode.isIssues());
checkProject(mode);
profiler.stopInfo();
}
return project;
}
use of org.sonar.api.utils.log.Profiler in project sonarqube by SonarSource.
the class QualityProfileProvider method provide.
public ModuleQProfiles provide(ProjectKey projectKey, QualityProfileLoader loader, ProjectRepositories projectRepositories, AnalysisProperties props) {
if (this.profiles == null) {
List<QualityProfile> profileList;
Profiler profiler = Profiler.create(LOG).startInfo(LOG_MSG);
if (!projectRepositories.exists()) {
profileList = loader.loadDefault(getSonarProfile(props));
} else {
profileList = loader.load(projectKey.get(), getSonarProfile(props));
}
profiler.stopInfo();
profiles = new ModuleQProfiles(profileList);
}
return profiles;
}
use of org.sonar.api.utils.log.Profiler in project sonarqube by SonarSource.
the class DefaultSettingsLoader method load.
@Override
public Map<String, String> load(@Nullable String componentKey) {
String url = "api/settings/values.protobuf";
Profiler profiler = Profiler.create(LOG);
if (componentKey != null) {
url += "?component=" + ScannerUtils.encodeForUrl(componentKey);
profiler.startInfo("Load settings for component '" + componentKey + "'");
} else {
profiler.startInfo("Load global settings");
}
try (InputStream is = wsClient.call(new GetRequest(url)).contentStream()) {
ValuesWsResponse values = ValuesWsResponse.parseFrom(is);
profiler.stopInfo();
return toMap(values.getSettingsList());
} catch (IOException e) {
throw new IllegalStateException("Failed to load server settings", e);
}
}
use of org.sonar.api.utils.log.Profiler in project sonarqube by SonarSource.
the class ActiveRulesProvider method provide.
public ActiveRules provide(ActiveRulesLoader loader, ModuleQProfiles qProfiles) {
if (singleton == null) {
Profiler profiler = Profiler.create(LOG).startInfo(LOG_MSG);
singleton = load(loader, qProfiles);
profiler.stopInfo();
}
return singleton;
}
Aggregations