public abstract class ProjectUsagesCollector extends FeatureUsagesCollector
Use it to create a collector which records project state.
To implement a new collector:getMetrics(Project)
and register collector in plugin.xml;SensitiveDataValidator
;com.intellij.internal.statistic.actions.localWhitelist.AddTestGroupToLocalWhitelistAction
com.intellij.internal.statistic.actions.ShowStatisticsEventLogAction
RecordStateStatisticsEventLogAction
ApplicationUsagesCollector
,
FUCounterUsageLogger
Constructor and Description |
---|
ProjectUsagesCollector() |
Modifier and Type | Method and Description |
---|---|
FeatureUsageData |
getData(Project project) |
static java.util.Set<ProjectUsagesCollector> |
getExtensions(com.intellij.internal.statistic.service.fus.collectors.UsagesCollectorConsumer invoker) |
protected java.util.Set<MetricEvent> |
getMetrics(Project project)
If you need to perform long blocking operations with Read lock or on EDT,
consider using
getMetrics(Project, ProgressIndicator) along with ReadAction#nonBlocking if needed,
or override requiresReadAccess() method to wrap metrics gathering with non-blocking read action automatically. |
CancellablePromise<? extends java.util.Set<MetricEvent>> |
getMetrics(Project project,
ProgressIndicator indicator)
Implement this method to calculate metrics.
|
java.util.Set<UsageDescriptor> |
getUsages(Project project)
Deprecated.
|
protected boolean |
requiresReadAccess() |
getExtensions, getGroupId, getVersion, isValid
public static java.util.Set<ProjectUsagesCollector> getExtensions(com.intellij.internal.statistic.service.fus.collectors.UsagesCollectorConsumer invoker)
public CancellablePromise<? extends java.util.Set<MetricEvent>> getMetrics(Project project, ProgressIndicator indicator)
MetricEvent#eventId
should indicate what we measure, e.g. "configured.vcs", "module.jdk".MetricEvent#data
should contain the value of the measurement, e.g. {"name":"Git"}, {"version":"1.8", "vendor":"OpenJdk"}protected java.util.Set<MetricEvent> getMetrics(Project project)
getMetrics(Project, ProgressIndicator)
along with ReadAction#nonBlocking if needed,
or override requiresReadAccess()
method to wrap metrics gathering with non-blocking read action automatically.protected boolean requiresReadAccess()
getMetrics(Project)
with non-blocking read-action ReadAction.nonBlocking(Runnable)
@Deprecated public java.util.Set<UsageDescriptor> getUsages(Project project)
getMetrics(Project, ProgressIndicator)
public FeatureUsageData getData(Project project)