Search in sources :

Example 6 with StopWatch

use of com.intellij.vcs.log.util.StopWatch in project intellij-community by JetBrains.

the class VcsLogData method initialize.

public void initialize() {
    final StopWatch initSw = StopWatch.start("initialize");
    myDataLoaderQueue.clear();
    runInBackground(indicator -> {
        resetState();
        readCurrentUser();
        DataPack dataPack = myRefresher.readFirstBlock();
        fireDataPackChangeEvent(dataPack);
        initSw.report();
    });
}
Also used : StopWatch(com.intellij.vcs.log.util.StopWatch)

Example 7 with StopWatch

use of com.intellij.vcs.log.util.StopWatch in project intellij-community by JetBrains.

the class VcsLogData method readCurrentUser.

private void readCurrentUser() {
    StopWatch sw = StopWatch.start("readCurrentUser");
    for (Map.Entry<VirtualFile, VcsLogProvider> entry : myLogProviders.entrySet()) {
        VirtualFile root = entry.getKey();
        try {
            VcsUser me = entry.getValue().getCurrentUser(root);
            if (me != null) {
                myCurrentUser.put(root, me);
            } else {
                LOG.info("Username not configured for root " + root);
            }
        } catch (VcsException e) {
            LOG.warn("Couldn't read the username from root " + root, e);
        }
    }
    sw.report();
}
Also used : VirtualFile(com.intellij.openapi.vfs.VirtualFile) VcsException(com.intellij.openapi.vcs.VcsException) Map(java.util.Map) StopWatch(com.intellij.vcs.log.util.StopWatch)

Example 8 with StopWatch

use of com.intellij.vcs.log.util.StopWatch in project intellij-community by JetBrains.

the class VcsLogRefresherImpl method loadRecentData.

@NotNull
private LogInfo loadRecentData(@NotNull final Map<VirtualFile, VcsLogProvider.Requirements> requirements) throws VcsException {
    final StopWatch sw = StopWatch.start("loading commits");
    final LogInfo logInfo = new LogInfo(myStorage);
    new ProviderIterator() {

        @Override
        public void each(@NotNull VirtualFile root, @NotNull VcsLogProvider provider) throws VcsException {
            VcsLogProvider.DetailedLogData data = provider.readFirstBlock(root, requirements.get(root));
            logInfo.put(root, compactCommits(data.getCommits(), root));
            logInfo.put(root, data.getRefs());
            storeUsersAndDetails(data.getCommits());
            sw.rootCompleted(root);
        }
    }.iterate(getProvidersForRoots(requirements.keySet()));
    myUserRegistry.flush();
    myIndex.scheduleIndex(false);
    sw.report();
    return logInfo;
}
Also used : VirtualFile(com.intellij.openapi.vfs.VirtualFile) VcsException(com.intellij.openapi.vcs.VcsException) StopWatch(com.intellij.vcs.log.util.StopWatch) NotNull(org.jetbrains.annotations.NotNull)

Example 9 with StopWatch

use of com.intellij.vcs.log.util.StopWatch in project intellij-community by JetBrains.

the class VcsLogRefresherImpl method multiRepoJoin.

@NotNull
private static <T extends GraphCommit<Integer>> List<T> multiRepoJoin(@NotNull Collection<List<T>> commits) {
    StopWatch sw = StopWatch.start("multi-repo join");
    List<T> joined = new VcsLogMultiRepoJoiner<Integer, T>().join(commits);
    sw.report();
    return joined;
}
Also used : StopWatch(com.intellij.vcs.log.util.StopWatch) NotNull(org.jetbrains.annotations.NotNull)

Example 10 with StopWatch

use of com.intellij.vcs.log.util.StopWatch in project intellij-community by JetBrains.

the class GitLogProvider method readCurrentTagNames.

@NotNull
private Set<String> readCurrentTagNames(@NotNull VirtualFile root) throws VcsException {
    StopWatch sw = StopWatch.start("reading tags in " + root.getName());
    Set<String> tags = newHashSet();
    GitTag.listAsStrings(myProject, root, tags, null);
    sw.report();
    return tags;
}
Also used : StopWatch(com.intellij.vcs.log.util.StopWatch) NotNull(org.jetbrains.annotations.NotNull)

Aggregations

StopWatch (com.intellij.vcs.log.util.StopWatch)12 NotNull (org.jetbrains.annotations.NotNull)8 VirtualFile (com.intellij.openapi.vfs.VirtualFile)3 VcsException (com.intellij.openapi.vcs.VcsException)2 OpenTHashSet (com.intellij.util.containers.OpenTHashSet)2 Attachment (com.intellij.openapi.diagnostic.Attachment)1 Hash (com.intellij.vcs.log.Hash)1 GraphColorManagerImpl (com.intellij.vcs.log.graph.GraphColorManagerImpl)1 GraphCommit (com.intellij.vcs.log.graph.GraphCommit)1 LogDataImpl (com.intellij.vcs.log.impl.LogDataImpl)1 GitBranchesCollection (git4idea.branch.GitBranchesCollection)1 GitRepository (git4idea.repo.GitRepository)1 THashSet (gnu.trove.THashSet)1 Map (java.util.Map)1