mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
all stats should be stored in one file, usage.statistics.xml
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
package com.intellij.configurationStore
|
||||
|
||||
import com.intellij.ide.util.PropertiesComponent
|
||||
import com.intellij.internal.statistic.persistence.UsageStatisticsPersistenceComponent
|
||||
import com.intellij.openapi.application.ApplicationManager
|
||||
import com.intellij.openapi.application.PathManager
|
||||
import com.intellij.openapi.application.ex.PathManagerEx
|
||||
@@ -102,8 +103,7 @@ class DoNotSaveDefaultsTest {
|
||||
componentManager.stateStore.storageManager.expandMacros(APP_CONFIG)), setOf(
|
||||
"path.macros.xml" /* todo EP to register (provide) macro dynamically */,
|
||||
"stubIndex.xml" /* low-level non-roamable stuff */,
|
||||
"usage.statistics.xml" /* SHOW_NOTIFICATION_ATTR in internal mode */,
|
||||
"feature.usage.statistics.xml" /* non-roamable usage counters */,
|
||||
UsageStatisticsPersistenceComponent.USAGE_STATISTICS_XML /* SHOW_NOTIFICATION_ATTR in internal mode */,
|
||||
"tomee.extensions.xml", "jboss.extensions.xml",
|
||||
"glassfish.extensions.xml" /* javaee non-roamable stuff, it will be better to fix it */,
|
||||
"dimensions.xml" /* non-roamable sizes of window, dialogs, etc. */,
|
||||
|
||||
+5
-1
@@ -1,6 +1,7 @@
|
||||
// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
package com.intellij.featureStatistics;
|
||||
|
||||
import com.intellij.internal.statistic.persistence.UsageStatisticsPersistenceComponent;
|
||||
import com.intellij.openapi.components.PersistentStateComponent;
|
||||
import com.intellij.openapi.components.RoamingType;
|
||||
import com.intellij.openapi.components.State;
|
||||
@@ -17,7 +18,10 @@ import java.util.Set;
|
||||
@SuppressWarnings({"NonPrivateFieldAccessedInSynchronizedContext"})
|
||||
@State(
|
||||
name = "FeatureUsageStatistics",
|
||||
storages = @Storage(value = "feature.usage.statistics.xml", roamingType = RoamingType.DISABLED)
|
||||
storages = {
|
||||
@Storage(value = UsageStatisticsPersistenceComponent.USAGE_STATISTICS_XML, roamingType = RoamingType.DISABLED),
|
||||
@Storage(value = "feature.usage.statistics.xml", roamingType = RoamingType.DISABLED, deprecated = true)
|
||||
}
|
||||
)
|
||||
public class FeatureUsageTrackerImpl extends FeatureUsageTracker implements PersistentStateComponent<Element> {
|
||||
private static final int HOUR = 1000 * 60 * 60;
|
||||
|
||||
+5
-1
@@ -6,6 +6,7 @@ import com.intellij.internal.statistic.beans.GroupDescriptor;
|
||||
import com.intellij.internal.statistic.beans.UsageDescriptor;
|
||||
import com.intellij.internal.statistic.persistence.ApplicationStatisticsPersistence;
|
||||
import com.intellij.internal.statistic.persistence.CollectedUsages;
|
||||
import com.intellij.internal.statistic.persistence.UsageStatisticsPersistenceComponent;
|
||||
import com.intellij.internal.statistic.utils.StatisticsUploadAssistant;
|
||||
import com.intellij.openapi.application.ApplicationManager;
|
||||
import com.intellij.openapi.components.*;
|
||||
@@ -27,7 +28,10 @@ import java.util.concurrent.TimeUnit;
|
||||
|
||||
@State(
|
||||
name = "StatisticsApplicationUsages",
|
||||
storages = @Storage(value = "statistics.application.usages.xml", roamingType = RoamingType.DISABLED)
|
||||
storages = {
|
||||
@Storage(value = UsageStatisticsPersistenceComponent.USAGE_STATISTICS_XML, roamingType = RoamingType.DISABLED),
|
||||
@Storage(value = "statistics.application.usages.xml", roamingType = RoamingType.DISABLED, deprecated = true)
|
||||
}
|
||||
)
|
||||
public class ApplicationStatisticsPersistenceComponent extends ApplicationStatisticsPersistence implements
|
||||
PersistentStateComponent<Element>,
|
||||
|
||||
@@ -4,6 +4,7 @@ package com.intellij.internal.statistic;
|
||||
import com.intellij.internal.statistic.beans.ConvertUsagesUtil;
|
||||
import com.intellij.internal.statistic.beans.GroupDescriptor;
|
||||
import com.intellij.internal.statistic.beans.UsageDescriptor;
|
||||
import com.intellij.internal.statistic.persistence.UsageStatisticsPersistenceComponent;
|
||||
import com.intellij.openapi.components.*;
|
||||
import com.intellij.util.containers.ContainerUtil;
|
||||
import com.intellij.util.xmlb.annotations.MapAnnotation;
|
||||
@@ -17,7 +18,10 @@ import java.util.Set;
|
||||
|
||||
@State(
|
||||
name = "UsageTrigger",
|
||||
storages = @Storage(value = "statistics.application.usages.xml", roamingType = RoamingType.DISABLED)
|
||||
storages = {
|
||||
@Storage(value = UsageStatisticsPersistenceComponent.USAGE_STATISTICS_XML, roamingType = RoamingType.DISABLED),
|
||||
@Storage(value = "statistics.application.usages.xml", roamingType = RoamingType.DISABLED, deprecated = true)
|
||||
}
|
||||
)
|
||||
public class UsageTrigger implements PersistentStateComponent<UsageTrigger.State> {
|
||||
final static class State {
|
||||
|
||||
+5
-1
@@ -5,6 +5,7 @@ import com.intellij.internal.statistic.UsagesCollector;
|
||||
import com.intellij.internal.statistic.beans.ConvertUsagesUtil;
|
||||
import com.intellij.internal.statistic.beans.GroupDescriptor;
|
||||
import com.intellij.internal.statistic.beans.UsageDescriptor;
|
||||
import com.intellij.internal.statistic.persistence.UsageStatisticsPersistenceComponent;
|
||||
import com.intellij.openapi.components.*;
|
||||
import com.intellij.util.containers.ContainerUtil;
|
||||
import com.intellij.util.xmlb.annotations.MapAnnotation;
|
||||
@@ -21,7 +22,10 @@ import java.util.Set;
|
||||
*/
|
||||
@State(
|
||||
name = "ActionsCollector",
|
||||
storages = @Storage(value = "statistics.actions.xml", roamingType = RoamingType.DISABLED)
|
||||
storages = {
|
||||
@Storage(value = UsageStatisticsPersistenceComponent.USAGE_STATISTICS_XML, roamingType = RoamingType.DISABLED),
|
||||
@Storage(value = "statistics.actions.xml", roamingType = RoamingType.DISABLED, deprecated = true)
|
||||
}
|
||||
)
|
||||
public class ActionsCollector implements PersistentStateComponent<ActionsCollector.State> {
|
||||
public void record(String actionId) {
|
||||
|
||||
+5
-1
@@ -8,6 +8,7 @@ import com.intellij.codeInspection.ex.QuickFixWrapper;
|
||||
import com.intellij.internal.statistic.UsagesCollector;
|
||||
import com.intellij.internal.statistic.beans.GroupDescriptor;
|
||||
import com.intellij.internal.statistic.beans.UsageDescriptor;
|
||||
import com.intellij.internal.statistic.persistence.UsageStatisticsPersistenceComponent;
|
||||
import com.intellij.lang.Language;
|
||||
import com.intellij.openapi.components.*;
|
||||
import com.intellij.openapi.util.text.StringUtil;
|
||||
@@ -24,7 +25,10 @@ import java.util.*;
|
||||
*/
|
||||
@State(
|
||||
name = "IntentionsCollector",
|
||||
storages = @Storage(value = "statistics.intentions.xml", roamingType = RoamingType.DISABLED)
|
||||
storages = {
|
||||
@Storage(value = UsageStatisticsPersistenceComponent.USAGE_STATISTICS_XML, roamingType = RoamingType.DISABLED),
|
||||
@Storage(value = "statistics.intentions.xml", roamingType = RoamingType.DISABLED, deprecated = true)
|
||||
}
|
||||
)
|
||||
public class IntentionsCollector implements PersistentStateComponent<IntentionsCollector.State> {
|
||||
private State myState = new State();
|
||||
|
||||
+5
-1
@@ -5,6 +5,7 @@ import com.intellij.internal.statistic.UsagesCollector;
|
||||
import com.intellij.internal.statistic.beans.ConvertUsagesUtil;
|
||||
import com.intellij.internal.statistic.beans.GroupDescriptor;
|
||||
import com.intellij.internal.statistic.beans.UsageDescriptor;
|
||||
import com.intellij.internal.statistic.persistence.UsageStatisticsPersistenceComponent;
|
||||
import com.intellij.openapi.actionSystem.AnAction;
|
||||
import com.intellij.openapi.actionSystem.impl.ActionMenu;
|
||||
import com.intellij.openapi.components.*;
|
||||
@@ -28,7 +29,10 @@ import java.util.stream.Collectors;
|
||||
*/
|
||||
@State(
|
||||
name = "MainMenuCollector",
|
||||
storages = @Storage(value = "statistics.main_menu.xml", roamingType = RoamingType.DISABLED)
|
||||
storages = {
|
||||
@Storage(value = UsageStatisticsPersistenceComponent.USAGE_STATISTICS_XML, roamingType = RoamingType.DISABLED),
|
||||
@Storage(value = "statistics.main_menu.xml", roamingType = RoamingType.DISABLED, deprecated = true)
|
||||
}
|
||||
)
|
||||
public class MainMenuCollector implements PersistentStateComponent<MainMenuCollector.State> {
|
||||
private State myState = new State();
|
||||
|
||||
+5
-1
@@ -4,6 +4,7 @@ package com.intellij.internal.statistic.customUsageCollectors.ui;
|
||||
import com.intellij.internal.statistic.UsagesCollector;
|
||||
import com.intellij.internal.statistic.beans.GroupDescriptor;
|
||||
import com.intellij.internal.statistic.beans.UsageDescriptor;
|
||||
import com.intellij.internal.statistic.persistence.UsageStatisticsPersistenceComponent;
|
||||
import com.intellij.openapi.actionSystem.AnActionEvent;
|
||||
import com.intellij.openapi.actionSystem.KeyboardShortcut;
|
||||
import com.intellij.openapi.components.*;
|
||||
@@ -34,7 +35,10 @@ import static java.awt.event.KeyEvent.*;
|
||||
*/
|
||||
@State(
|
||||
name = "ShortcutsCollector",
|
||||
storages = @Storage(value = "statistics.shortcuts.xml", roamingType = RoamingType.DISABLED)
|
||||
storages = {
|
||||
@Storage(value = UsageStatisticsPersistenceComponent.USAGE_STATISTICS_XML, roamingType = RoamingType.DISABLED),
|
||||
@Storage(value = "statistics.shortcuts.xml", roamingType = RoamingType.DISABLED, deprecated = true)
|
||||
}
|
||||
)
|
||||
public class ShortcutsCollector implements PersistentStateComponent<ShortcutsCollector.MyState> {
|
||||
final static class MyState {
|
||||
|
||||
+5
-1
@@ -5,6 +5,7 @@ import com.intellij.internal.statistic.UsagesCollector;
|
||||
import com.intellij.internal.statistic.beans.ConvertUsagesUtil;
|
||||
import com.intellij.internal.statistic.beans.GroupDescriptor;
|
||||
import com.intellij.internal.statistic.beans.UsageDescriptor;
|
||||
import com.intellij.internal.statistic.persistence.UsageStatisticsPersistenceComponent;
|
||||
import com.intellij.openapi.actionSystem.ActionManager;
|
||||
import com.intellij.openapi.actionSystem.ActionWithDelegate;
|
||||
import com.intellij.openapi.actionSystem.AnAction;
|
||||
@@ -23,7 +24,10 @@ import java.util.Set;
|
||||
*/
|
||||
@State(
|
||||
name = "ToolbarClicksCollector",
|
||||
storages = @Storage(value = "statistics.toolbar.clicks.xml", roamingType = RoamingType.DISABLED)
|
||||
storages = {
|
||||
@Storage(value = UsageStatisticsPersistenceComponent.USAGE_STATISTICS_XML, roamingType = RoamingType.DISABLED),
|
||||
@Storage(value = "statistics.toolbar.clicks.xml", roamingType = RoamingType.DISABLED, deprecated = true)
|
||||
}
|
||||
)
|
||||
public class ToolbarClicksCollector implements PersistentStateComponent<ToolbarClicksCollector.ClicksState> {
|
||||
final static class ClicksState {
|
||||
|
||||
+2
-1
@@ -21,10 +21,11 @@ import java.util.Set;
|
||||
|
||||
@State(
|
||||
name = "UsagesStatistic",
|
||||
storages = @Storage(value = "usage.statistics.xml", roamingType = RoamingType.DISABLED)
|
||||
storages = @Storage(value = UsageStatisticsPersistenceComponent.USAGE_STATISTICS_XML, roamingType = RoamingType.DISABLED)
|
||||
)
|
||||
public class UsageStatisticsPersistenceComponent extends BasicSentUsagesPersistenceComponent
|
||||
implements NamedComponent, PersistentStateComponent<Element> {
|
||||
public static final String USAGE_STATISTICS_XML = "usage.statistics.xml";
|
||||
|
||||
@NonNls private boolean isShowNotification = true;
|
||||
@NotNull private SendPeriod myPeriod = SendPeriod.DAILY;
|
||||
|
||||
@@ -1,18 +1,4 @@
|
||||
/*
|
||||
* Copyright 2000-2017 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
package com.intellij.openapi.components;
|
||||
|
||||
import org.jetbrains.annotations.NonNls;
|
||||
@@ -33,7 +19,9 @@ public @interface Storage {
|
||||
|
||||
/**
|
||||
* Relative to component container configuration root path.
|
||||
* Consider to use shorthand form - {@code @Storage("yourName.xml")} (when you need to specify only file path).
|
||||
* Consider using shorthand form - {@code @Storage("yourName.xml")} (when you need to specify only file path).
|
||||
*
|
||||
* Consider reusing existing storage files instead of a new one. No-one need myriads config files. Related components should reuse storage file.
|
||||
*/
|
||||
@NonNls
|
||||
String value() default "";
|
||||
|
||||
Reference in New Issue
Block a user