use of com.intellij.vcs.log.data.VcsLogData in project intellij-community by JetBrains.
the class VcsLogFileHistoryProviderImpl method canShowFileHistory.
@Override
public boolean canShowFileHistory(@NotNull Project project, @NotNull FilePath path) {
if (!Registry.is("vcs.new.history"))
return false;
VcsRoot rootObject = ProjectLevelVcsManager.getInstance(project).getVcsRootObjectFor(path);
if (rootObject == null)
return false;
VirtualFile root = rootObject.getPath();
AbstractVcs vcs = rootObject.getVcs();
if (vcs == null || root == null)
return false;
VcsLogData dataManager = VcsProjectLog.getInstance(project).getDataManager();
if (dataManager == null || !dataManager.getRoots().contains(root) || dataManager.getIndex().getDataGetter() == null)
return false;
List<VcsLogProvider> allLogProviders = Arrays.asList(Extensions.getExtensions(VcsLogProvider.LOG_PROVIDER_EP, project));
VcsLogProvider provider = ContainerUtil.find(allLogProviders, p -> p.getSupportedVcs().equals(vcs.getKeyInstanceMethod()));
if (provider == null)
return false;
return VcsLogProperties.get(provider, VcsLogProperties.SUPPORTS_INDEXING);
}
use of com.intellij.vcs.log.data.VcsLogData in project intellij-community by JetBrains.
the class VcsLogRepoSizeCollector method getProjectUsages.
@NotNull
@Override
public Set<UsageDescriptor> getProjectUsages(@NotNull Project project) throws CollectUsagesException {
VcsProjectLog projectLog = VcsProjectLog.getInstance(project);
VcsLogData logData = projectLog.getDataManager();
if (logData != null) {
DataPack dataPack = logData.getDataPack();
if (dataPack.isFull()) {
PermanentGraph<Integer> permanentGraph = dataPack.getPermanentGraph();
MultiMap<VcsKey, VirtualFile> groupedRoots = groupRootsByVcs(dataPack.getLogProviders());
Set<UsageDescriptor> usages = ContainerUtil.newHashSet();
usages.add(StatisticsUtilKt.getCountingUsage("data.commit.count", permanentGraph.getAllCommits().size(), asList(0, 1, 100, 1000, 10 * 1000, 100 * 1000, 500 * 1000, 1000 * 1000)));
usages.add(StatisticsUtilKt.getCountingUsage("data.branches.count", dataPack.getRefsModel().getBranches().size(), asList(0, 1, 10, 50, 100, 500, 1000, 5 * 1000, 10 * 1000, 20 * 1000, 50 * 1000)));
usages.add(StatisticsUtilKt.getCountingUsage("data.users.count", logData.getAllUsers().size(), asList(0, 1, 10, 50, 100, 500, 1000, 5 * 1000, 10 * 1000, 20 * 1000, 50 * 1000)));
for (VcsKey vcs : groupedRoots.keySet()) {
usages.add(StatisticsUtilKt.getCountingUsage("data." + vcs.getName().toLowerCase() + ".root.count", groupedRoots.get(vcs).size(), asList(0, 1, 2, 5, 8, 15, 30, 50, 100, 300, 500)));
}
return usages;
}
}
return Collections.emptySet();
}
Aggregations