use of org.sonar.api.utils.log.Profiler in project sonarqube by SonarSource.
the class DefaultServerLineHashesLoader method loadHashesFromWs.
private String loadHashesFromWs(String fileKey) {
Profiler profiler = Profiler.createIfDebug(Loggers.get(getClass())).addContext("file", fileKey).startDebug("Load line hashes");
GetRequest getRequest = new GetRequest("/api/sources/hash?key=" + ScannerUtils.encodeForUrl(fileKey));
Reader reader = wsClient.call(getRequest).contentReader();
try {
return IOUtils.toString(reader);
} catch (IOException e) {
throw new IllegalStateException(e);
} finally {
profiler.stopDebug();
}
}
use of org.sonar.api.utils.log.Profiler in project sonarqube by SonarSource.
the class ServerIssueRepository method load.
public void load() {
Profiler profiler = Profiler.create(LOG).startInfo(LOG_MSG);
this.issuesCache = caches.createCache("previousIssues");
caches.registerValueCoder(ServerIssue.class, new ServerIssueValueCoder());
previousIssuesLoader.load(reactor.getRoot().getKeyWithBranch(), new SaveIssueConsumer());
profiler.stopInfo();
}
use of org.sonar.api.utils.log.Profiler in project sonarqube by SonarSource.
the class ScannerPluginInstaller method loadPlugins.
private Map<String, PluginInfo> loadPlugins(List<RemotePlugin> remotePlugins) {
Map<String, PluginInfo> infosByKey = new HashMap<>(remotePlugins.size());
Profiler profiler = Profiler.create(LOG).startDebug("Load plugins");
for (RemotePlugin remotePlugin : remotePlugins) {
if (pluginPredicate.apply(remotePlugin.getKey())) {
File jarFile = download(remotePlugin);
PluginInfo info = PluginInfo.create(jarFile);
infosByKey.put(info.getKey(), info);
}
}
profiler.stopDebug();
return infosByKey;
}
use of org.sonar.api.utils.log.Profiler in project sonarqube by SonarSource.
the class RulesProvider method load.
private static Rules load(RulesLoader ref) {
Profiler profiler = Profiler.create(LOG).startInfo(LOG_MSG);
List<Rule> loadedRules = ref.load();
RulesBuilder builder = new RulesBuilder();
for (Rule r : loadedRules) {
NewRule newRule = builder.add(RuleKey.of(r.getRepository(), r.getKey()));
newRule.setName(r.getName());
newRule.setInternalKey(r.getInternalKey());
}
profiler.stopInfo();
return builder.build();
}
use of org.sonar.api.utils.log.Profiler in project sonarqube by SonarSource.
the class PrivilegedPluginsBootstraper method onServerStart.
@Override
public void onServerStart(Server server) {
List<PrivilegedPluginBridge> bridges = componentContainer.getComponentsByType(PrivilegedPluginBridge.class);
for (PrivilegedPluginBridge bridge : bridges) {
Profiler profiler = Profiler.create(LOGGER).startInfo(format("Bootstrapping %s", bridge.getPluginName()));
bridge.startPlugin(componentContainer);
profiler.stopInfo();
}
}
Aggregations