Set<MetricEvent> (@NotNull Project project) { if (!TrustedProjects.isTrusted(project)) return Collections.emptySet(); VcsProjectLog projectLog = project.getServiceIfCreated(VcsProjectLog.class); if (projectLog == null) return Collections.emptySet(); VcsLogData logData = projectLog.getDataManager(); if (logData != null) { DataPack dataPack = logData.getDataPack(); if (dataPack.isFull()) { int commitCount = dataPack.getPermanentGraph().getAllCommits().size(); int branchesCount = dataPack.getRefsModel().getBranches().size(); int usersCount = logData.getAllUsers().size(); Set<MetricEvent> usages = ContainerUtil.newHashSet(DATA_INITIALIZED.metric()); usages.add(COMMIT_COUNT.metric(StatisticsUtil.roundToPowerOfTwo(commitCount))); usages.add(BRANCHES_COUNT.metric(StatisticsUtil.roundToPowerOfTwo(branchesCount))); usages.add(USERS_COUNT.metric(StatisticsUtil.roundToPowerOfTwo(usersCount))); MultiMap<VcsKey, VirtualFile> groupedRoots = groupRootsByVcs(dataPack.getLogProviders()); for (VcsKey vcs : groupedRoots.keySet()) { int rootCount = groupedRoots.get(vcs).size(); usages.add(ROOT_COUNT.metric(StatisticsUtil.roundToPowerOfTwo(rootCount), getVcsKeySafe(vcs))); } return usages; } } return Collections.emptySet(); }