Skip to content

Commit 5913d08

Browse files
telemetry for main user actions.
1 parent 91ae9fa commit 5913d08

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

PluginsAndFeatures/azure-toolkit-for-intellij/azure-sdk-reference-book/src/main/java/com/microsoft/azure/toolkit/intellij/azuresdk/referencebook/AzureSdkTreePanel.java

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
import com.microsoft.azure.toolkit.intellij.azuresdk.model.AzureSdkServiceEntity;
2929
import com.microsoft.azure.toolkit.intellij.azuresdk.service.AzureSdkLibraryService;
3030
import com.microsoft.azure.toolkit.intellij.common.TextDocumentListenerAdapter;
31+
import com.microsoft.azure.toolkit.lib.common.operation.AzureOperation;
3132
import com.microsoft.azure.toolkit.lib.common.task.AzureTaskManager;
3233
import com.microsoft.azure.toolkit.lib.common.utils.TailingDebouncer;
3334
import lombok.Getter;
@@ -70,16 +71,22 @@ private void initEventListeners() {
7071
this.tree.addTreeSelectionListener(e -> {
7172
final DefaultMutableTreeNode node = (DefaultMutableTreeNode) this.tree.getLastSelectedPathComponent();
7273
if (Objects.nonNull(node) && node.isLeaf() && node.getUserObject() instanceof AzureSdkFeatureEntity) {
73-
this.onSdkFeatureNodeSelected.accept((AzureSdkFeatureEntity) node.getUserObject());
74+
selectFeature((AzureSdkFeatureEntity) node.getUserObject());
7475
}
7576
});
7677
}
7778

79+
@AzureOperation(name = "sdk|reference_book.select_feature", params = "feature.getName()", type = AzureOperation.Type.ACTION)
80+
private void selectFeature(final AzureSdkFeatureEntity feature) {
81+
this.onSdkFeatureNodeSelected.accept(feature);
82+
}
83+
7884
@Override
7985
public void onDocumentChanged() {
8086
this.filter.debounce();
8187
}
8288

89+
@AzureOperation(name = "sdk|reference_book.search", params = "text", type = AzureOperation.Type.ACTION)
8390
private void filter(final String text) {
8491
final String[] filters = Arrays.stream(text.split("\\s+")).filter(StringUtils::isNoneBlank).map(String::toLowerCase).toArray(String[]::new);
8592
this.loadData(this.services, filters);

PluginsAndFeatures/azure-toolkit-for-intellij/azure-sdk-reference-book/src/main/java/com/microsoft/azure/toolkit/intellij/azuresdk/referencebook/OpenReferenceBookAction.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
import com.intellij.openapi.actionSystem.LangDataKeys;
66
import com.intellij.openapi.module.Module;
77
import com.intellij.openapi.project.Project;
8+
import com.microsoft.azure.toolkit.lib.common.operation.AzureOperation;
89
import com.microsoft.azure.toolkit.lib.common.task.AzureTaskManager;
910
import org.jetbrains.annotations.Nullable;
1011

@@ -17,6 +18,7 @@ public void actionPerformed(@Nonnull final AnActionEvent event) {
1718
AzureTaskManager.getInstance().runLater(() -> openSdkReferenceBook(event.getProject()));
1819
}
1920

21+
@AzureOperation(name = "sdk|reference_book.open", type = AzureOperation.Type.ACTION)
2022
private void openSdkReferenceBook(final @Nullable Project project) {
2123
final AzureSdkReferenceBookDialog dialog = new AzureSdkReferenceBookDialog(project);
2224
dialog.show();

0 commit comments

Comments
 (0)