forked from JetBrains/intellij-community
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add statistics about calling actions from context menu
- Loading branch information
Showing
5 changed files
with
60 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
39 changes: 39 additions & 0 deletions
39
...ellij/internal/statistic/collectors/fus/actions/ActionFromContextMenuUsagesCollector.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
// 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.internal.statistic.collectors.fus.actions; | ||
|
||
import com.intellij.ide.actions.ActionsCollector; | ||
import com.intellij.internal.statistic.beans.UsageDescriptor; | ||
import com.intellij.internal.statistic.service.fus.collectors.ApplicationUsagesCollector; | ||
import com.intellij.internal.statistic.service.fus.collectors.FUSUsageContext; | ||
import com.intellij.internal.statistic.service.fus.collectors.FUStatisticsDifferenceSender; | ||
import com.intellij.internal.statistic.service.fus.collectors.UsageDescriptorKeyValidator; | ||
import com.intellij.util.containers.ContainerUtil; | ||
import org.jetbrains.annotations.NotNull; | ||
|
||
import java.util.Set; | ||
|
||
/** | ||
* @author Konstantin Bulenkov | ||
*/ | ||
public class ActionFromContextMenuUsagesCollector extends ApplicationUsagesCollector implements FUStatisticsDifferenceSender { | ||
|
||
@Override | ||
@NotNull | ||
public Set<UsageDescriptor> getUsages() { | ||
ActionsCollector.State state = ActionsCollector.getInstance().getState(); | ||
assert state != null; | ||
return ContainerUtil | ||
.map2Set(state.myContextMenuValues.entrySet(), e -> new UsageDescriptor(UsageDescriptorKeyValidator.ensureProperKey(e.getKey()), e.getValue())); | ||
} | ||
|
||
@Override | ||
@NotNull | ||
public String getGroupId() { | ||
return "statistics.actions.context.menu.performed"; | ||
} | ||
|
||
@Override | ||
public FUSUsageContext getContext() { | ||
return FUSUsageContext.OS_CONTEXT; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters