use of com.intellij.internal.statistic.beans.UsageDescriptor in project intellij-community by JetBrains.
the class SvnWorkingCopyFormatUsagesCollector method getProjectUsages.
@NotNull
public Set<UsageDescriptor> getProjectUsages(@NotNull Project project) {
SvnVcs vcs = SvnVcs.getInstance(project);
// do not track roots with errors (SvnFileUrlMapping.getErrorRoots()) as they are "not usable" until errors are resolved
// skip externals and switched directories as they will have the same format
List<RootUrlInfo> roots = ContainerUtil.filter(vcs.getSvnFileUrlMapping().getAllWcInfos(), info -> info.getType() == null || NestedCopyType.inner.equals(info.getType()));
return ContainerUtil.map2Set(roots, info -> new UsageDescriptor(info.getFormat().toString(), 1));
}
use of com.intellij.internal.statistic.beans.UsageDescriptor 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();
}
use of com.intellij.internal.statistic.beans.UsageDescriptor in project intellij-community by JetBrains.
the class LibraryJarUsagesCollector method getProjectUsages.
@NotNull
@Override
public Set<UsageDescriptor> getProjectUsages(@NotNull final Project project) throws CollectUsagesException {
final LibraryJarDescriptor[] descriptors = LibraryJarStatisticsService.getInstance().getTechnologyDescriptors();
final Set<UsageDescriptor> result = new HashSet<>(descriptors.length);
ApplicationManager.getApplication().runReadAction(() -> {
for (LibraryJarDescriptor descriptor : descriptors) {
String className = descriptor.myClass;
if (className == null)
continue;
PsiClass[] psiClasses = JavaPsiFacade.getInstance(project).findClasses(className, ProjectScope.getLibrariesScope(project));
for (PsiClass psiClass : psiClasses) {
if (psiClass == null)
continue;
VirtualFile jarFile = JarFileSystem.getInstance().getLocalVirtualFileFor(psiClass.getContainingFile().getVirtualFile());
if (jarFile == null)
continue;
String version = getVersionByJarManifest(jarFile);
if (version == null) {
version = getVersionByJarFileName(jarFile.getName());
}
if (version == null || !StringUtil.containsChar(version, '.')) {
continue;
}
result.add(new UsageDescriptor(descriptor.myName + "_" + version, 1));
}
}
});
return result;
}
Aggregations