diff --git a/platform/platform-impl/src/com/intellij/ide/startup/impl/StartupManagerImpl.java b/platform/platform-impl/src/com/intellij/ide/startup/impl/StartupManagerImpl.java index 5fddcc9ce00d..45b5c5e90acb 100644 --- a/platform/platform-impl/src/com/intellij/ide/startup/impl/StartupManagerImpl.java +++ b/platform/platform-impl/src/com/intellij/ide/startup/impl/StartupManagerImpl.java @@ -4,7 +4,7 @@ package com.intellij.ide.startup.impl; import com.intellij.diagnostic.PerformanceWatcher; import com.intellij.ide.startup.ServiceNotReadyException; import com.intellij.ide.startup.StartupManagerEx; -import com.intellij.internal.statistic.collectors.fus.project.FsCaseSensitivityTriggerCollector; +import com.intellij.internal.statistic.collectors.fus.project.ProjectFsStatsCollector; import com.intellij.notification.Notification; import com.intellij.notification.NotificationListener; import com.intellij.notification.NotificationType; @@ -271,7 +271,7 @@ public class StartupManagerImpl extends StartupManagerEx { myProject); } - FsCaseSensitivityTriggerCollector.trigger(myProject, actual); + ProjectFsStatsCollector.caseSensitivity(myProject, actual); } catch (FileNotFoundException e) { LOG.warn(e); @@ -284,7 +284,10 @@ public class StartupManagerImpl extends StartupManagerEx { LocalFileSystem fs = LocalFileSystem.getInstance(); if (!(fs instanceof LocalFileSystemImpl)) return; FileWatcher watcher = ((LocalFileSystemImpl)fs).getFileWatcher(); - if (!watcher.isOperational()) return; + if (!watcher.isOperational()) { + ProjectFsStatsCollector.watchedRoots(myProject, -1); + return; + } PooledThreadExecutor.INSTANCE.submit(() -> { LOG.debug("FW/roots waiting started"); @@ -296,6 +299,7 @@ public class StartupManagerImpl extends StartupManagerEx { LOG.debug("FW/roots waiting finished"); Collection manualWatchRoots = watcher.getManualWatchRoots(); + int pctNonWatched = 0; if (!manualWatchRoots.isEmpty()) { List nonWatched = new SmartList<>(); for (VirtualFile root : roots) { @@ -312,8 +316,11 @@ public class StartupManagerImpl extends StartupManagerEx { watcher.notifyOnFailure(message, null); LOG.info("unwatched roots: " + nonWatched); LOG.info("manual watches: " + manualWatchRoots); + pctNonWatched = (int)(100.0 * nonWatched.size() / roots.length); } } + + ProjectFsStatsCollector.watchedRoots(myProject, pctNonWatched); }); } diff --git a/platform/platform-impl/src/com/intellij/internal/statistic/collectors/fus/project/FsCaseSensitivityTriggerCollector.kt b/platform/platform-impl/src/com/intellij/internal/statistic/collectors/fus/project/FsCaseSensitivityTriggerCollector.kt deleted file mode 100644 index 9bac37111fc5..000000000000 --- a/platform/platform-impl/src/com/intellij/internal/statistic/collectors/fus/project/FsCaseSensitivityTriggerCollector.kt +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright 2000-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. -package com.intellij.internal.statistic.collectors.fus.project - -import com.intellij.internal.statistic.eventLog.FeatureUsageGroup -import com.intellij.internal.statistic.eventLog.FeatureUsageLogger -import com.intellij.internal.statistic.service.fus.collectors.FUSUsageContext -import com.intellij.internal.statistic.utils.createData -import com.intellij.openapi.project.Project - -object FsCaseSensitivityTriggerCollector { - private val groupId = FeatureUsageGroup("statistics.project.root.fs.case", 1) - private val context = FUSUsageContext.create(FUSUsageContext.getOSNameContextData(), systemFsContextData()) - - @JvmStatic - fun trigger(project: Project, sensitivity: Boolean) { - FeatureUsageLogger.log(groupId, sensitivity.encode(), createData(project, context)) - } - - private fun systemFsContextData() = "system:" + (System.getProperty("idea.case.sensitive.fs")?.toBoolean()?.encode() ?: "default") - private fun Boolean.encode() = if (this) "case-sensitive" else "case-insensitive" -} \ No newline at end of file diff --git a/platform/platform-impl/src/com/intellij/internal/statistic/collectors/fus/project/ProjectFsStatsCollector.kt b/platform/platform-impl/src/com/intellij/internal/statistic/collectors/fus/project/ProjectFsStatsCollector.kt new file mode 100644 index 000000000000..3351699f01da --- /dev/null +++ b/platform/platform-impl/src/com/intellij/internal/statistic/collectors/fus/project/ProjectFsStatsCollector.kt @@ -0,0 +1,32 @@ +// Copyright 2000-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. +package com.intellij.internal.statistic.collectors.fus.project + +import com.intellij.internal.statistic.eventLog.FeatureUsageData +import com.intellij.internal.statistic.eventLog.FeatureUsageGroup +import com.intellij.internal.statistic.eventLog.FeatureUsageLogger +import com.intellij.openapi.project.Project +import com.intellij.openapi.util.SystemInfo + +object ProjectFsStatsCollector { + private val groupId = FeatureUsageGroup("project.fs", 1) + + @JvmStatic + fun caseSensitivity(project: Project, value: Boolean) { + FeatureUsageLogger.logState(groupId, "case-sensitivity", FeatureUsageData() + .addProject(project) + .addData("cs-project", value) + .addData("cs-system", SystemInfo.isFileSystemCaseSensitive) + .addData("cs-implicit", System.getProperty("idea.case.sensitive.fs") == null) + .addOS() + .build()) + } + + @JvmStatic + fun watchedRoots(project: Project, pctNonWatched: Int) { + FeatureUsageLogger.logState(groupId, "roots-watched", FeatureUsageData() + .addProject(project) + .addData("pct-non-watched", pctNonWatched) + .addData("os-name", SystemInfo.OS_NAME) // `addOS` groups uncommon OSes under 'Other' moniker + .build()) + } +} \ No newline at end of file