Set<MetricEvent> (@NotNull Project project) { if (!TrustedProjects.isTrusted(project)) return Collections.emptySet(); VcsProjectLog projectLog = project.getServiceIfCreated(VcsProjectLog.class); if (projectLog != null) { MainVcsLogUi ui = projectLog.getMainLogUi(); if (ui != null) { MainVcsLogUiProperties properties = ui.getProperties(); VcsLogUiProperties defaultProperties = createDefaultPropertiesInstance(); Set<MetricEvent> metricEvents = ContainerUtil.newHashSet(UI_INITIALIZED.metric()); addBoolIfDiffers(metricEvents, properties, defaultProperties, getter(SHOW_DETAILS), DETAILS); addBoolIfDiffers(metricEvents, properties, defaultProperties, getter(SHOW_DIFF_PREVIEW), DIFF_PREVIEW); addBoolIfDiffers(metricEvents, properties, defaultProperties, getter(DIFF_PREVIEW_VERTICAL_SPLIT), DIFF_PREVIEW_ON_THE_BOTTOM); addBoolIfDiffers(metricEvents, properties, defaultProperties, getter(SHOW_CHANGES_FROM_PARENTS), PARENT_CHANGES); addBoolIfDiffers(metricEvents, properties, defaultProperties, getter(SHOW_ONLY_AFFECTED_CHANGES), ONLY_AFFECTED_CHANGES); addBoolIfDiffers(metricEvents, properties, defaultProperties, getter(SHOW_LONG_EDGES), LONG_EDGES); addIfDiffers(metricEvents, properties, defaultProperties, getter(BEK_SORT_TYPE), SORT, SORT_TYPE_FIELD); if (ui.getColorManager().hasMultiplePaths()) { addBoolIfDiffers(metricEvents, properties, defaultProperties, getter(SHOW_ROOT_NAMES), ROOTS); } addBoolIfDiffers(metricEvents, properties, defaultProperties, getter(COMPACT_REFERENCES_VIEW), LABELS_COMPACT); addBoolIfDiffers(metricEvents, properties, defaultProperties, getter(SHOW_TAG_NAMES), LABELS_SHOW_TAG_NAMES); addBoolIfDiffers(metricEvents, properties, defaultProperties, getter(LABELS_LEFT_ALIGNED), LABELS_ON_THE_LEFT); addBoolIfDiffers(metricEvents, properties, defaultProperties, getter(MainVcsLogUiProperties.TEXT_FILTER_REGEX), TEXT_FILTER_REGEX); addBoolIfDiffers(metricEvents, properties, defaultProperties, getter(MainVcsLogUiProperties.TEXT_FILTER_MATCH_CASE), TEXT_FILTER_MATCH_CASE); for (VcsLogHighlighterFactory factory : LOG_HIGHLIGHTER_FACTORY_EP.getExtensionList()) { if (factory.showMenuItem()) { addBoolIfDiffers(metricEvents, properties, defaultProperties, getter(VcsLogHighlighterProperty.get(factory.getId())), HIGHLIGHTER, new ArrayList<>(List.of(LOG_HIGHLIGHTER_ID_FIELD.with(getFactoryIdSafe(factory))))); } } for (VcsLogFilterCollection.FilterKey<?> key : VcsLogFilterCollection.STANDARD_KEYS) { if (properties.getFilterValues(key.getName()) != null) { metricEvents.add(FILTER.metric(EventFields.Enabled.with(true), FILTER_NAME.with(key.getName()))); } } VcsLogColumnManager modelIndices = VcsLogColumnManager.getInstance(); Set<Integer> currentColumns = ContainerUtil.map2Set(getColumnsOrder(properties), it -> modelIndices.getModelIndex(it)); Set<Integer> defaultColumns = ContainerUtil.map2Set(getColumnsOrder(defaultProperties), it -> modelIndices.getModelIndex(it)); for (VcsLogDefaultColumn<?> column : getDefaultDynamicColumns()) { String columnName = column.getStableName(); addBoolIfDiffers(metricEvents, currentColumns, defaultColumns, p -> p.contains(modelIndices.getModelIndex(column)), COLUMN, new ArrayList<>(List.of(COLUMN_NAME.with(columnName)))); } VcsLogTabsManager tabManager = projectLog.getTabManager(); if (tabManager != null) { Collection<String> tabs = tabManager.getTabs(); metricEvents.add(ADDITIONAL_TABS.metric(EventFields.Count.with(tabs.size()))); } return metricEvents; } } return Collections.emptySet(); }