AP-8446 [*]: dropping descriptions from the codebase

GitOrigin-RevId: 247054fd028e5213c06aedf635c75706268cf177
This commit is contained in:
Roman Shevchenko
2026-02-05 11:51:17 +00:00
committed by intellij-monorepo-bot
parent 56a670b0ef
commit e9e9b1620f
37 changed files with 412 additions and 746 deletions
+2 -2
View File
@@ -10,7 +10,7 @@ import com.intellij.openapi.vfs.VirtualFile
object CsvFileUsageCollector : CounterUsagesCollector() {
override fun getGroup(): EventLogGroup = GROUP
private val GROUP = EventLogGroup("csv.file.usage", 1, description = "Statistics for CSV files opened in different modes")
private val GROUP = EventLogGroup("csv.file.usage", 1)
private val FILE_SIZE_FIELD = EventFields.RoundedLong("file_size_bytes")
private val OPEN_MODE_FIELD = EventFields.Enum<OpenMode>("open_mode")
private val OPEN_CSV_FILE_EVENT = GROUP.registerVarargEvent("opened", FILE_SIZE_FIELD, OPEN_MODE_FIELD)
@@ -23,4 +23,4 @@ object CsvFileUsageCollector : CounterUsagesCollector() {
fun logFileOpened(project: Project, file: VirtualFile, mode: OpenMode) {
OPEN_CSV_FILE_EVENT.log(project, FILE_SIZE_FIELD.with(file.length), OPEN_MODE_FIELD.with(mode))
}
}
}
@@ -32,8 +32,7 @@ public final class DebuggerSettingsStatisticsCollector extends ApplicationUsages
private static final VarargEventId RESUME_ONLY_CURRENT_THREAD = GROUP.registerVarargEvent("resumeOnlyCurrentThread", EventFields.Enabled);
private static final VarargEventId HIDE_STACK_FRAMES_USING_STEPPING_FILTER = GROUP.registerVarargEvent("hideStackFramesUsingSteppingFilter", EventFields.Enabled);
private static final VarargEventId INSTRUMENTING_AGENT = GROUP.registerVarargEvent("instrumentingAgent", EventFields.Enabled);
private static final VarargEventId AGENT_THROTTLING =
GROUP.registerVarargEvent("agentThrottling", "Debugger agent throttling in case of detected overhead", EventFields.Enabled);
private static final VarargEventId AGENT_THROTTLING = GROUP.registerVarargEvent("agentThrottling", EventFields.Enabled);
@Override
public EventLogGroup getGroup() {
@@ -17,12 +17,10 @@ import com.intellij.debugger.statistics.EvaluationOnPauseStatus.NO_DEBUGGER_AGEN
import com.intellij.debugger.ui.breakpoints.Breakpoint
import com.intellij.internal.statistic.eventLog.EventLogGroup
import com.intellij.internal.statistic.eventLog.events.EventFields
import com.intellij.internal.statistic.eventLog.events.EventFields.Int
import com.intellij.internal.statistic.service.fus.collectors.CounterUsagesCollector
import com.intellij.openapi.project.Project
import org.jetbrains.annotations.ApiStatus
@ApiStatus.Internal
object DebuggerStatistics : CounterUsagesCollector() {
override fun getGroup(): EventLogGroup = GROUP
@@ -34,7 +32,7 @@ object DebuggerStatistics : CounterUsagesCollector() {
/**
* These are XBreakpointType IDs related to JVM languages.
*
* Use [XBreakpointType.EXTENSION_POINT_NAME.extensions.map { it.id }] to get the full list.
* Use `XBreakpointType.EXTENSION_POINT_NAME.extensions.map { it.id }` to get the full list.
*/
private val breakpointTypeField = EventFields.String("type", listOf(
"java-exception", "java-collection", "java-wildcard-method",
@@ -44,12 +42,9 @@ object DebuggerStatistics : CounterUsagesCollector() {
private val steppingActionField = EventFields.Enum<SteppingAction>("step_action")
private val languageField = EventFields.Enum<Engine>("language")
private val dumpedCoroutinesCounter = Int("coroutines")
private val dumpedVirtualThreadsCounter = Int("virtual_threads")
private val threadDumpTriggeringExceptionField =
EventFields.String("exception", THREAD_DUMP_TRIGGERING_EXCEPTIONS_TO_LOG)
private val dumpedCoroutinesCounter = EventFields.Int("coroutines")
private val dumpedVirtualThreadsCounter = EventFields.Int("virtual_threads")
private val threadDumpTriggeringExceptionField = EventFields.String("exception", THREAD_DUMP_TRIGGERING_EXCEPTIONS_TO_LOG)
// events
/** Reports overhead spent on checking where a breakpoint must be installed. */
@@ -78,10 +73,7 @@ object DebuggerStatistics : CounterUsagesCollector() {
private val timeBucketCount = GROUP.registerEvent("debugger.command.time.bucket.updated", EventFields.Int("bucket_upper_limit_ms"), EventFields.Count, EventFields.Boolean("is_remote"))
internal val bucketUpperLimits = (generateSequence(1L) { it * 2 }.takeWhile { it <= 2048 } + Long.MAX_VALUE).toList().toLongArray()
private val agentOverheadDetected = GROUP.registerEvent("debugger.agent.overhead.detected",
EventFields.Long("passed_since_session_start_ms"),
"Detected noticeable overhead of the debugger agent due to async stack traces collection")
private val agentOverheadDetected = GROUP.registerEvent("debugger.agent.overhead.detected", EventFields.Long("passed_since_session_start_ms"))
@JvmStatic
fun logProcessStatistics(debugProcess: DebugProcess) {
@@ -142,11 +134,11 @@ object DebuggerStatistics : CounterUsagesCollector() {
}
@JvmStatic
fun logEvaluatablePauseSuccess(project: Project?, isDebuggerAgentAvailable: Boolean) =
fun logEvaluatablePauseSuccess(project: Project?, isDebuggerAgentAvailable: Boolean): Unit =
logEvaluatablePauseStatus(project, isDebuggerAgentAvailable, true)
@JvmStatic
fun logEvaluatablePauseFailure(project: Project?, isDebuggerAgentAvailable: Boolean) =
fun logEvaluatablePauseFailure(project: Project?, isDebuggerAgentAvailable: Boolean): Unit =
logEvaluatablePauseStatus(project, isDebuggerAgentAvailable, false)
@JvmStatic
@@ -191,6 +183,5 @@ object DebuggerStatistics : CounterUsagesCollector() {
agentOverheadDetected.log(project, passedSinceSessionStartMs)
}
private val Breakpoint<*>.type: String? get() = xBreakpoint?.type?.id
}
@@ -12,11 +12,8 @@ import com.intellij.psi.stubs.StubInconsistencyReporter.SourceOfCheck
import com.intellij.psi.stubs.StubInconsistencyReporter.StubTreeAndIndexDoNotMatchSource
import org.jetbrains.annotations.ApiStatus.Internal
@Internal
object StubInconsistencyReportUtil {
val GROUP = EventLogGroup("mismatch.in.stub.indexes", 1, "FUS",
"Collector for breakages of indexes defined in implementation-level terms, " +
"see more at https://youtrack.jetbrains.com/articles/IJPL-A-308")
internal object StubInconsistencyReportUtil {
internal val GROUP = EventLogGroup("mismatch.in.stub.indexes", 1)
private val KOTLIN_DESCRIPTOR_EVENT = GROUP.registerEvent("kotlin.descriptor.not.found")
@@ -67,8 +64,7 @@ object StubInconsistencyReportUtil {
}
}
@Internal
class StubInconsistencyFusCollector : CounterUsagesCollector() {
override fun getGroup(): EventLogGroup = StubInconsistencyReportUtil.GROUP
}
}
@@ -13,25 +13,13 @@ import it.unimi.dsi.fastutil.ints.Int2IntMap
import it.unimi.dsi.fastutil.ints.Int2IntOpenHashMap
internal class CodeInsightContextFusCollector : ProjectUsagesCollector() {
private val GROUP: EventLogGroup = EventLogGroup(
id = "code.insight.context",
version = 1,
recorder = "FUS",
description = "Statistics for code insight contexts registered on users projects"
)
private val GROUP: EventLogGroup = EventLogGroup("code.insight.context", 1)
private val ENABLED = GROUP.registerEvent(
eventId = "shared_source_support_enabled",
eventField1 = EventFields.Boolean("enabled"),
description = "is shared source support enabled for this project"
)
private val ENABLED = GROUP.registerEvent("shared_source_support_enabled", EventFields.Boolean("enabled"))
private val CONTEXT_REPORT = GROUP.registerEvent(
eventId = "context_report",
eventField1 = EventFields.FileType,
eventField2 = EventFields.Int("context_number"),
eventField3 = EventFields.RoundedInt("file_number"),
description = "Project's context report"
"context_report",
EventFields.FileType, EventFields.Int("context_number"), EventFields.RoundedInt("file_number")
)
override fun getGroup(): EventLogGroup = GROUP
@@ -27,11 +27,7 @@ import java.nio.file.Paths
import kotlin.math.min
internal object AttachDirectoryUsagesCollector : CounterUsagesCollector() {
private val GROUP = EventLogGroup(
id = "attach.directory.statistics",
version = 1,
description = "Reports file count in attached directories"
)
private val GROUP = EventLogGroup("attach.directory.statistics", 1)
enum class SpecialDirectory {
HOME {
@@ -102,17 +98,13 @@ internal object AttachDirectoryUsagesCollector : CounterUsagesCollector() {
}
private val ATTACHED_DIRECTORY_EVENT = GROUP.registerEvent(
eventId = "attached.directory",
eventField1 = EventFields.LogarithmicInt("files_count"),
eventField2 = EventFields.Int("files_count_limit"),
eventField3 = EventFields.Boolean("limit_reached"),
description = "Reports the file count under an attached directory"
"attached.directory",
EventFields.LogarithmicInt("files_count"), EventFields.Int("files_count_limit"), EventFields.Boolean("limit_reached")
)
private val ATTACHED_SPECIAL_DIRECTORY_EVENT = GROUP.registerEvent(
eventId = "attached.special.directory",
eventField1 = EventFields.Enum<SpecialDirectory>("type"),
description = "Reports an attached special directory type"
"attached.special.directory",
EventFields.Enum<SpecialDirectory>("type")
)
override fun getGroup() = GROUP
@@ -27,7 +27,6 @@ import java.util.List;
@ApiStatus.Internal
public final class SearchEverywhereUsageTriggerCollector extends CounterUsagesCollector {
private static final EventLogGroup GROUP = new EventLogGroup("searchEverywhere", 22);
// this string will be used as ID for contributors from private
@@ -125,11 +124,7 @@ public final class SearchEverywhereUsageTriggerCollector extends CounterUsagesCo
public static final EventId1<Boolean> PREVIEW_SWITCHED = GROUP.registerEvent("previewSwitched", EventFields.Boolean("previewState"));
public static final EventId1<Boolean> PREVIEW_CLOSED = GROUP.registerEvent("previewClosed", EventFields.Boolean("previewClosed"));
public static final EventId1<Boolean> SPLIT_SWITCHED =
GROUP.registerEvent("splitSwitched", IS_SPLIT,
"The event is supposed to be triggered when a user runs an action for switching on/off the split Search Everywhere implementation. " +
"The property isSplit reflects the state after the switch had happened.");
public static final EventId1<Boolean> SPLIT_SWITCHED = GROUP.registerEvent("splitSwitched", IS_SPLIT);
public enum FuzzySearchResult {
PROCESS_COMPLETE, PROCESS_STOPPED, EMPTY_PATTERN
@@ -144,8 +139,7 @@ public final class SearchEverywhereUsageTriggerCollector extends CounterUsagesCo
public static final EnumEventField<FuzzySearchResult> FUZZY_SEARCH_RESULT =
EventFields.Enum("fuzzySearchResult", FuzzySearchResult.class);
public static final IdeActivityDefinition FUZZY_SEARCH_ACTIVITY =
GROUP.registerIdeActivity("fuzzySearch", new EventField[]{FUZZY_SEARCH_TYPE},
new EventField[]{FUZZY_SEARCH_TOTAL_RESULTS, FUZZY_SEARCH_RESULT});
GROUP.registerIdeActivity("fuzzySearch", new EventField[]{FUZZY_SEARCH_TYPE}, new EventField[]{FUZZY_SEARCH_TOTAL_RESULTS, FUZZY_SEARCH_RESULT});
@Override
public EventLogGroup getGroup() {
@@ -160,8 +154,7 @@ public final class SearchEverywhereUsageTriggerCollector extends CounterUsagesCo
}
@ApiStatus.Internal
public static @NotNull boolean isReportable(@NotNull Object object) {
//noinspection rawtypes
public static boolean isReportable(@NotNull Object object) {
Class<?> clazz = object.getClass();
PluginInfo pluginInfo = PluginInfoDetectorKt.getPluginInfo(clazz);
return pluginInfo.isDevelopedByJetBrains();
@@ -17,7 +17,6 @@ import org.jetbrains.annotations.NotNull;
@ApiStatus.Internal
public final class ProjectViewPerformanceCollector extends CounterUsagesCollector {
private static final EventLogGroup GROUP = new EventLogGroup("project.view.performance", 4);
private static final EventId1<Long> EXPAND_DIR_DURATION = GROUP.registerEvent("dir.expanded", EventFields.DurationMs);
@@ -29,7 +28,6 @@ public final class ProjectViewPerformanceCollector extends CounterUsagesCollecto
private static final VarargEventId UPDATED = GROUP.registerVarargEvent(
"updated",
"Information about Project View updates per minute",
UPDATE_CAUSE_ID,
EventFields.PluginInfo,
NODE_COUNT,
@@ -40,7 +38,6 @@ public final class ProjectViewPerformanceCollector extends CounterUsagesCollecto
private static final VarargEventId STUCK_REQUEST_DETECTED = GROUP.registerVarargEvent(
"stuck.request.detected",
"Some Project View update requests have been running for more than one minute",
UPDATE_CAUSE_ID,
EventFields.PluginInfo,
REQUEST_COUNT,
@@ -83,5 +80,4 @@ public final class ProjectViewPerformanceCollector extends CounterUsagesCollecto
EventFields.DurationMs.with(durationMs)
);
}
}
@@ -10,11 +10,7 @@ import com.intellij.openapi.project.Project
* @see <a href="https://youtrack.jetbrains.com/articles/IJPL-A-300/indexable.files.filter">About indexable.files.filter collector</a>
*/
internal object IndexableFilesFilterHealthCheckCollector : CounterUsagesCollector() {
private val GROUP = EventLogGroup("indexable.files.filter",
10,
"FUS",
"Collects statistics of ProjectIndexableFilesFilterHealthCheck. " +
"See more here: https://youtrack.jetbrains.com/articles/IJPL-A-300/indexable.files.filter")
private val GROUP = EventLogGroup("indexable.files.filter", 10)
override fun getGroup(): EventLogGroup = GROUP
@@ -29,7 +25,6 @@ internal object IndexableFilesFilterHealthCheckCollector : CounterUsagesCollecto
private val indexableFilesFilterHealthCheck = GROUP.registerVarargEvent(
"indexable_files_filter_health_check",
description = "Reports results of health check of ProjectIndexableFilesFilter.",
filterNameField,
attemptNumberInProjectField,
successfulAttemptNumberInProjectField,
@@ -42,12 +37,10 @@ internal object IndexableFilesFilterHealthCheckCollector : CounterUsagesCollecto
"indexable_files_filter_health_check_started",
filterNameField,
attemptNumberInProjectField,
description = "Event which happens every time health check is started."
)
private val indexableFilesFilterHealthCheckCancelled = GROUP.registerVarargEvent(
"indexable_files_filter_health_check_cancelled",
description = "Event which happens every time health check is cancelled e.g. because scanning was in progress.",
filterNameField,
attemptNumberInProjectField,
cancelledAttemptNumberInProjectField,
@@ -55,24 +48,19 @@ internal object IndexableFilesFilterHealthCheckCollector : CounterUsagesCollecto
cancellationReasonField,
)
fun reportIndexableFilesFilterHealthcheckStarted(project: Project,
filter: ProjectIndexableFilesFilter,
attemptNumber: Int) {
indexableFilesFilterHealthCheckStarted.log(
project,
getFilterName(filter),
attemptNumber,
)
fun reportIndexableFilesFilterHealthcheckStarted(project: Project, filter: ProjectIndexableFilesFilter, attemptNumber: Int) {
indexableFilesFilterHealthCheckStarted.log(project, getFilterName(filter), attemptNumber)
}
fun reportIndexableFilesFilterHealthcheck(project: Project,
filter: ProjectIndexableFilesFilter,
attemptNumber: Int,
successfulAttemptNumber: Int,
durationMs: Int,
nonIndexableFilesInFilterCount: Int,
indexableFilesNotInFilterCount: Int) {
fun reportIndexableFilesFilterHealthcheck(
project: Project,
filter: ProjectIndexableFilesFilter,
attemptNumber: Int,
successfulAttemptNumber: Int,
durationMs: Int,
nonIndexableFilesInFilterCount: Int,
indexableFilesNotInFilterCount: Int,
) {
indexableFilesFilterHealthCheck.log(
project,
filterNameField.with(getFilterName(filter)),
@@ -84,12 +72,14 @@ internal object IndexableFilesFilterHealthCheckCollector : CounterUsagesCollecto
)
}
fun reportIndexableFilesFilterHealthcheckCancelled(project: Project,
filter: ProjectIndexableFilesFilter,
attemptNumber: Int,
cancelledAttemptNumber: Int,
durationMs: Int,
cancellationReason: FilterActionCancellationReason) {
fun reportIndexableFilesFilterHealthcheckCancelled(
project: Project,
filter: ProjectIndexableFilesFilter,
attemptNumber: Int,
cancelledAttemptNumber: Int,
durationMs: Int,
cancellationReason: FilterActionCancellationReason,
) {
indexableFilesFilterHealthCheckCancelled.log(
project,
filterNameField.with(getFilterName(filter)),
@@ -108,4 +98,4 @@ internal object IndexableFilesFilterHealthCheckCollector : CounterUsagesCollecto
else -> null
}
}
}
}
@@ -15,8 +15,7 @@ internal object WelcomeScreenTabUsageCollector : CounterUsagesCollector() {
fun logWelcomeScreenTabClosed(): Unit = WELCOME_SCREEN_TAB_CLOSED.log()
private val welcomeTabIsEnabled: BooleanEventField = EventFields.Boolean("isEnabled")
private val WELCOME_SCREEN_TAB_VISIBILITY_CHANGED = GROUP.registerEvent("welcome.screen.tab.visibility.changed", welcomeTabIsEnabled,
description = "Event logged when the visibility of the welcome screen tab is changed by 'Show this page on startup' checkbox. Also could be changed via Advanced settings, but will be logged only if the current project is welcome screen.")
private val WELCOME_SCREEN_TAB_VISIBILITY_CHANGED = GROUP.registerEvent("welcome.screen.tab.visibility.changed", welcomeTabIsEnabled)
fun logWelcomeScreenTabEnabled(): Unit = WELCOME_SCREEN_TAB_VISIBILITY_CHANGED.log(true)
fun logWelcomeScreenTabDisabled(): Unit = WELCOME_SCREEN_TAB_VISIBILITY_CHANGED.log(false)
@@ -20,11 +20,10 @@ import org.jetbrains.annotations.ApiStatus
@ApiStatus.Internal
object InlineCompletionLogs : CounterUsagesCollector() {
// TODO use ML_RECORDER_ID
val GROUP: EventLogGroup = EventLogGroup("inline.completion.v2", 61, recorder = "ML", description = "Detailed Inline Completion logs. Local/Cloud, 1-party/3-party providers")
val GROUP: EventLogGroup = EventLogGroup("inline.completion.v2", 61, recorder = "ML")
val INSERTED_STATE_EVENT: VarargEventId = GROUP.registerVarargEvent(
"inserted_state",
description = "Tracks the state of the accepted suggestion after some time",
InsertedStateEvents.REQUEST_ID,
EventFields.DurationMs,
InsertedStateEvents.SUGGESTION_LENGTH,
@@ -36,10 +35,10 @@ object InlineCompletionLogs : CounterUsagesCollector() {
EventFields.Language,
)
val modelRequestSent: EventId2<Long, Class<*>?> = GROUP.registerEvent("model_request_sent",
EventFields.Long("request_id"),
EventFields.Class("client"),
"Indicates that the call to the model was initiated"
val modelRequestSent: EventId2<Long, Class<*>?> = GROUP.registerEvent(
"model_request_sent",
EventFields.Long("request_id"),
EventFields.Class("client"),
)
override fun getGroup(): EventLogGroup = GROUP
@@ -102,7 +101,6 @@ object InlineCompletionLogs : CounterUsagesCollector() {
// Each phase will have a separate ObjectEventField in the session event with the corresponding features.
val SESSION_EVENT: VarargEventId = GROUP.registerVarargEvent(
"session",
description = "The whole inline completion session",
*phases.values.toTypedArray(),
)
}
@@ -117,4 +115,4 @@ object InlineCompletionLogs : CounterUsagesCollector() {
val COMMON_PREFIX_LENGTH: EventField<Int> = EventFields.Int("common_prefix_length", "Length of common prefix between the suggestion and what remained in Editor")
val COMMON_SUFFIX_LENGTH: EventField<Int> = EventFields.Int("common_suffix_length", "Length of common suffix between the suggestion and what remained in Editor")
}
}
}
@@ -146,7 +146,6 @@ object InlineCompletionUsageTracker : CounterUsagesCollector() {
@Deprecated("Superseded by INSERTED_STATE_EVENT")
internal val INSERTED_STATE_EVENT_OLD: VarargEventId = GROUP.registerVarargEvent(
eventId = INSERTED_STATE_EVENT_ID,
description = "State of the inserted inline proposal in the editor after some time",
ShownEvents.REQUEST_ID,
EventFields.Language,
EventFields.CurrentFile,
@@ -9,10 +9,9 @@ import com.intellij.util.system.OS
import java.awt.Toolkit
internal class ToolkitInfoCollector : ApplicationUsagesCollector() {
private val GROUP = EventLogGroup("toolkit.info", 2, "FUS", "Toolkit information")
private val selectedToolkit = GROUP.registerEvent("awt.toolkit.name", EventFields.String("value", listOf("WLToolkit", "XToolkit", "auto", "other", "not_set")), "The value of the awt.toolkit.name VM option")
private val effectiveToolkit = GROUP.registerEvent("awt.toolkit.effective", EventFields.String("value", listOf("WLToolkit", "XToolkit", "other")), "The effective toolkit used by the IDE")
private val GROUP = EventLogGroup("toolkit.info", 2)
private val selectedToolkit = GROUP.registerEvent("awt.toolkit.name", EventFields.String("value", listOf("WLToolkit", "XToolkit", "auto", "other", "not_set")))
private val effectiveToolkit = GROUP.registerEvent("awt.toolkit.effective", EventFields.String("value", listOf("WLToolkit", "XToolkit", "other")))
override fun getMetrics(): Set<MetricEvent> {
if (OS.CURRENT != OS.Linux) {
@@ -37,4 +36,4 @@ internal class ToolkitInfoCollector : ApplicationUsagesCollector() {
}
override fun getGroup(): EventLogGroup = GROUP
}
}
@@ -54,13 +54,10 @@ public final class TypingEventsLogger extends CounterUsagesCollector {
private static final IntEventField LATENCY_MAX = EventFields.Int("latency_max_ms");
private static final IntEventField LATENCY_90 = EventFields.Int("latency_90_ms");
private static final EventId3<Integer, Integer, FileType> LATENCY = GROUP.registerEvent("latency", LATENCY_MAX, LATENCY_90, EventFields.FileType);
private static final EventId2<Language, Language> TYPED_IN_INJECTED =
GROUP.registerEvent("typed.in.injected.language",
EventFields.Language("original_lang"),
EventFields.Language("injected_lang"),
"Logs typing when the first language is the original language and the second language is injected language. " +
"In case of multiple carets, logged for each caret individually"
);
private static final EventId2<Language, Language> TYPED_IN_INJECTED = GROUP.registerEvent(
"typed.in.injected.language",
EventFields.Language("original_lang"), EventFields.Language("injected_lang")
);
private static final EventId TOO_MANY_INJECTED_EVENTS = GROUP.registerEvent("too.many.injected.events");
private static final EventsRateWindowThrottle ourThrottle =
@@ -32,22 +32,14 @@ internal class IElementTypeUsageCollector : ApplicationUsagesCollector() {
}
}
private val GROUP = EventLogGroup(
id = "ielement.type",
version = 2,
description = "Collects usage statistics for various aspects of registered IElementTypes"
)
private val GROUP = EventLogGroup("ielement.type", 2)
private val ELEMENT_TYPES = GROUP.registerEvent(
eventId = "element_types",
eventField1 = EventFields.RoundedInt("all_element_type_count"),
eventField2 = EventFields.RoundedInt("tombstone_count"),
description = "Registered IElementTypes"
"element_types",
EventFields.RoundedInt("all_element_type_count"), EventFields.RoundedInt("tombstone_count")
)
private val ELEMENT_TYPES_BY_LANGUAGE_COUNT = GROUP.registerEvent(
eventId = "element_type_by_language",
eventField1 = EventFields.Language,
eventField2 = EventFields.RoundedInt("count"),
description = "Number of registered IElementTypes per Language"
"element_type_by_language",
EventFields.Language, EventFields.RoundedInt("count")
)
@@ -97,9 +97,7 @@ private val SCREEN_RESOLUTION_FIELD: StringEventField = object : StringEventFiel
private val SCREEN_RESOLUTION = GROUP.registerEvent("Screen.Resolution", Int("display_id"), SCREEN_RESOLUTION_FIELD)
private val BACKGROUND_IMAGE_SET = Boolean("background_image_set")
private val BACKGROUND_IMAGE = GROUP.registerEvent("background.image", BACKGROUND_IMAGE_SET)
private val SWITCHED_FROM_CLASSIC_TO_ISLANDS = GROUP.registerEvent(
"switched.from.classic.to.islands", Boolean("value"),
"Indicates whether the user was switched during the Classic UI to Island UI migration")
private val SWITCHED_FROM_CLASSIC_TO_ISLANDS = GROUP.registerEvent("switched.from.classic.to.islands", Boolean("value"))
private suspend fun getDescriptors(): Set<MetricEvent> {
val set = HashSet<MetricEvent>()
@@ -25,25 +25,20 @@ internal class AccessibilityToolsStateCollector : ApplicationUsagesCollector() {
WindowsVoiceAccess, MacOSVoiceControl
}
private val GROUP = EventLogGroup("accessibility.tools.state", 1, "FUS",
"Statistics about the usage of third-party accessibility tools and settings")
private val GROUP = EventLogGroup("accessibility.tools.state", 1)
private val SCREEN_READER = GROUP.registerEvent(
"screen.reader",
EventFields.Enum<ScreenReader>("name", "Name of the screen reader tool"),
"Screen reader is running in the system")
EventFields.Enum<ScreenReader>("name", "Name of the screen reader tool"))
private val SCREEN_MAGNIFIER = GROUP.registerEvent(
"screen.magnifier",
EventFields.Enum<ScreenMagnifier>("name", "Name of the screen magnifier tool"),
"Screen magnifier is running in the system")
EventFields.Enum<ScreenMagnifier>("name", "Name of the screen magnifier tool"))
private val VOICE_CONTROL = GROUP.registerEvent(
"voice.control",
EventFields.Enum<VoiceControl>("name", "Name of the voice control tool"),
"Voice control is running in the system")
EventFields.Enum<VoiceControl>("name", "Name of the voice control tool"))
private val OS_HIGH_CONTRAST = GROUP.registerEvent(
"os.high.contrast",
EventFields.Enabled,
"High Contrast mode is enabled in the OS settings")
EventFields.Enabled)
override fun getGroup(): EventLogGroup = GROUP
@@ -117,4 +112,4 @@ internal class AccessibilityToolsStateCollector : ApplicationUsagesCollector() {
return set
}
}
}
@@ -190,7 +190,6 @@ internal object UILatencyLogger : CounterUsagesCollector() {
COLD_START,
EventFields.Language)
@Suppress("SpellCheckingInspection")
@JvmField
val MAIN_MENU_LATENCY: EventId1<Long> = GROUP.registerEvent("mainmenu.latency", EventFields.DurationMs)
@@ -283,7 +282,6 @@ internal object UILatencyLogger : CounterUsagesCollector() {
private val UI_RESPONSIVENESS: VarargEventId = GROUP.registerVarargEvent(
eventId = "ui.responsiveness",
description = "Aggregated distribution of latencies for execution and queueing of UI events. We also gather information about the Read/Write lock acquisitions on UI thread in this event.",
UI_EVENTS_COUNT,
WINDOW_LENGTH_MS,
UI_EXECUTION_TIME_TOTAL_MS,
@@ -397,7 +395,6 @@ internal object UILatencyLogger : CounterUsagesCollector() {
)
private val MEM_HEARTBEAT_EVENT = GROUP.registerVarargEvent(
"heartbeat.memory",
description = "Reported every hour; sampled every second",
MEM_XMX_FIELD,
MEM_SAMPLES_FIELD,
MEM_HISTOGRAM_TOTAL1_FIELD,
@@ -494,4 +491,4 @@ internal class LongDiffer(var previousAccumulatedValue: Long = 0){
override fun toString(): String {
return "LongDiffer[accumulated: $previousAccumulatedValue]"
}
}
}
@@ -77,8 +77,7 @@ public final class LifecycleUsageTriggerCollector extends CounterUsagesCollector
private static final EventId1<Long> IDE_FREEZE = LIFECYCLE.registerEvent("ide.freeze", EventFields.DurationMs);
private static final EventId FREEZE_POPUP_SHOWN =
LIFECYCLE.registerEvent("freeze.popup.shown", "Happens when the IDE shows a popup that indicates UI freeze");
private static final EventId FREEZE_POPUP_SHOWN = LIFECYCLE.registerEvent("freeze.popup.shown");
private static final EventId3<PluginInfo, Long, Boolean> IDE_FREEZE_DETECTED_PLUGIN =
LIFECYCLE.registerEvent("ide.freeze.detected.plugin", EventFields.PluginInfo, EventFields.DurationMs, EventFields.Boolean("reported_to_user"));
@@ -109,12 +108,9 @@ public final class LifecycleUsageTriggerCollector extends CounterUsagesCollector
private static final EventField<Integer> numberOfExceptionsField = EventFields.Int("number_of_exceptions");
private static final EventId1<Integer> IDE_HUNDRED_EXCEPTIONS_HAPPENED =
LIFECYCLE.registerEvent("ide.hundred.exceptions.happened", numberOfExceptionsField,
"The number of exceptions happened while IDE was opened is a multiple of 100");
LIFECYCLE.registerEvent("ide.hundred.exceptions.happened", numberOfExceptionsField);
private static final EventId2<Integer, PluginInfo> IDE_HUNDRED_EXCEPTIONS_HAPPENED_IN_PLUGIN =
LIFECYCLE.registerEvent("ide.hundred.exceptions.happened.in.plugin", numberOfExceptionsField, EventFields.PluginInfo,
"The number of exceptions happened in the plugin while IDE was opened is a multiple of 100");
LIFECYCLE.registerEvent("ide.hundred.exceptions.happened.in.plugin", numberOfExceptionsField, EventFields.PluginInfo);
private enum ProjectOpenMode {New, Same, Attach}
private static final EventField<ProjectOpenMode> projectOpenModeField = EventFields.Enum("mode", ProjectOpenMode.class, mode -> Strings.toLowerCase(mode.name()));
@@ -678,26 +678,21 @@ object FUSProjectHotStartUpMeasurer {
}
}
private val WELCOME_SCREEN_GROUP = EventLogGroup("welcome.screen.startup.performance", 1,
description = "Performance metrics for the Welcome Screen.")
private val WELCOME_SCREEN_GROUP = EventLogGroup("welcome.screen.startup.performance", 1)
private val SPLASH_SCREEN_WAS_SHOWN = EventFields.Boolean("splash_screen_was_shown")
private val SPLASH_SCREEN_VISIBLE_DURATION = createDurationField(DurationUnit.MILLISECONDS, "splash_screen_became_visible_duration_ms")
private val DURATION = createDurationField(DurationUnit.MILLISECONDS, "duration_ms")
private val WELCOME_SCREEN_EVENT = WELCOME_SCREEN_GROUP.registerVarargEvent(
"welcome.screen.shown",
description = "Welcome Screen dialog was shown.",
DURATION, SPLASH_SCREEN_WAS_SHOWN,
SPLASH_SCREEN_VISIBLE_DURATION,
DURATION, SPLASH_SCREEN_WAS_SHOWN, SPLASH_SCREEN_VISIBLE_DURATION,
)
internal class WelcomeScreenPerformanceCollector : CounterUsagesCollector() {
override fun getGroup(): EventLogGroup = WELCOME_SCREEN_GROUP
}
private val GROUP = EventLogGroup("reopen.project.startup.performance", 3,
description = "Startup duration on reopened projects. [Detailed description]" +
"(https://youtrack.jetbrains.com/articles/IJPL-A-285/reopen.project.startup.performance)")
private val GROUP = EventLogGroup("reopen.project.startup.performance", 3)
private enum class UIResponseType {
Splash,
@@ -708,8 +703,6 @@ private val UI_RESPONSE_TYPE = EventFields.Enum("type", UIResponseType::class.ja
private val FIRST_UI_SHOWN_EVENT: EventId2<Duration, UIResponseType> = GROUP.registerEvent(
"first.ui.shown",
DURATION, UI_RESPONSE_TYPE,
description = "First UI shown to user. Reports the moment when user saw IDE's UI for the very first time, " +
"and if it was splash screen or IDE frame.",
)
private val PROJECT_ORDER_FIELD = EventFields.Int("project_order")
@@ -720,25 +713,20 @@ private val PROJECTS_TYPE: EnumEventField<FUSProjectHotStartUpMeasurer.ProjectsT
private val HAS_SETTINGS: BooleanEventField = EventFields.Boolean("has_settings")
private val VIOLATION: EnumEventField<FUSProjectHotStartUpMeasurer.Violation> =
EventFields.Enum("violation", FUSProjectHotStartUpMeasurer.Violation::class.java)
private val FRAME_BECAME_VISIBLE_EVENT = GROUP.registerVarargEvent("frame.became.visible",
description = "IDE frame first became visible to the user.",
DURATION, HAS_SETTINGS, PROJECTS_TYPE, VIOLATION)
private val MULTIPLE_PROJECT_FRAME_BECAME_VISIBLE_EVENT = GROUP.registerVarargEvent("multiple.project.frame.became.visible",
description = "Multiple Project Frame Became Visible",
DURATION, HAS_SETTINGS, PROJECTS_TYPE, VIOLATION,
PROJECT_ORDER_FIELD, NUMBER_OF_PROJECTS_FIELD)
private val FRAME_BECAME_VISIBLE_EVENT = GROUP.registerVarargEvent(
"frame.became.visible",
DURATION, HAS_SETTINGS, PROJECTS_TYPE, VIOLATION
)
private val MULTIPLE_PROJECT_FRAME_BECAME_VISIBLE_EVENT = GROUP.registerVarargEvent(
"multiple.project.frame.became.visible",
DURATION, HAS_SETTINGS, PROJECTS_TYPE, VIOLATION, PROJECT_ORDER_FIELD, NUMBER_OF_PROJECTS_FIELD
)
private val FRAME_BECAME_INTERACTIVE_EVENT =
GROUP.registerEvent("frame.became.interactive",
DURATION,
description = "It is possible, that IDE frame is already visible, but IDE is not ready to function yet. " +
"Then the frame is covered with transparent rectangle, " +
"so that user sees it and rotating progress over it, but can't invoke anything. " +
"Once IDE is ready to function, that rectangle is removed, and user is finally able to use IDE. " +
"That's the moment event frame.became.interactive is saved.")
private val MULTIPLE_PROJECT_FRAME_BECAME_INTERACTIVE_EVENT = GROUP.registerEvent("multiple.project.frame.became.interactive",
DURATION, PROJECT_ORDER_FIELD, NUMBER_OF_PROJECTS_FIELD,
description = "Multiple Project Frame Became Interactive")
private val FRAME_BECAME_INTERACTIVE_EVENT = GROUP.registerEvent("frame.became.interactive", DURATION)
private val MULTIPLE_PROJECT_FRAME_BECAME_INTERACTIVE_EVENT = GROUP.registerEvent(
"multiple.project.frame.became.interactive",
DURATION, PROJECT_ORDER_FIELD, NUMBER_OF_PROJECTS_FIELD
)
private enum class SourceOfSelectedEditor {
TextEditor,
@@ -755,22 +743,15 @@ private val LOADED_CACHED_DOC_RENDER_MARKUP_FIELD = EventFields.Boolean("loaded_
private val SOURCE_OF_SELECTED_EDITOR_FIELD: EnumEventField<SourceOfSelectedEditor> =
EventFields.Enum("source_of_selected_editor", SourceOfSelectedEditor::class.java)
private val NO_EDITORS_TO_OPEN_FIELD = EventFields.Boolean("no_editors_to_open")
private val CODE_LOADED_AND_VISIBLE_IN_EDITOR_EVENT =
GROUP.registerVarargEvent("code.loaded.and.visible.in.editor",
description = "Initial editors are reopened. Based on project settings IDE might reopen editors " +
"that were opened in previous session. " +
"If there are none of them, IDE might open README.md file. " +
"Event reports the moment when such editor is opened and focused, or when IDE finds " +
"that there is no such editor. Full highlight of editor may happen later. " +
"Also files opened due to passing them as command line parameters are not reported here " +
"(those cases are filtered out on frame.became.visible event " +
"with violation = MightBeLightEditProject.",
*createCodeLoadedEventFields(false))
private val CODE_LOADED_AND_VISIBLE_IN_EDITOR_EVENT = GROUP.registerVarargEvent(
"code.loaded.and.visible.in.editor",
*createCodeLoadedEventFields(false)
)
private val MULTIPLE_PROJECT_CODE_LOADED_AND_VISIBLE_IN_EDITOR_EVENT =
GROUP.registerVarargEvent("multiple.project.code.loaded.and.visible.in.editor",
description = "Multiple Project Code Loaded And Visible In Editor",
*createCodeLoadedEventFields(true))
private val MULTIPLE_PROJECT_CODE_LOADED_AND_VISIBLE_IN_EDITOR_EVENT = GROUP.registerVarargEvent(
"multiple.project.code.loaded.and.visible.in.editor",
*createCodeLoadedEventFields(true)
)
private fun getField(type: MarkupType): EventField<Boolean> {
return when (type) {
@@ -810,4 +791,4 @@ class FUSProjectHotStartUpMeasurerService {
fun isHandlingFinished(): Boolean {
return statsIsWritten
}
}
}
@@ -189,10 +189,10 @@ private object MigrateToSingleProductCollector : CounterUsagesCollector() {
private val GROUP = @Suppress("DEPRECATION") EventLogGroup("migrate.to.single.product", 1)
@JvmField
val WELCOME_PAGE_SHOWN: EventId = GROUP.registerEvent("vision.page.shown", "How many times button on welcome vision page was shown after patch update to SID")
val WELCOME_PAGE_SHOWN: EventId = GROUP.registerEvent("vision.page.shown")
@JvmField
val BUTTON_CLICKED: EventId = GROUP.registerEvent("vision.button.clicked", "How many times button on welcome vision page was clicked")
val BUTTON_CLICKED: EventId = GROUP.registerEvent("vision.button.clicked")
override fun getGroup(): EventLogGroup = GROUP
}
@@ -8,7 +8,6 @@ import com.intellij.internal.statistic.eventLog.connection.metadata.EventLogMeta
import com.intellij.internal.statistic.eventLog.connection.metadata.EventLogMetadataUpdateError
import com.intellij.internal.statistic.eventLog.connection.metadata.EventLogMetadataUpdateStage
import com.intellij.internal.statistic.eventLog.events.EventFields
import com.intellij.internal.statistic.eventLog.events.EventId3
import com.intellij.internal.statistic.eventLog.events.EventPair
import com.intellij.internal.statistic.eventLog.uploader.EventLogUploadException.EventLogUploadErrorType
import com.intellij.internal.statistic.service.fus.collectors.CounterUsagesCollector
@@ -30,93 +29,67 @@ import java.util.Locale
@ApiStatus.Internal
internal class EventLogSystemCollector(eventLoggerProvider: StatisticsEventLoggerProvider) : CounterUsagesCollector() {
private val id = "${eventLoggerProvider.recorderId.lowercase(Locale.ENGLISH)}.event.log"
private val GROUP = EventLogGroup(id,
// Increase the group's versions locally
// and not increase the versions in all StatisticsEventLoggerProvider
// in case of any changes in the groups
eventLoggerProvider.version + 3,
eventLoggerProvider.recorderId,
"Events related to the ${eventLoggerProvider.recorderId} statistics, such as logs sent, metadata updated, etc.")
private val GROUP = EventLogGroup(
id,
// Increase the group's versions locally
// and not increase the versions in all StatisticsEventLoggerProvider
// in case of any changes in the groups
eventLoggerProvider.version + 3,
eventLoggerProvider.recorderId
)
override fun getGroup(): EventLogGroup = GROUP
private val metadataLoadedEvent = GROUP.registerEvent("metadata.loaded",EventFields.Version, METADATA_LOADED_DESCRIPTION)
private val metadataUpdatedEvent = GROUP.registerEvent("metadata.updated", EventFields.Version, METADATA_UPDATED_DESCRIPTION)
private val metadataLoadFailedEvent = GROUP.registerEvent("metadata.load.failed",
stageMetadataLoadFailedField,
errorMetadataLoadFailedField,
codeMetadataLoadFailedField,
METADATA_LOAD_FAILED_DESCRIPTION)
private val metadataUpdateFailedEvent = GROUP.registerEvent("metadata.update.failed",
stageMetadataUpdateFailedField,
errorMetadataUpdateFailedField,
codeMetadataUpdateFailedField,
METADATA_UPDATE_FAILED_DESCRIPTION)
private val logsSendEvent = GROUP.registerVarargEvent("logs.send",
LOGS_SEND_DESCRIPTION,
totalLogsSendField,
sendLogsSendField,
failedLogsSendField,
externalLogsSendField,
pathsLogsField,
succeedLogsSendField,
errorsLogsSendField)
private val externalSendStartedEvent = GROUP.registerEvent("external.send.started",
sendTSExternalSendStarted,
EXTERNAL_SEND_STARTED_DESCRIPTION)
private val externalSendFinishedEvent = GROUP.registerEvent("external.send.finished",
sendTSExternalSendFinishedField,
succeedExternalSendFinishedField,
errorExternalSendFinishedField,
EXTERNAL_SEND_FINISHED_DESCRIPTION)
private val externalSendCommandCreationStartedEvent = GROUP.registerEvent("external.send.command.creation.started",
EXTERNAL_SEND_COMMAND_CREATION_STARTED_DESCRIPTION)
private val externalSendCommandCreationFinishedEvent = GROUP.registerVarargEvent("external.send.command.creation.finished",
EXTERNAL_SEND_COMMAND_CREATION_FINISHED_DESCRIPTION,
succeedExternalSendCommandCreationFinishedField,
errorExternalSendCommandCreationFinishedField)
private val loadingConfigFailedEvent = GROUP.registerVarargEvent("loading.config.failed",
LOADING_CONFIG_FAILED_DESCRIPTION,
errorLoadingConfigFailedField,
errorTSLoadingConfigFailedField)
private val sentFilesCountCalculated: EventId3<Int, Int, Int> = GROUP.registerEvent("sent.logs.files.calculated",
totalFilesCount,
maxSentFilesCount,
sentFilesCount,
"Calculate the count of logs files to send"
private val metadataLoadedEvent = GROUP.registerEvent("metadata.loaded", EventFields.Version)
private val metadataUpdatedEvent = GROUP.registerEvent("metadata.updated", EventFields.Version)
private val metadataLoadFailedEvent = GROUP.registerEvent(
"metadata.load.failed",
stageMetadataLoadFailedField, errorMetadataLoadFailedField, codeMetadataLoadFailedField
)
private val dictionaryListLoadFailed = GROUP.registerEvent("dictionary.list.load.failed",
stageMetadataLoadFailedField,
errorMetadataLoadFailedField,
codeMetadataLoadFailedField,
DICTIONARY_LIST_LOAD_FAILED_DESCRIPTION)
private val dictionaryListUpdateFailed = GROUP.registerEvent("dictionary.list.update.failed",
stageMetadataUpdateFailedField,
errorMetadataUpdateFailedField,
codeMetadataUpdateFailedField,
DICTIONARY_LIST_UPDATE_FAILED_DESCRIPTION)
private val dictionaryLoadedEvent = GROUP.registerEvent(
"dictionary.loaded",
EventFields.Long("dictionary_last_modified"),
DICTIONARY_LOADED_DESCRIPTION
private val metadataUpdateFailedEvent = GROUP.registerEvent(
"metadata.update.failed",
stageMetadataUpdateFailedField, errorMetadataUpdateFailedField, codeMetadataUpdateFailedField
)
private val dictionaryLoadFailedEvent = GROUP.registerEvent("dictionary.load.failed",
stageMetadataLoadFailedField,
errorMetadataLoadFailedField,
codeMetadataLoadFailedField,
DICTIONARY_LOAD_FAILED_DESCRIPTION)
private val dictionaryUpdatedEvent = GROUP.registerEvent(
"dictionary.updated",
EventFields.Long("dictionary_last_modified"),
DICTIONARY_UPDATED_DESCRIPTION
private val logsSendEvent = GROUP.registerVarargEvent(
"logs.send",
totalLogsSendField, sendLogsSendField, failedLogsSendField, externalLogsSendField, pathsLogsField,
succeedLogsSendField, errorsLogsSendField
)
private val externalSendStartedEvent = GROUP.registerEvent("external.send.started", sendTSExternalSendStarted)
private val externalSendFinishedEvent = GROUP.registerEvent(
"external.send.finished",
sendTSExternalSendFinishedField, succeedExternalSendFinishedField, errorExternalSendFinishedField
)
private val externalSendCommandCreationStartedEvent = GROUP.registerEvent("external.send.command.creation.started")
private val externalSendCommandCreationFinishedEvent = GROUP.registerVarargEvent(
"external.send.command.creation.finished",
succeedExternalSendCommandCreationFinishedField, errorExternalSendCommandCreationFinishedField
)
private val loadingConfigFailedEvent = GROUP.registerVarargEvent(
"loading.config.failed",
errorLoadingConfigFailedField, errorTSLoadingConfigFailedField
)
private val sentFilesCountCalculated = GROUP.registerEvent(
"sent.logs.files.calculated",
totalFilesCount, maxSentFilesCount, sentFilesCount
)
private val dictionaryListLoadFailed = GROUP.registerEvent(
"dictionary.list.load.failed",
stageMetadataLoadFailedField, errorMetadataLoadFailedField, codeMetadataLoadFailedField
)
private val dictionaryListUpdateFailed = GROUP.registerEvent(
"dictionary.list.update.failed",
stageMetadataUpdateFailedField, errorMetadataUpdateFailedField, codeMetadataUpdateFailedField
)
private val dictionaryLoadedEvent = GROUP.registerEvent("dictionary.loaded", EventFields.Long("dictionary_last_modified"))
private val dictionaryLoadFailedEvent = GROUP.registerEvent(
"dictionary.load.failed",
stageMetadataLoadFailedField, errorMetadataLoadFailedField, codeMetadataLoadFailedField
)
private val dictionaryUpdatedEvent = GROUP.registerEvent("dictionary.updated", EventFields.Long("dictionary_last_modified"))
private val dictionaryUpdateFailedEvent = GROUP.registerEvent(
"dictionary.update.failed",
stageMetadataUpdateFailedField, errorMetadataUpdateFailedField, codeMetadataUpdateFailedField
)
private val dictionaryUpdateFailedEvent = GROUP.registerEvent("dictionary.update.failed",
stageMetadataUpdateFailedField,
errorMetadataUpdateFailedField,
codeMetadataUpdateFailedField,
DICTIONARY_UPDATE_FAILED_DESCRIPTION)
fun logMetadataLoaded(version: String?) = metadataLoadedEvent.log(version)
fun logMetadataUpdated(version: String?) = metadataUpdatedEvent.log(version)
@@ -128,21 +101,17 @@ internal class EventLogSystemCollector(eventLoggerProvider: StatisticsEventLogge
metadataUpdateFailedEvent.log(error.updateStage, error.errorType, error.errorCode)
}
fun logFilesSend(total: Int,
succeed: Int,
failed: Int,
external: Boolean,
successfullySentFiles: List<String>,
errors: List<Int>) =
logsSendEvent.log(totalLogsSendField.with(total),
sendLogsSendField.with(succeed + failed),
failedLogsSendField.with(failed),
externalLogsSendField.with(external),
pathsLogsField.with(successfullySentFiles),
succeedLogsSendField.with(succeed),
errorsLogsSendField.with(errors)
fun logFilesSend(total: Int, succeed: Int, failed: Int, external: Boolean, successfullySentFiles: List<String>, errors: List<Int>) {
logsSendEvent.log(
totalLogsSendField.with(total),
sendLogsSendField.with(succeed + failed),
failedLogsSendField.with(failed),
externalLogsSendField.with(external),
pathsLogsField.with(successfullySentFiles),
succeedLogsSendField.with(succeed),
errorsLogsSendField.with(errors)
)
}
fun logStartingExternalSend(time: Long) {
externalSendStartedEvent.log(time)
@@ -193,22 +162,16 @@ internal class EventLogSystemCollector(eventLoggerProvider: StatisticsEventLogge
}
companion object {
private const val METADATA_LOADED_DESCRIPTION = "The metric is recorded in case the metadata was loaded"
private const val METADATA_UPDATED_DESCRIPTION = "The metric is recorded in case the metadata was updated"
private const val STAGE_METADATA_LOAD_FAILED_DESCRIPTION = "Indicates if metadata load was failed during loading stage (loading) or loaded " +
"metadata was invalid (parsing)."
private const val ERROR_METADATA_LOAD_FAILED_DESCRIPTION = "The error name in case the metadata load was failed. The error may occur during " +
"parsing metadata from local cache."
private const val METADATA_LOAD_FAILED_DESCRIPTION = "The event is recorded when IDE can't load metadata from a local cache. Local metadata " +
"is loaded on IDE start or on an explicit test action."
private const val STAGE_METADATA_UPDATE_FAILED_DESCRIPTION = "Indicates if metadata update was failed during loading stage (loading) or " +
"loaded metadata was invalid (parsing)."
private const val ERROR_METADATA_UPDATE_FAILED_DESCRIPTION = "The error name in case the metadata update was failed, an error may occur on " +
"loading or parsing stages."
private const val CODE_METADATA_UPDATE_FAILED_DESCRIPTION = "In case loading request failed - the metric is recorded response code if it " +
"was different from 200."
private const val METADATA_UPDATE_FAILED_DESCRIPTION = "The event is recorded when IDE can't update metadata. Update metadata can be " +
"triggered by a scheduler or via an explicit test action."
private const val TOTAL_LOGS_SEND_DESCRIPTION = "Total amount of existing for sending event-log files"
private const val SEND_LOGS_SEND_DESCRIPTION = "Amount of event log files attempted to send"
private const val FAILED_LOGS_SEND_DESCRIPTION = "Amount of event-log files which were failed to send"
@@ -217,38 +180,15 @@ internal class EventLogSystemCollector(eventLoggerProvider: StatisticsEventLogge
private const val ERRORS_LOGS_SEND_DESCRIPTION = "The list of integers which identify error codes. If error is less than 100, the problem is " +
"in data structure (e.g. invalid recorder code), if error is between 100 and 600 it's error " +
"code from an HTTP request."
private const val LOGS_SEND_DESCRIPTION = "The metric is recorded the sending or attempt to send the statistics event logs and the " +
"corresponding attributes, e.g. number of total amount of files, number of sent files or amount of " +
"files which were failed to send."
private const val SEND_TS_EXTERNAL_SEND_STARTED_DESCRIPTION = "Actual time when sending was started"
private const val EXTERNAL_SEND_STARTED_DESCRIPTION = "Indicates that external process of sending data was started. Note: the time of the " +
"event doesn't correspond to a real event time because it's recorded when IDE is " +
"opened after external send."
private const val SEND_TS_EXTERNAL_SEND_FINISHED_DESCRIPTION = "Actual time when sending was finished"
private const val SUCCEED_EXTERNAL_SEND_FINISHED_DESCRIPTION = "Shows if external process sent data successfully or not"
private const val ERROR_EXTERNAL_SEND_FINISHED_DESCRIPTION = "The error name in case the sending was failed, e.g. 'no arguments', 'not permitted server', 'no application config' etc."
private const val EXTERNAL_SEND_FINISHED_DESCRIPTION = "Indicates that external process sent data or failed with an error. Note: the time of " +
"the event doesn't correspond to a real event time because it's recorded when IDE is " +
"opened after external send."
private const val EXTERNAL_SEND_COMMAND_CREATION_STARTED_DESCRIPTION = "The event is recorded on IDE close when we start creating a command " +
"to start external upload process."
private const val SUCCEED_EXTERNAL_SEND_COMMAND_CREATION_FINISHED_DESCRIPTION = "Shows if command to start external upload process was " +
"finished successfully or not"
private const val ERROR_EXTERNAL_SEND_COMMAND_CREATION_FINISHED_DESCRIPTION = "The error name in case command to start external upload " +
"process was failed, e.g. 'no logs', 'no temp folder' etc."
private const val EXTERNAL_SEND_COMMAND_CREATION_FINISHED_DESCRIPTION = "The event is recorded when we created a command and ready to start " +
"it or when creation failed with an error."
private const val ERROR_TS_LOADING_CONFIG_FAILED_DESCRIPTION = "Error time stamp is added if error happened in external process"
private const val LOADING_CONFIG_FAILED_DESCRIPTION = "Event is recorded if loading config (i.e. send entrypoint, metadata url, etc) failed."
private const val DICTIONARY_LIST_LOAD_FAILED_DESCRIPTION = "The event is recorded when IDE can't load dictionary list from a local cache. Local cache " +
"is loaded on IDE start or on an explicit test action."
private const val DICTIONARY_LIST_UPDATE_FAILED_DESCRIPTION = "The event is recorded when IDE can't update dictionary list. Update can be " +
"triggered by a scheduler or via an explicit test action."
private const val DICTIONARY_LOAD_FAILED_DESCRIPTION = "The event is recorded when IDE can't load a dictionary from local cache or bundled files."
private const val DICTIONARY_LOADED_DESCRIPTION = "The metric is recorded in case a dictionary loaded"
private const val DICTIONARY_UPDATED_DESCRIPTION = "The metric is recorded in case a dictionary was updated"
private const val DICTIONARY_UPDATE_FAILED_DESCRIPTION = "The event is recorded when IDE can't update a dictionary. Update metadata including dictionaries can be " +
"triggered by a scheduler or via an explicit test action."
private val stageMetadataLoadFailedField = EventFields.Enum<EventLogMetadataUpdateStage>("stage",
STAGE_METADATA_LOAD_FAILED_DESCRIPTION)
private val errorMetadataLoadFailedField = EventFields.String("error",
@@ -283,4 +223,4 @@ internal class EventLogSystemCollector(eventLoggerProvider: StatisticsEventLogge
private val maxSentFilesCount = EventFields.Int("max_sent_files_count", "The max sent logs files count")
private val sentFilesCount = EventFields.Int("sent_files_count", "The sent logs files count")
}
}
}
@@ -13,7 +13,7 @@ import org.jetbrains.annotations.ApiStatus
@ApiStatus.Internal
object LogSystemCollector : CounterUsagesCollector() {
private const val ID = "system.log"
private val GROUP = EventLogGroup(ID, 2, "FUS", "Events related to external FUS log uploader.")
private val GROUP = EventLogGroup(ID, 2)
override fun getGroup(): EventLogGroup = GROUP
val restartField: BooleanEventField = EventFields.Boolean("restart", "Don't start external uploader because there is restarted")
@@ -24,13 +24,9 @@ object LogSystemCollector : CounterUsagesCollector() {
val sendingForAllRecordersDisabledField: BooleanEventField = EventFields.Boolean("sending_disabled_for_all_recorders", "Don't start external uploader because sending logs is disabled for all recorders")
val failedToStartField: BooleanEventField = EventFields.Boolean("failed_to_start", "Failed to start external log uploader")
val externalUploaderLaunched: VarargEventId = GROUP.registerVarargEvent("external.uploader.launched",
"Send the reason why external log uploader wasn't launched",
restartField,
runningFromSourcesField,
sendingOnExitDisabledField,
notEnabledLoggerProvidersField,
updateInProgressField,
sendingForAllRecordersDisabledField,
failedToStartField)
}
val externalUploaderLaunched: VarargEventId = GROUP.registerVarargEvent(
"external.uploader.launched",
restartField, runningFromSourcesField, sendingOnExitDisabledField, notEnabledLoggerProvidersField, updateInProgressField,
sendingForAllRecordersDisabledField, failedToStartField
)
}
@@ -21,27 +21,10 @@ object StructureViewEventsCollector: CounterUsagesCollector() {
private val TAB = EventFields.Enum<StructureViewTab>("tab")
private val MODEL_CLASS = EventFields.Class("model_class")
private val BUILD_STRUCTURE = GROUP.registerEvent(
"toolwindow.shown",
TAB, MODEL_CLASS,
"Toolwindow is opened, first time or after changing a file"
)
private val TAB_SELECTED = GROUP.registerEvent(
"tab.selected",
TAB, MODEL_CLASS,
"User selected another tab"
)
private val NAVIGATE = GROUP.registerEvent(
"navigate",
MODEL_CLASS,
"Navigate to psiElement"
)
private val CUSTOM_CLICK_HANDLED = GROUP.registerEvent(
"custom.click.handled",
MODEL_CLASS,
"Click event was handled by custom handler"
)
private val BUILD_STRUCTURE = GROUP.registerEvent("toolwindow.shown", TAB, MODEL_CLASS)
private val TAB_SELECTED = GROUP.registerEvent("tab.selected", TAB, MODEL_CLASS)
private val NAVIGATE = GROUP.registerEvent("navigate", MODEL_CLASS)
private val CUSTOM_CLICK_HANDLED = GROUP.registerEvent("custom.click.handled", MODEL_CLASS)
fun logBuildStructure(viewDescriptor: StructureViewDescriptor) {
val tab = viewDescriptor.title?.let { StructureViewTab.ofTitle(it) } ?: return
@@ -74,11 +57,11 @@ object StructureViewEventsCollector: CounterUsagesCollector() {
}
private fun getModelClass(viewDescriptor: StructureViewDescriptor): Class<*>? {
var model: Any = viewDescriptor.structureModel
val model: Any = viewDescriptor.structureModel
if (model is LogicalStructureViewModel) {
val root = model.root
if (root is LogicalStructureViewTreeElement<*>) {
var assembledModel = root.getLogicalAssembledModel()
val assembledModel = root.getLogicalAssembledModel()
val children = assembledModel.getChildren()
if (children.size == 1)
return children[0].model?.javaClass
@@ -91,5 +74,4 @@ object StructureViewEventsCollector: CounterUsagesCollector() {
}
return null
}
}
}
@@ -24,11 +24,9 @@ internal object GradleActionsUsagesCollector : CounterUsagesCollector() {
val PASTE_MAVEN_DEPENDENCY = GROUP.registerEvent("PasteMvnDependency")
@JvmField
val SHOW_GRADLE_DAEMONS_ACTION = GROUP.registerEvent("showGradleDaemonsAction")
@JvmField
val TOGGLE_PARALLEL_FETCH = GROUP.registerEvent("toggleParallelFetch",
EventFields.Boolean("new_value", "newly set value"),
"Parallel model fetch flag was switched by a user to the new value. " +
"Only fires when the old value differs from the new boolean value")
val TOGGLE_PARALLEL_FETCH = GROUP.registerEvent("toggleParallelFetch", EventFields.Boolean("new_value", "newly set value"))
@JvmStatic
fun trigger(project: Project?, action: EventId) {
@@ -11,12 +11,11 @@ import com.intellij.internal.statistic.eventLog.events.EventFields
import com.intellij.internal.statistic.service.fus.collectors.CounterUsagesCollector
import com.intellij.openapi.components.SettingsCategory
object ImportSettingsEventsCollector : CounterUsagesCollector() {
private val GROUP = EventLogGroup("import.settings", 6)
override fun getGroup(): EventLogGroup = GROUP
private val UNKNOWN = "UNKNOWN"
private val FOLDER = "FOLDER"
private const val UNKNOWN = "UNKNOWN"
private const val FOLDER = "FOLDER"
// Lists/enums:
private val ALLOWED_JB_IDES: List<String> = IDEData.IDE_MAP.keys.plus(UNKNOWN).toList()
@@ -73,7 +72,6 @@ object ImportSettingsEventsCollector : CounterUsagesCollector() {
CONNECTION_ERROR,
}
private val JB_IDE_VALUES = EventFields.StringList("jbIdeValues", ALLOWED_JB_IDES, "Supported JB IDEs")
private val EXTERNAL_IDE_VALUES = EventFields.EnumList<TransferableIdeId>("externalIdeValues", "Supported external IDEs")
private val FIRST_PAGE_BUTTONS = EventFields.Enum<ProductPageButton>("productPageButton", "Buttons on the first page")
@@ -93,62 +91,43 @@ object ImportSettingsEventsCollector : CounterUsagesCollector() {
// before first page - preparations and performance
// first page (product) - select import source or skip
private val productPageShown = GROUP.registerEvent("page.product.shown", EventFields.Boolean("shown"),
"indicates whether initial import settings page was shown to user, if not, then import was skipped completely")
private val jbIdeActualValues = GROUP.registerEvent("jb.ide.actual.values", JB_IDE_VALUES, "JB IDEs in the main dropdown")
private val jbIdeOldValues = GROUP.registerEvent("jb.ide.old.values", JB_IDE_VALUES, "JB IDEs in the other dropdown")
private val externalIdeValues = GROUP.registerEvent("external.ide.values", EXTERNAL_IDE_VALUES, "external IDEs available for import")
private val productPageButton = GROUP.registerEvent("page.product.button", FIRST_PAGE_BUTTONS, "Button pressed on the product page")
private val jbIdeSelectedValue = GROUP.registerEvent("page.product.selected.jb.ide", EventFields.String("jbIde", ALLOWED_JB_IDES), "JB IDE selected")
private val externalIdeSelectedValue = GROUP.registerEvent("external.ide.selected.value", EventFields.Enum<TransferableIdeId>("externalIde"), "External IDE selected")
private val productPageShown = GROUP.registerEvent("page.product.shown", EventFields.Boolean("shown"))
private val jbIdeActualValues = GROUP.registerEvent("jb.ide.actual.values", JB_IDE_VALUES)
private val jbIdeOldValues = GROUP.registerEvent("jb.ide.old.values", JB_IDE_VALUES)
private val externalIdeValues = GROUP.registerEvent("external.ide.values", EXTERNAL_IDE_VALUES)
private val productPageButton = GROUP.registerEvent("page.product.button", FIRST_PAGE_BUTTONS)
private val jbIdeSelectedValue = GROUP.registerEvent("page.product.selected.jb.ide", EventFields.String("jbIde", ALLOWED_JB_IDES))
private val externalIdeSelectedValue = GROUP.registerEvent("external.ide.selected.value", EventFields.Enum<TransferableIdeId>("externalIde"))
private val productPageTimeSpent = GROUP.registerEvent("page.product.time.spent", EventFields.DurationMs)
private val productPageDropdownClicked = GROUP.registerEvent("page.product.dropdown.clicked",
EventFields.Enum<ProductPageDropdown>("dropdownId"),
"User clicked to the JB IDEs dropdown")
private val productPageDropdownClicked = GROUP.registerEvent("page.product.dropdown.clicked", EventFields.Enum<ProductPageDropdown>("dropdownId"))
//second page (configure) - JB IDE - select import details
private val configurePageShown = GROUP.registerEvent("page.configure.shown", IMPORT_TYPES)
private val jbIdeDisabledOptions = GROUP.registerEvent("page.configure.jb.disabled.categories",
JB_IMPORT_CATEGORIES,
"unselected options when importing from JB IDE")
private val jbIdeDisabledOptions = GROUP.registerEvent("page.configure.jb.disabled.categories", JB_IMPORT_CATEGORIES)
private val jbIdePlugins = GROUP.registerEvent(
"page.configure.jb.ide.plugins",
EventFields.Int("totalCount", "Total number of plugins that we've found during scanning"),
EventFields.Int("unselectedCount", "number of unselected plugins"),
"number of plugins and number of unselected plugins")
private val configurePageExpandClicked = GROUP.registerEvent("page.configure.expand.clicked",
EventFields.String("itemId", ITEMS_MULTIPLE_IDS),
"User clicked on configure/show all link")
private val configurePageButton = GROUP.registerEvent("page.configure.button", SECOND_PAGE_BUTTONS, "Button pressed on the second page")
EventFields.Int("unselectedCount", "number of unselected plugins"))
private val configurePageExpandClicked = GROUP.registerEvent("page.configure.expand.clicked", EventFields.String("itemId", ITEMS_MULTIPLE_IDS))
private val configurePageButton = GROUP.registerEvent("page.configure.button", SECOND_PAGE_BUTTONS)
private val configurePageTimeSpent = GROUP.registerEvent("page.configure.time.spent", EventFields.DurationMs)
private val featuredPluginsPageShown = GROUP.registerEvent("page.featured.plugins.shown",
"Indicates whether the Featured Plugins page was shown. Only for certain products (Rider) that include it.")
private val featuredPluginsPageShown = GROUP.registerEvent("page.featured.plugins.shown")
// third page - (import) progress dialog
private val importPageShown = GROUP.registerEvent("page.import.shown",
"Indicates whether the third page (import progress dialog) was shown. It's common for all import types")
private val importPageClosed = GROUP.registerEvent("page.import.closed",
"Indicates whether the third page (import progress dialog) was closed manually via button. " +
"That typically indicates a problem, because user doesn't want to wait for the import to finish")
private val importType = GROUP.registerEvent("import.type",
IMPORT_TYPES,
IMPORT_SOURCE,
"Which type of import is used (JB/NONJB/SYNC) and the source name")
private val pluginsImportTime = GROUP.registerEvent("import.plugins.time.spent", EventFields.DurationMs, "How long did it take to import plugins")
private val pluginsCounts = GROUP.registerEvent("import.plugins.counts",
EventFields.Long("imported"),
EventFields.Long("skipped"),
"How many plugins were imported during imported or skipped")
private val jbPluginImportType = GROUP.registerEvent("import.plugins.import.type", EventFields.Boolean("isNew"), "What plugin import type is used (new or legacy)")
private val importPageShown = GROUP.registerEvent("page.import.shown")
private val importPageClosed = GROUP.registerEvent("page.import.closed")
private val importType = GROUP.registerEvent("import.type", IMPORT_TYPES, IMPORT_SOURCE)
private val pluginsImportTime = GROUP.registerEvent("import.plugins.time.spent", EventFields.DurationMs)
private val pluginsCounts = GROUP.registerEvent("import.plugins.counts", EventFields.Long("imported"), EventFields.Long("skipped"))
private val jbPluginImportType = GROUP.registerEvent("import.plugins.import.type", EventFields.Boolean("isNew"))
private val jbPluginCantImport = GROUP.registerEvent("import.plugins.cant.import.reason", PLUGIN_CANT_IMPORT_REASONS)
private val optionsImportTime = GROUP.registerEvent("import.options.time.spent", EventFields.DurationMs, "How long did it take to import options and schemas")
private val totalImportTime = GROUP.registerEvent("import.total.time.spent", EventFields.DurationMs, "how long did it take to import everything")
private val optionsImportTime = GROUP.registerEvent("import.options.time.spent", EventFields.DurationMs)
private val totalImportTime = GROUP.registerEvent("import.total.time.spent", EventFields.DurationMs)
// after restart, but before showing welcome screen - reload last settings
private val afterImportRestartTime = GROUP.registerEvent("after.import.restart.time", EventFields.DurationMs, "How long did it take to restart")
private val afterImportRestartTime = GROUP.registerEvent("after.import.restart.time", EventFields.DurationMs)
/////// Methods
@@ -266,10 +245,11 @@ object ImportSettingsEventsCollector : CounterUsagesCollector() {
changePage(3)
}
fun jbImportStarted(jbIde: String,
selectedCategories: Collection<SettingsCategory>,
selectedPlugins: List<String>,
unselectedPlugins: List<String>
fun jbImportStarted(
jbIde: String,
selectedCategories: Collection<SettingsCategory>,
selectedPlugins: List<String>,
unselectedPlugins: List<String>,
) {
importType.log(ImportType.JB, jbIde)
changePage(3)
@@ -306,4 +286,4 @@ object ImportSettingsEventsCollector : CounterUsagesCollector() {
fun importFinished() {
changePage(0)
}
}
}
@@ -7,18 +7,10 @@ import com.intellij.internal.statistic.eventLog.events.EventId1
import com.intellij.internal.statistic.service.fus.collectors.CounterUsagesCollector
internal object DecompilerPresetChangedCollector : CounterUsagesCollector() {
private val GROUP: EventLogGroup = EventLogGroup(
id = "java.decompiler",
version = 1,
recorder = "FUS",
description = "This group contains events originating from the Java Bytecode Decompiler plugin.",
)
private val GROUP: EventLogGroup = EventLogGroup("java.decompiler", 1)
private val DECOMPILER_PRESET_CHANGED: EventId1<DecompilerPreset> = GROUP.registerEvent(
eventId = "decompiler.preset.changed",
eventField1 = EventFields.Enum("preset", DecompilerPreset::class.java),
description = "This event is collected whenever the user manually changes the decompiler preset while viewing decompiled bytecode.",
)
private val DECOMPILER_PRESET_CHANGED: EventId1<DecompilerPreset> =
GROUP.registerEvent("decompiler.preset.changed", EventFields.Enum("preset", DecompilerPreset::class.java))
override fun getGroup(): EventLogGroup = GROUP
@@ -35,7 +35,7 @@ internal class ScriptingSettingsFUSCollector: ProjectUsagesCollector() {
return metrics
}
private val GROUP = EventLogGroup("kotlin.ide.script.settings", 1, recorder = "FUS", "Kotlin statistics on script usages")
private val GROUP = EventLogGroup("kotlin.ide.script.settings", 1)
// scriptingAutoReloadEnabled Event
private val scriptingAREnabledField = EventFields.Boolean("enabled")
@@ -1,60 +1,57 @@
// Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
package org.jetbrains.idea.maven.statistics
import com.intellij.internal.statistic.IdeActivityDefinition
import com.intellij.internal.statistic.eventLog.EventLogGroup
import com.intellij.internal.statistic.eventLog.events.BooleanEventField
import com.intellij.internal.statistic.eventLog.events.EventFields
import com.intellij.internal.statistic.eventLog.events.EventId
import com.intellij.internal.statistic.eventLog.events.EventId3
import com.intellij.internal.statistic.eventLog.events.RoundedIntEventField
import com.intellij.internal.statistic.service.fus.collectors.CounterUsagesCollector
object MavenIndexUsageCollector : CounterUsagesCollector() {
val GROUP = EventLogGroup("maven.indexing", 3)
val GROUP: EventLogGroup = EventLogGroup("maven.indexing", 3)
@JvmField
val IS_LOCAL = EventFields.Boolean("is_local", "True if index for local repository")
val IS_LOCAL: BooleanEventField = EventFields.Boolean("is_local", "True if index for local repository")
@JvmField
val IS_CENTRAL = EventFields.Boolean("is_central", "True if index for central repository")
val IS_CENTRAL: BooleanEventField = EventFields.Boolean("is_central", "True if index for central repository")
@JvmField
val IS_PRIVATE_REMOTE = EventFields.Boolean("is_private", "True if index for remote repository and it is not maven cenral")
val IS_PRIVATE_REMOTE: BooleanEventField = EventFields.Boolean("is_private", "True if index for remote repository and it is not maven cenral")
@JvmField
val IS_SUCCESS = EventFields.Boolean("is_success", "True is index for central repository")
val IS_SUCCESS: BooleanEventField = EventFields.Boolean("is_success", "True is index for central repository")
@JvmField
val MANUAL = EventFields.Boolean("manual", "True if action triggered explicitly by user")
val MANUAL: BooleanEventField = EventFields.Boolean("manual", "True if action triggered explicitly by user")
@JvmField
val GROUPS_COUNT = EventFields.RoundedInt("groups_count", "Number of distinct groupIds")
val GROUPS_COUNT: RoundedIntEventField = EventFields.RoundedInt("groups_count", "Number of distinct groupIds")
@JvmField
val ARTIFACTS_COUNT = EventFields.RoundedInt("artifacts_count", "Number of scanned artifacts")
val ARTIFACTS_COUNT: RoundedIntEventField = EventFields.RoundedInt("artifacts_count", "Number of scanned artifacts")
@JvmField
val INDEX_UPDATE = GROUP.registerIdeActivity("index.update",
finishEventAdditionalFields = arrayOf(IS_LOCAL,
IS_CENTRAL,
IS_PRIVATE_REMOTE,
IS_SUCCESS,
MANUAL))
val INDEX_UPDATE: IdeActivityDefinition = GROUP.registerIdeActivity(
"index.update",
finishEventAdditionalFields = arrayOf(IS_LOCAL, IS_CENTRAL, IS_PRIVATE_REMOTE, IS_SUCCESS, MANUAL))
@JvmField
val GAV_INDEX_UPDATE = GROUP.registerIdeActivity("gav.index.update",
finishEventAdditionalFields = arrayOf(MANUAL,
IS_SUCCESS,
GROUPS_COUNT,
ARTIFACTS_COUNT))
val GAV_INDEX_UPDATE: IdeActivityDefinition = GROUP.registerIdeActivity(
"gav.index.update",
finishEventAdditionalFields = arrayOf(MANUAL, IS_SUCCESS, GROUPS_COUNT, ARTIFACTS_COUNT))
@JvmField
val INDEX_BROKEN = GROUP.registerEvent("index.broken", "Sent when broken index detected")
val INDEX_BROKEN: EventId = GROUP.registerEvent("index.broken")
@JvmField
val INDEX_OPENED = GROUP.registerEvent("index.open", IS_LOCAL, IS_CENTRAL,
IS_PRIVATE_REMOTE, "Sent when index opened")
val INDEX_OPENED: EventId3<Boolean, Boolean, Boolean> = GROUP.registerEvent("index.open", IS_LOCAL, IS_CENTRAL, IS_PRIVATE_REMOTE)
@JvmField
val ADD_ARTIFACT_FROM_POM = GROUP.registerEvent("artifact.from.pom.added", "triggered if index did't contain the artifact, while it is present on disk and was added to index by highlight process")
val ADD_ARTIFACT_FROM_POM: EventId = GROUP.registerEvent("artifact.from.pom.added")
override fun getGroup(): EventLogGroup = GROUP
}
@@ -168,8 +168,7 @@ object SearchEverywhereMLStatisticsCollector : CounterUsagesCollector() {
}
}
internal val GROUP = EventLogGroup("mlse.log", 129, MLSE_RECORDER_ID,
"ML in Search Everywhere Log Group")
internal val GROUP = EventLogGroup("mlse.log", 129, MLSE_RECORDER_ID)
internal val IS_INTERNAL = EventFields.Boolean("is_internal")
private val ORDER_BY_ML_GROUP = EventFields.Boolean("order_by_ml")
@@ -245,36 +244,24 @@ object SearchEverywhereMLStatisticsCollector : CounterUsagesCollector() {
private val CLASSES_WITHOUT_KEY_PROVIDERS_FIELD = ClassListEventField("unsupported_classes")
// region Events
internal val SESSION_STARTED: VarargEventId = GROUP.registerVarargEvent("session.started",
"An event denoting a start of Search Everywhere session",
SESSION_ID, IS_PROJECT_OPEN,
SE_TAB_ID_KEY, EXPERIMENT_GROUP, EXPERIMENT_VERSION,
IS_INTERNAL, SEARCH_START_TIME_KEY,
IS_PROJECT_DISPOSED_KEY,
FORCE_EXPERIMENT_GROUP,
IS_MIXED_LIST,
*SearchEverywhereContextFeaturesProvider.getContextFields().toTypedArray())
internal val SESSION_STARTED: VarargEventId = GROUP.registerVarargEvent(
"session.started",
SESSION_ID, IS_PROJECT_OPEN, SE_TAB_ID_KEY, EXPERIMENT_GROUP, EXPERIMENT_VERSION, IS_INTERNAL, SEARCH_START_TIME_KEY,
IS_PROJECT_DISPOSED_KEY, FORCE_EXPERIMENT_GROUP, IS_MIXED_LIST,
*SearchEverywhereContextFeaturesProvider.getContextFields().toTypedArray()
)
internal val STATE_CHANGED: VarargEventId = GROUP.registerVarargEvent("state.changed",
"An event denoting change of the search state",
SESSION_ID, SEARCH_INDEX_DATA_KEY,
ORDER_BY_ML_GROUP,
TOTAL_NUMBER_OF_ITEMS_DATA_KEY, SE_TAB_ID_KEY,
TIME_TO_FIRST_RESULT_DATA_KEY, REBUILD_REASON_KEY,
SEARCH_STATE_FEATURES_DATA_KEY, COLLECTED_RESULTS_DATA_KEY,
CONTRIBUTOR_FEATURES_LIST)
internal val ITEM_SELECTED: VarargEventId = GROUP.registerVarargEvent("item.selected",
"An event denoting selection of an item from search results",
SESSION_ID, SEARCH_INDEX_DATA_KEY,
SELECTED_INDEX)
internal val STATE_CHANGED: VarargEventId = GROUP.registerVarargEvent(
"state.changed",
SESSION_ID, SEARCH_INDEX_DATA_KEY, ORDER_BY_ML_GROUP, TOTAL_NUMBER_OF_ITEMS_DATA_KEY, SE_TAB_ID_KEY, TIME_TO_FIRST_RESULT_DATA_KEY,
REBUILD_REASON_KEY, SEARCH_STATE_FEATURES_DATA_KEY, COLLECTED_RESULTS_DATA_KEY, CONTRIBUTOR_FEATURES_LIST
)
internal val ITEM_SELECTED: VarargEventId = GROUP.registerVarargEvent("item.selected", SESSION_ID, SEARCH_INDEX_DATA_KEY, SELECTED_INDEX)
@VisibleForTesting
val SESSION_FINISHED: VarargEventId = GROUP.registerVarargEvent("session.finished",
"An event denoting finish of a session and closing of a popup",
SESSION_ID,
SESSION_DURATION, SE_TAB_ID_KEY)
internal val KEY_NOT_COMPUTED_EVENT = GROUP.registerEvent("key.not.computed",
SESSION_ID,
CLASSES_WITHOUT_KEY_PROVIDERS_FIELD)
val SESSION_FINISHED: VarargEventId = GROUP.registerVarargEvent("session.finished", SESSION_ID, SESSION_DURATION, SE_TAB_ID_KEY)
internal val KEY_NOT_COMPUTED_EVENT = GROUP.registerEvent("key.not.computed", SESSION_ID, CLASSES_WITHOUT_KEY_PROVIDERS_FIELD)
// endregion
}
@@ -44,29 +44,25 @@ object ReworkedTerminalUsageCollector : CounterUsagesCollector() {
private val THIRD_LARGEST_DURATION_FIELD = EventFields.createDurationField(DurationUnit.MILLISECONDS, "third_largest_duration_ms")
private val TEXT_LENGTH_90_FIELD = EventFields.Int("text_length_90", "90% percentile")
private val tabOpenedEvent = GROUP.registerEvent("tab.opened", TABS_COUNT, "Tabs count includes the currently opened tab")
private val tabOpenedEvent = GROUP.registerEvent("tab.opened", TABS_COUNT)
private val focusGainedEvent = GROUP.registerEvent("focus.gained", FOCUS)
private val focusLostEvent = GROUP.registerEvent("focus.lost", FOCUS)
private val localShellStartedEvent = GROUP.registerEvent("local.exec",
OS_VERSION_FIELD,
SHELL_STR_FIELD)
private val localShellStartedEvent = GROUP.registerEvent("local.exec", OS_VERSION_FIELD, SHELL_STR_FIELD)
private val commandStartedEvent = GROUP.registerEvent("terminal.command.executed",
TerminalCommandUsageStatistics.commandExecutableField,
TerminalCommandUsageStatistics.subCommandField,
"Fired each time when command is started")
private val commandStartedEvent = GROUP.registerEvent(
"terminal.command.executed",
TerminalCommandUsageStatistics.commandExecutableField, TerminalCommandUsageStatistics.subCommandField
)
private val commandFinishedEvent = GROUP.registerVarargEvent("terminal.command.finished",
"Fired each time when command is finished",
TerminalCommandUsageStatistics.commandExecutableField,
TerminalCommandUsageStatistics.subCommandField,
EXIT_CODE_FIELD,
EXECUTION_TIME_FIELD)
private val commandFinishedEvent = GROUP.registerVarargEvent(
"terminal.command.finished",
TerminalCommandUsageStatistics.commandExecutableField, TerminalCommandUsageStatistics.subCommandField, EXIT_CODE_FIELD, EXECUTION_TIME_FIELD
)
private val sessionRestoredEvent = GROUP.registerEvent("session.restored", TABS_COUNT, "Terminal tabs were restored on first opening of the Terminal tool window after startup")
private val sessionRestoredEvent = GROUP.registerEvent("session.restored", TABS_COUNT)
private val hyperlinkFollowedEvent = GROUP.registerEvent("hyperlink.followed", HYPERLINK_INFO_CLASS)
@@ -76,93 +72,55 @@ object ReworkedTerminalUsageCollector : CounterUsagesCollector() {
private val frontendTypingLatencyEvent = GROUP.registerVarargEvent(
"frontend.typing.latency",
"From receiving the key event to sending it to the backend",
TOTAL_DURATION_FIELD,
DURATION_90_FIELD,
SECOND_LARGEST_DURATION_FIELD,
OS_VERSION_FIELD,
TOTAL_DURATION_FIELD, DURATION_90_FIELD, SECOND_LARGEST_DURATION_FIELD, OS_VERSION_FIELD
)
private val backendTypingLatencyEvent = GROUP.registerVarargEvent(
"backend.typing.latency",
"From receiving the event from the frontend to sending it to the shell process",
TOTAL_DURATION_FIELD,
DURATION_90_FIELD,
SECOND_LARGEST_DURATION_FIELD,
OS_VERSION_FIELD,
TOTAL_DURATION_FIELD, DURATION_90_FIELD, SECOND_LARGEST_DURATION_FIELD, OS_VERSION_FIELD,
)
private val backendOutputLatencyEvent = GROUP.registerVarargEvent(
"backend.output.latency",
"From reading bytes from the shell to sending the text update to the frontend",
TOTAL_DURATION_FIELD,
DURATION_90_FIELD,
THIRD_LARGEST_DURATION_FIELD,
OS_VERSION_FIELD,
TOTAL_DURATION_FIELD, DURATION_90_FIELD, THIRD_LARGEST_DURATION_FIELD, OS_VERSION_FIELD,
)
private val frontendOutputLatencyEvent = GROUP.registerVarargEvent(
"frontend.output.latency",
"From receiving the content update event from the backend to displaying the change in the terminal editor",
TOTAL_DURATION_FIELD,
DURATION_90_FIELD,
THIRD_LARGEST_DURATION_FIELD,
OS_VERSION_FIELD,
TOTAL_DURATION_FIELD, DURATION_90_FIELD, THIRD_LARGEST_DURATION_FIELD, OS_VERSION_FIELD,
)
private val backendTextBufferCollectionLatencyEvent = GROUP.registerVarargEvent(
"backend.text.buffer.collection.latency",
TOTAL_DURATION_FIELD,
DURATION_90_FIELD,
THIRD_LARGEST_DURATION_FIELD,
TEXT_LENGTH_90_FIELD,
OS_VERSION_FIELD,
TOTAL_DURATION_FIELD, DURATION_90_FIELD, THIRD_LARGEST_DURATION_FIELD, TEXT_LENGTH_90_FIELD, OS_VERSION_FIELD,
)
private val backendDocumentUpdateLatencyEvent = GROUP.registerVarargEvent(
"backend.document.update.latency",
TOTAL_DURATION_FIELD,
DURATION_90_FIELD,
THIRD_LARGEST_DURATION_FIELD,
TEXT_LENGTH_90_FIELD,
OS_VERSION_FIELD,
TOTAL_DURATION_FIELD, DURATION_90_FIELD, THIRD_LARGEST_DURATION_FIELD, TEXT_LENGTH_90_FIELD, OS_VERSION_FIELD,
)
private val frontendDocumentUpdateLatencyEvent = GROUP.registerVarargEvent(
"frontend.document.update.latency",
TOTAL_DURATION_FIELD,
DURATION_90_FIELD,
THIRD_LARGEST_DURATION_FIELD,
TEXT_LENGTH_90_FIELD,
OS_VERSION_FIELD,
TOTAL_DURATION_FIELD, DURATION_90_FIELD, THIRD_LARGEST_DURATION_FIELD, TEXT_LENGTH_90_FIELD, OS_VERSION_FIELD,
)
private val startupCursorShowingLatency = GROUP.registerVarargEvent(
"startup.cursor.showing.latency",
"From the moment of UI interaction to showing the cursor in the terminal",
TERMINAL_OPENING_WAY,
DURATION_FIELD,
TERMINAL_OPENING_WAY, DURATION_FIELD,
)
private val startupShellStartingLatency = GROUP.registerVarargEvent(
"startup.shell.starting.latency",
"From the moment of UI interaction to the moment when the shell process is started and can accept the input",
TERMINAL_OPENING_WAY,
DURATION_FIELD,
TERMINAL_OPENING_WAY, DURATION_FIELD,
)
private val startupFirstOutputLatency = GROUP.registerVarargEvent(
"startup.first.output.latency",
"From the moment of UI interaction to showing the first meaningful output (any non-whitespace symbols)",
TERMINAL_OPENING_WAY,
DURATION_FIELD,
TERMINAL_OPENING_WAY, DURATION_FIELD,
)
private val tabClosingCheckLatency = GROUP.registerVarargEvent(
"tab.closing.check.latency",
"From the moment of UI interaction to closing the terminal tab or showing the confirmation dialog (reported for all terminal engines)",
DURATION_FIELD,
)
private val tabClosingCheckLatency = GROUP.registerVarargEvent("tab.closing.check.latency", DURATION_FIELD)
@JvmStatic
fun logTabOpened(project: Project, tabCount: Int) {
@@ -181,9 +139,7 @@ object ReworkedTerminalUsageCollector : CounterUsagesCollector() {
@JvmStatic
fun logLocalShellStarted(project: Project, shellCommand: String) {
localShellStartedEvent.log(project,
osVersion,
getShellNameForStat(shellCommand))
localShellStartedEvent.log(project, osVersion, getShellNameForStat(shellCommand))
}
@JvmStatic
@@ -194,11 +150,13 @@ object ReworkedTerminalUsageCollector : CounterUsagesCollector() {
fun logCommandFinished(project: Project, userCommandLine: String, exitCode: Int, executionTime: Duration) {
val commandData = TerminalCommandUsageStatistics.getLoggableCommandData(userCommandLine)
commandFinishedEvent.log(project,
TerminalCommandUsageStatistics.commandExecutableField with commandData?.command,
TerminalCommandUsageStatistics.subCommandField with commandData?.subCommand,
EXIT_CODE_FIELD with exitCode,
EXECUTION_TIME_FIELD with executionTime.inWholeMilliseconds)
commandFinishedEvent.log(
project,
TerminalCommandUsageStatistics.commandExecutableField with commandData?.command,
TerminalCommandUsageStatistics.subCommandField with commandData?.subCommand,
EXIT_CODE_FIELD with exitCode,
EXECUTION_TIME_FIELD with executionTime.inWholeMilliseconds
)
}
@JvmStatic
@@ -215,7 +173,6 @@ object ReworkedTerminalUsageCollector : CounterUsagesCollector() {
)
}
fun logBackendTypingLatency(totalDuration: Duration, duration90: Duration, secondLargestDuration: Duration) {
backendTypingLatencyEvent.log(
TOTAL_DURATION_FIELD with totalDuration,
@@ -225,7 +182,6 @@ object ReworkedTerminalUsageCollector : CounterUsagesCollector() {
)
}
fun logBackendOutputLatency(totalDuration: Duration, duration90: Duration, thirdLargestDuration: Duration) {
backendOutputLatencyEvent.log(
TOTAL_DURATION_FIELD with totalDuration,
@@ -32,9 +32,8 @@ internal class TerminalSettingsStateCollector : ApplicationUsagesCollector() {
private val NON_DEFAULT_SHELL = GROUP.registerEvent(
"non.default.shell",
EventFields.String("shell", TerminalShellInfoStatistics.KNOWN_SHELLS.toList()),
"User modified the default shell path"
)
private val NON_DEFAULT_TAB_NAME = GROUP.registerEvent("non.default.tab.name", "User modified the default terminal tab name")
private val NON_DEFAULT_TAB_NAME = GROUP.registerEvent("non.default.tab.name")
private val NON_DEFAULT_ENGINE = GROUP.registerEvent(
"non.default.engine",
EventFields.Enum<TerminalEngine>("engine")
@@ -49,13 +48,9 @@ internal class TerminalSettingsStateCollector : ApplicationUsagesCollector() {
)
private val NON_DEFAULT_COMMAND_COMPLETION_MODE = GROUP.registerEvent(
"non.default.command.completion.mode",
EventFields.Enum<TerminalCommandCompletionMode>("mode"),
"Users preference of showing completion popup automatically"
)
private val NON_DEFAULT_FONT_NAME = GROUP.registerEvent(
"non.default.font.name",
"User modified the default terminal font name",
EventFields.Enum<TerminalCommandCompletionMode>("mode")
)
private val NON_DEFAULT_FONT_NAME = GROUP.registerEvent("non.default.font.name")
private val NON_DEFAULT_FONT_SIZE = GROUP.registerEvent(
"non.default.font.size",
EventFields.Float("font_size"),
@@ -32,59 +32,52 @@ object TerminalUsageTriggerCollector : CounterUsagesCollector() {
private val EXECUTION_TIME_FIELD = EventFields.Long("execution_time", "Time in milliseconds")
private val sshExecEvent = GROUP.registerEvent("ssh.exec")
private val terminalSmartCommandExecutedEvent = GROUP.registerVarargEvent("terminal.smart.command.executed",
TERMINAL_COMMAND_HANDLER_FIELD,
RUN_ANYTHING_PROVIDER_FIELD)
private val terminalSmartCommandNotExecutedEvent = GROUP.registerVarargEvent("terminal.smart.command.not.executed",
TERMINAL_COMMAND_HANDLER_FIELD,
RUN_ANYTHING_PROVIDER_FIELD)
private val localExecEvent = GROUP.registerEvent("local.exec",
OS_VERSION_FIELD,
SHELL_STR_FIELD,
BLOCK_TERMINAL_FIELD)
private val terminalSmartCommandExecutedEvent = GROUP.registerVarargEvent(
"terminal.smart.command.executed",
TERMINAL_COMMAND_HANDLER_FIELD, RUN_ANYTHING_PROVIDER_FIELD
)
private val terminalSmartCommandNotExecutedEvent = GROUP.registerVarargEvent(
"terminal.smart.command.not.executed",
TERMINAL_COMMAND_HANDLER_FIELD, RUN_ANYTHING_PROVIDER_FIELD
)
private val localExecEvent = GROUP.registerEvent(
"local.exec",
OS_VERSION_FIELD, SHELL_STR_FIELD, BLOCK_TERMINAL_FIELD
)
/** New Terminal only event with additional information about shell version and plugins */
private val shellStartedEvent = GROUP.registerVarargEvent("local.shell.started",
OS_VERSION_FIELD,
SHELL_STR_FIELD,
TerminalShellInfoStatistics.shellVersionField,
TerminalShellInfoStatistics.promptThemeField,
TerminalShellInfoStatistics.isOhMyZshField,
TerminalShellInfoStatistics.isOhMyPoshField,
TerminalShellInfoStatistics.isP10KField,
TerminalShellInfoStatistics.isStarshipField,
TerminalShellInfoStatistics.isSpaceshipField,
TerminalShellInfoStatistics.isPreztoField,
TerminalShellInfoStatistics.isOhMyBashField,
TerminalShellInfoStatistics.isBashItField)
private val shellStartedEvent = GROUP.registerVarargEvent(
"local.shell.started",
OS_VERSION_FIELD, SHELL_STR_FIELD,
TerminalShellInfoStatistics.shellVersionField, TerminalShellInfoStatistics.promptThemeField, TerminalShellInfoStatistics.isOhMyZshField,
TerminalShellInfoStatistics.isOhMyPoshField, TerminalShellInfoStatistics.isP10KField, TerminalShellInfoStatistics.isStarshipField,
TerminalShellInfoStatistics.isSpaceshipField, TerminalShellInfoStatistics.isPreztoField, TerminalShellInfoStatistics.isOhMyBashField,
TerminalShellInfoStatistics.isBashItField
)
private val commandStartedEvent = GROUP.registerEvent(
"terminal.command.executed",
TerminalCommandUsageStatistics.commandExecutableField, TerminalCommandUsageStatistics.subCommandField, BLOCK_TERMINAL_FIELD
)
private val commandStartedEvent = GROUP.registerEvent("terminal.command.executed",
TerminalCommandUsageStatistics.commandExecutableField,
TerminalCommandUsageStatistics.subCommandField,
BLOCK_TERMINAL_FIELD,
"Fired each time when command is started")
private val timespanFinishedEvent = GROUP.registerEvent(
"terminal.timespan.finished",
SHELL_TYPE_FIELD, EventFields.Enum<TimeSpanType>("time_span_type"), EventFields.DurationMs
)
private val commandFinishedEvent = GROUP.registerVarargEvent(
"terminal.command.finished",
TerminalCommandUsageStatistics.commandExecutableField, TerminalCommandUsageStatistics.subCommandField,
EXIT_CODE_FIELD, EXECUTION_TIME_FIELD
)
private val timespanFinishedEvent = GROUP.registerEvent("terminal.timespan.finished",
SHELL_TYPE_FIELD,
EventFields.Enum<TimeSpanType>("time_span_type"),
EventFields.DurationMs,
"Logs performance/responsiveness metrics")
private val commandFinishedEvent = GROUP.registerVarargEvent("terminal.command.finished",
"Fired each time when command is finished. New Terminal only.",
TerminalCommandUsageStatistics.commandExecutableField,
TerminalCommandUsageStatistics.subCommandField,
EXIT_CODE_FIELD,
EXECUTION_TIME_FIELD)
private val commandGenerationEvent = GROUP.registerEvent("command.generation.event.happened",
EventFields.Enum<TerminalCommandGenerationEvent>("event_type"),
"Events related to generate command from natural language feature of New Terminal")
private val commandGenerationEvent = GROUP.registerEvent(
"command.generation.event.happened",
EventFields.Enum<TerminalCommandGenerationEvent>("event_type")
)
@JvmStatic
fun triggerSshShellStarted(project: Project) = sshExecEvent.log(project)
fun triggerSshShellStarted(project: Project): Unit = sshExecEvent.log(project)
@JvmStatic
fun triggerCommandStarted(project: Project, userCommandLine: String, isBlockTerminal: Boolean) {
@@ -99,20 +92,24 @@ object TerminalUsageTriggerCollector : CounterUsagesCollector() {
fun triggerCommandFinished(project: Project, userCommandLine: String, exitCode: Int, executionTime: Duration) {
val commandData = TerminalCommandUsageStatistics.getLoggableCommandData(userCommandLine)
commandFinishedEvent.log(project,
TerminalCommandUsageStatistics.commandExecutableField with commandData?.command,
TerminalCommandUsageStatistics.subCommandField with commandData?.subCommand,
EXIT_CODE_FIELD with exitCode,
EXECUTION_TIME_FIELD with executionTime.inWholeMilliseconds)
commandFinishedEvent.log(
project,
TerminalCommandUsageStatistics.commandExecutableField with commandData?.command,
TerminalCommandUsageStatistics.subCommandField with commandData?.subCommand,
EXIT_CODE_FIELD with exitCode,
EXECUTION_TIME_FIELD with executionTime.inWholeMilliseconds
)
}
@JvmStatic
fun triggerSmartCommand(project: Project,
workingDirectory: String?,
localSession: Boolean,
command: String,
handler: TerminalShellCommandHandler,
executed: Boolean) {
fun triggerSmartCommand(
project: Project,
workingDirectory: String?,
localSession: Boolean,
command: String,
handler: TerminalShellCommandHandler,
executed: Boolean,
) {
val data: MutableList<EventPair<*>> = mutableListOf(TERMINAL_COMMAND_HANDLER_FIELD.with(handler::class.java))
if (handler is TerminalFusAwareHandler) {
@@ -129,10 +126,12 @@ object TerminalUsageTriggerCollector : CounterUsagesCollector() {
@JvmStatic
fun triggerLocalShellStarted(project: Project, shellCommand: String, isBlockTerminal: Boolean) {
localExecEvent.log(project,
Version.parseVersion(SystemInfo.OS_VERSION)?.toCompactString() ?: "unknown",
TerminalShellInfoStatistics.getShellNameForStat(shellCommand),
isBlockTerminal)
localExecEvent.log(
project,
Version.parseVersion(SystemInfo.OS_VERSION)?.toCompactString() ?: "unknown",
TerminalShellInfoStatistics.getShellNameForStat(shellCommand),
isBlockTerminal
)
if (isBlockTerminal) {
val propertiesComponent = PropertiesComponent.getInstance()
val version = ApplicationInfo.getInstance().build.asStringWithoutProductCodeAndSnapshot()
@@ -144,19 +143,21 @@ object TerminalUsageTriggerCollector : CounterUsagesCollector() {
/** New Terminal only event with additional information about shell version and plugins */
internal fun triggerLocalShellStarted(project: Project, shellName: String, shellInfo: TerminalShellInfoStatistics.LoggableShellInfo) {
val osVersion = Version.parseVersion(SystemInfo.OS_VERSION)?.toCompactString() ?: "unknown"
shellStartedEvent.log(project,
OS_VERSION_FIELD with osVersion,
SHELL_STR_FIELD with shellName.lowercase(),
TerminalShellInfoStatistics.shellVersionField with shellInfo.shellVersion,
TerminalShellInfoStatistics.promptThemeField with shellInfo.promptTheme,
TerminalShellInfoStatistics.isOhMyZshField with shellInfo.isOhMyZsh,
TerminalShellInfoStatistics.isOhMyPoshField with shellInfo.isOhMyPosh,
TerminalShellInfoStatistics.isP10KField with shellInfo.isP10K,
TerminalShellInfoStatistics.isStarshipField with shellInfo.isStarship,
TerminalShellInfoStatistics.isSpaceshipField with shellInfo.isSpaceship,
TerminalShellInfoStatistics.isPreztoField with shellInfo.isPrezto,
TerminalShellInfoStatistics.isOhMyBashField with shellInfo.isOhMyBash,
TerminalShellInfoStatistics.isBashItField with shellInfo.isBashIt)
shellStartedEvent.log(
project,
OS_VERSION_FIELD with osVersion,
SHELL_STR_FIELD with shellName.lowercase(),
TerminalShellInfoStatistics.shellVersionField with shellInfo.shellVersion,
TerminalShellInfoStatistics.promptThemeField with shellInfo.promptTheme,
TerminalShellInfoStatistics.isOhMyZshField with shellInfo.isOhMyZsh,
TerminalShellInfoStatistics.isOhMyPoshField with shellInfo.isOhMyPosh,
TerminalShellInfoStatistics.isP10KField with shellInfo.isP10K,
TerminalShellInfoStatistics.isStarshipField with shellInfo.isStarship,
TerminalShellInfoStatistics.isSpaceshipField with shellInfo.isSpaceship,
TerminalShellInfoStatistics.isPreztoField with shellInfo.isPrezto,
TerminalShellInfoStatistics.isOhMyBashField with shellInfo.isOhMyBash,
TerminalShellInfoStatistics.isBashItField with shellInfo.isBashIt
)
}
fun triggerCommandGenerationEvent(project: Project, event: TerminalCommandGenerationEvent) {
@@ -181,4 +182,4 @@ private const val GROUP_ID = "terminalShell"
private const val BLOCK_TERMINAL_LAST_USED_VERSION = "BLOCK_TERMINAL_LAST_USED_VERSION"
/** Timestamp in seconds */
private const val BLOCK_TERMINAL_LAST_USED_DATE = "BLOCK_TERMINAL_LAST_USED_DATE"
private const val BLOCK_TERMINAL_LAST_USED_DATE = "BLOCK_TERMINAL_LAST_USED_DATE"
@@ -14,7 +14,7 @@ import org.jetbrains.annotations.ApiStatus
*/
@ApiStatus.Internal
object MiscProjectUsageCollector : CounterUsagesCollector() {
private val GROUP: EventLogGroup = EventLogGroup("pycharm.misc.project", 4)
private val GROUP = EventLogGroup("pycharm.misc.project", 4)
private val MISC_FILE_TYPE = EventFields.StringValidatedByCustomRule(
"file_type",
@@ -22,8 +22,8 @@ object MiscProjectUsageCollector : CounterUsagesCollector() {
"The type of a newly created misc project"
)
private val MISC_PROJECT_CREATED: VarargEventId = GROUP.registerVarargEvent("misc.project.created", "Misc project created (user clicked on the button on the welcome screen)", MISC_FILE_TYPE)
private val MISC_PROJECT_RENAMED: EventId = GROUP.registerEvent("misc.project.renamed", "Misc project renamed")
private val MISC_PROJECT_CREATED: VarargEventId = GROUP.registerVarargEvent("misc.project.created", MISC_FILE_TYPE)
private val MISC_PROJECT_RENAMED: EventId = GROUP.registerEvent("misc.project.renamed")
override fun getGroup(): EventLogGroup = GROUP
@@ -7,72 +7,38 @@ import org.jetbrains.annotations.ApiStatus
@ApiStatus.Internal
object ProcessOutputUsageCollector : CounterUsagesCollector() {
private val GROUP: EventLogGroup = EventLogGroup(
"pycharm.processOutputToolWindow",
version = 2,
recorder = "FUS",
description = "Statistics for PyCharm's Process Output Tool Window",
)
private val GROUP: EventLogGroup = EventLogGroup("pycharm.processOutputToolWindow", 2)
private val TOGGLED_FIELD = EventFields.Boolean("enabled")
private val TREE_PROCESS_SELECTED = GROUP.registerEvent(
"tree.processSelected",
"Process selected",
)
private val TREE_SEARCH_EDITED = GROUP.registerEvent(
"tree.searchEdited",
"Process search field edited",
)
private val TREE_PROCESS_SELECTED = GROUP.registerEvent("tree.processSelected")
private val TREE_SEARCH_EDITED = GROUP.registerEvent("tree.searchEdited")
private val TREE_FILTER_TIME_TOGGLED = GROUP.registerVarargEvent(
"tree.filter.timeToggled",
"Time filter toggled",
TOGGLED_FIELD,
)
private val TREE_FILTER_BACKGROUND_PROCESSES_TOGGLED = GROUP.registerVarargEvent(
"tree.filter.backgroundProcessesToggled",
"Background processes filter toggled",
TOGGLED_FIELD,
)
private val TREE_EXPAND_ALL_CLICKED = GROUP.registerEvent(
"tree.expandAllClicked",
"Expand all clicked",
)
private val TREE_COLLAPSE_ALL_CLICKED = GROUP.registerEvent(
"tree.collapseAllClicked",
"Collapse all clicked",
)
private val TREE_EXPAND_ALL_CLICKED = GROUP.registerEvent("tree.expandAllClicked")
private val TREE_COLLAPSE_ALL_CLICKED = GROUP.registerEvent("tree.collapseAllClicked")
private val OUTPUT_FILTER_SHOW_TAGS_TOGGLED = GROUP.registerVarargEvent(
"output.filter.showTagsToggled",
"Show tags filter toggled",
TOGGLED_FIELD,
)
private val OUTPUT_COPY_CLICKED = GROUP.registerVarargEvent(
"output.copyClicked",
"Copy clicked",
)
private val OUTPUT_TAG_SECTION_COPY_CLICKED = GROUP.registerVarargEvent(
"output.copyTagSectionClicked",
"Copy tag section clicked",
)
private val OUTPUT_EXIT_INFO_COPY_CLICKED = GROUP.registerVarargEvent(
"output.copyExitInfoClicked",
"Copy exit info clicked",
)
private val OUTPUT_COPY_CLICKED = GROUP.registerVarargEvent("output.copyClicked")
private val OUTPUT_TAG_SECTION_COPY_CLICKED = GROUP.registerVarargEvent("output.copyTagSectionClicked")
private val OUTPUT_EXIT_INFO_COPY_CLICKED = GROUP.registerVarargEvent("output.copyExitInfoClicked")
private val OUTPUT_PROCESS_INFO_TOGGLED = GROUP.registerVarargEvent(
"output.processInfoToggled",
"Process info section toggled",
TOGGLED_FIELD,
)
private val OUTPUT_PROCESS_OUTPUT_TOGGLED = GROUP.registerVarargEvent(
"output.processOutputToggled",
"Process output section toggled",
TOGGLED_FIELD,
)
private val TOOLWINDOW_OPENED_DUE_TO_ERROR = GROUP.registerEvent(
"toolwindow.openedDueToError",
"Toolwindow opened due to error",
)
private val TOOLWINDOW_OPENED_DUE_TO_ERROR = GROUP.registerEvent("toolwindow.openedDueToError")
override fun getGroup(): EventLogGroup = GROUP
@@ -3,7 +3,6 @@ package com.intellij.python.pyproject.statistics
import com.intellij.internal.statistic.beans.MetricEvent
import com.intellij.internal.statistic.eventLog.EventLogGroup
import com.intellij.internal.statistic.eventLog.FUS_RECORDER
import com.intellij.internal.statistic.eventLog.events.EventFields
import com.intellij.internal.statistic.service.fus.collectors.ProjectUsagesCollector
import com.intellij.openapi.project.Project
@@ -23,31 +22,30 @@ import org.toml.lang.psi.TomlLiteral
import org.toml.lang.psi.TomlTable
import java.util.concurrent.atomic.AtomicInteger
internal val PYTHON_TOOL_MARKERS: Map<String, Set<String>> = mapOf(
"bandit" to setOf(".bandit"),
"black" to setOf("black.toml"),
"codespell" to setOf(".codespellrc"),
"coverage" to setOf(".coveragerc"),
"flit" to setOf("flit.ini"),
"flake8" to setOf(".flake8"),
"great-expectations" to setOf("great_expectations.yml"),
"hatch" to setOf("hatch.toml", "hatch.lock"),
"hypothesis" to setOf(".hypothesis"),
"isort" to setOf(".isort.cfg"),
"mypy" to setOf("mypy.ini", ".mypy.ini"),
"nox" to setOf("noxfile.py"),
"pdm" to setOf("pdm.lock"),
"pixi" to setOf("pixi.toml", "pixi.lock"),
"poetry" to setOf("poetry.lock"),
"prefect" to setOf("prefect.yaml"),
"pyright" to setOf("pyrightconfig.json"),
"pytest" to setOf("pytest.toml", ".pytest.toml", "pytest.ini", ".pytest.ini"),
"ruff" to setOf("ruff.toml", ".ruff.toml"),
"setuptools" to setOf("setup.py", "setup.cfg"),
"tox" to setOf("tox.ini", "tox.toml"),
"uv" to setOf("uv.lock"),
"yapf" to setOf(".style.yapf")
"bandit" to setOf(".bandit"),
"black" to setOf("black.toml"),
"codespell" to setOf(".codespellrc"),
"coverage" to setOf(".coveragerc"),
"flit" to setOf("flit.ini"),
"flake8" to setOf(".flake8"),
"great-expectations" to setOf("great_expectations.yml"),
"hatch" to setOf("hatch.toml", "hatch.lock"),
"hypothesis" to setOf(".hypothesis"),
"isort" to setOf(".isort.cfg"),
"mypy" to setOf("mypy.ini", ".mypy.ini"),
"nox" to setOf("noxfile.py"),
"pdm" to setOf("pdm.lock"),
"pixi" to setOf("pixi.toml", "pixi.lock"),
"poetry" to setOf("poetry.lock"),
"prefect" to setOf("prefect.yaml"),
"pyright" to setOf("pyrightconfig.json"),
"pytest" to setOf("pytest.toml", ".pytest.toml", "pytest.ini", ".pytest.ini"),
"ruff" to setOf("ruff.toml", ".ruff.toml"),
"setuptools" to setOf("setup.py", "setup.cfg"),
"tox" to setOf("tox.ini", "tox.toml"),
"uv" to setOf("uv.lock"),
"yapf" to setOf(".style.yapf")
)
internal val TRACKED_DEPENDENCY_GROUPS = listOf(
@@ -59,42 +57,24 @@ internal val TRACKED_DEPENDENCY_GROUPS = listOf(
)
internal const val DEPENDENCY_GROUP_OTHER = "other"
private val GROUP = EventLogGroup("python.toml.stats", 3, FUS_RECORDER, "Python Project Statistics")
private val GROUP = EventLogGroup("python.toml.stats", 3)
private val PACKAGE_NAME_FIELD = EventFields.StringValidatedByDictionary("name", "python_packages.ndjson")
internal val PYTHON_PYPROJECT_TOOLS = GROUP.registerEvent(
"python.pyproject.tools",
PACKAGE_NAME_FIELD,
"A Python tool defined in the [tool.*] table of pyproject.toml"
)
internal val PYTHON_PYPROJECT_TOOLS = GROUP.registerEvent("python.pyproject.tools", PACKAGE_NAME_FIELD)
// https://peps.python.org/pep-0518/
internal val PYTHON_PYPROJECT_BUILDSYSTEM = GROUP.registerEvent(
"python.pyproject.buildsystem",
PACKAGE_NAME_FIELD,
"A Python tool defined in build-system.requires of pyproject.toml"
)
internal val PYTHON_PYPROJECT_BUILDSYSTEM = GROUP.registerEvent("python.pyproject.buildsystem", PACKAGE_NAME_FIELD)
internal val PYTHON_TOOL_MARKERS_DETECTED = GROUP.registerEvent(
"python.tool.markers.detected",
PACKAGE_NAME_FIELD,
"A Python tool detected via tool marker files (e.g., uv.lock, hatch.toml)"
)
internal val PYTHON_TOOL_MARKERS_DETECTED = GROUP.registerEvent("python.tool.markers.detected", PACKAGE_NAME_FIELD)
internal val PYTHON_PYPROJECT_DEPENDENCY_GROUP = GROUP.registerEvent(
"python.pyproject.dependency.group",
EventFields.String("name", TRACKED_DEPENDENCY_GROUPS + DEPENDENCY_GROUP_OTHER),
"A dependency group from pyproject.toml"
EventFields.String("name", TRACKED_DEPENDENCY_GROUPS + DEPENDENCY_GROUP_OTHER)
)
internal val PYTHON_PYPROJECT_COUNT = GROUP.registerEvent(
"python.pyproject.count",
EventFields.Int("count"),
"Number of pyproject.toml files (python projects) in the workspace"
)
internal val PYTHON_PYPROJECT_COUNT = GROUP.registerEvent("python.pyproject.count", EventFields.Int("count"))
internal class PythonTomlStatsUsagesCollector : ProjectUsagesCollector() {
override fun getGroup(): EventLogGroup = GROUP
override fun requiresReadAccess() = true
@@ -16,11 +16,11 @@ import com.intellij.openapi.project.Project
* Logs how many runs are started via a run tool and the tool id.
*/
internal object PyRunToolUsageCollector : CounterUsagesCollector() {
private val GROUP = EventLogGroup("python.run.tool", 1, "FUS", "Tracks Python run configurations executed with specific run tools (e.g., uv run)")
private val GROUP = EventLogGroup("python.run.tool", 1)
private val TOOL_ID = EventFields.StringValidatedByCustomRule("run_tool_id", PyRunToolIdValidator::class.java)
private val RUN_USED: EventId1<String?> = GROUP.registerEvent("run.used", TOOL_ID, "Execution of Python run configurations with specific run tool")
private val RUN_USED: EventId1<String?> = GROUP.registerEvent("run.used", TOOL_ID)
@JvmStatic
fun logRun(project: Project, runToolId: String) {
@@ -46,4 +46,4 @@ internal class PyRunToolIdValidator : CustomValidationRule() {
return if (data in validIds) ValidationResultType.ACCEPTED else ValidationResultType.REJECTED
}
}
}