mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-17 02:51:36 -05:00
Fixed telemetry events for visualizer recommendation prompts (#6547)
* Fixed telemetry events for visualizer recommendation prompts * Added telemetry event for when Visualizer button in action bar is clicked and added respective telemetry keys * Created TelemetryView and TelemetryAction and relocated new constants
This commit is contained in:
@@ -64,5 +64,11 @@ export const DeleteAgentProxy = 'DeleteAgentProxy';
|
||||
export const NotebookMarkdownRendered = 'NotebookMarkdownRendered';
|
||||
|
||||
export enum TelemetryView {
|
||||
Shell = 'Shell'
|
||||
Shell = 'Shell',
|
||||
ExtensionRecommendationDialog = 'ExtensionRecommendationDialog',
|
||||
ResultsPanel = 'ResultsPanel'
|
||||
}
|
||||
|
||||
export enum TelemetryAction {
|
||||
Click = 'Click'
|
||||
}
|
||||
|
||||
@@ -21,6 +21,8 @@ import QueryRunner from 'sql/platform/query/common/queryRunner';
|
||||
import product from 'vs/platform/product/node/product';
|
||||
import { GridTableState } from 'sql/workbench/parts/query/common/gridPanelState';
|
||||
import * as Constants from 'sql/workbench/contrib/extensions/constants';
|
||||
import { IAdsTelemetryService } from 'sql/platform/telemetry/telemetry';
|
||||
import * as TelemetryKeys from 'sql/platform/telemetry/common/telemetryKeys';
|
||||
|
||||
export interface IGridActionContext {
|
||||
gridDataProvider: IGridDataProvider;
|
||||
@@ -226,13 +228,18 @@ export class VisualizerDataAction extends Action {
|
||||
|
||||
constructor(
|
||||
private runner: QueryRunner,
|
||||
@IEditorService private editorService: IEditorService,
|
||||
|
||||
@IAdsTelemetryService private adsTelemetryService: IAdsTelemetryService
|
||||
) {
|
||||
super(VisualizerDataAction.ID, VisualizerDataAction.LABEL, VisualizerDataAction.ICON);
|
||||
}
|
||||
|
||||
public run(context: IGridActionContext): Promise<boolean> {
|
||||
this.adsTelemetryService.sendActionEvent(
|
||||
TelemetryKeys.TelemetryView.ResultsPanel,
|
||||
TelemetryKeys.TelemetryAction.Click,
|
||||
'VisualizerButton',
|
||||
'VisualizerDataAction'
|
||||
);
|
||||
this.runner.notifyVisualizeRequested(context.batchId, context.resultId);
|
||||
return Promise.resolve(true);
|
||||
}
|
||||
|
||||
@@ -50,6 +50,8 @@ import { extname } from 'vs/base/common/resources';
|
||||
import { ITextFileService } from 'vs/workbench/services/textfile/common/textfiles';
|
||||
import { IExeBasedExtensionTip } from 'vs/platform/product/common/product';
|
||||
import { timeout } from 'vs/base/common/async';
|
||||
import { IAdsTelemetryService } from 'sql/platform/telemetry/telemetry';
|
||||
import * as TelemetryKeys from 'sql/platform/telemetry/common/telemetryKeys';
|
||||
|
||||
const milliSecondsInADay = 1000 * 60 * 60 * 24;
|
||||
const choiceNever = localize('neverShowAgain', "Don't Show Again");
|
||||
@@ -115,7 +117,8 @@ export class ExtensionTipsService extends Disposable implements IExtensionTipsSe
|
||||
@IExtensionManagementService private readonly extensionManagementService: IExtensionManagementService,
|
||||
@IExtensionsWorkbenchService private readonly extensionWorkbenchService: IExtensionsWorkbenchService,
|
||||
@IExperimentService private readonly experimentService: IExperimentService,
|
||||
@ITextFileService private readonly textFileService: ITextFileService
|
||||
@ITextFileService private readonly textFileService: ITextFileService,
|
||||
@IAdsTelemetryService private readonly adsTelemetryService: IAdsTelemetryService
|
||||
) {
|
||||
super();
|
||||
|
||||
@@ -1167,6 +1170,7 @@ export class ExtensionTipsService extends Disposable implements IExtensionTipsSe
|
||||
let localExtensions: ILocalExtension[];
|
||||
const getRecommendationPromise = this.getRecommendedExtensionsByScenario(scenarioType).then(recs => { recommendations = recs; });
|
||||
const getLocalExtensionPromise = this.extensionsService.getInstalled(ExtensionType.User).then(local => { localExtensions = local; });
|
||||
const visualizerExtensionNotificationService = 'VisualizerExtensionNotificationService';
|
||||
|
||||
let recommendationMessage = localize('ExtensionsRecommended', "Azure Data Studio has extension recommendations.");
|
||||
if (scenarioType === Constants.visualizerExtensions) {
|
||||
@@ -1181,7 +1185,12 @@ export class ExtensionTipsService extends Disposable implements IExtensionTipsSe
|
||||
[{
|
||||
label: localize('installAll', "Install All"),
|
||||
run: () => {
|
||||
this.telemetryService.publicLog(scenarioType + 'Recommendations:popup', { userReaction: 'install' });
|
||||
this.adsTelemetryService.sendActionEvent(
|
||||
TelemetryKeys.TelemetryView.ExtensionRecommendationDialog,
|
||||
TelemetryKeys.TelemetryAction.Click,
|
||||
'InstallButton',
|
||||
visualizerExtensionNotificationService
|
||||
);
|
||||
const installAllAction = this.instantiationService.createInstance(InstallRecommendedExtensionsByScenarioAction, scenarioType, recommendations);
|
||||
installAllAction.run();
|
||||
installAllAction.dispose();
|
||||
@@ -1189,7 +1198,12 @@ export class ExtensionTipsService extends Disposable implements IExtensionTipsSe
|
||||
}, {
|
||||
label: localize('showRecommendations', "Show Recommendations"),
|
||||
run: () => {
|
||||
this.telemetryService.publicLog(scenarioType + 'Recommendations:popup', { userReaction: 'show' });
|
||||
this.adsTelemetryService.sendActionEvent(
|
||||
TelemetryKeys.TelemetryView.ExtensionRecommendationDialog,
|
||||
TelemetryKeys.TelemetryAction.Click,
|
||||
'ShowRecommendationsButton',
|
||||
visualizerExtensionNotificationService
|
||||
);
|
||||
const showAction = this.instantiationService.createInstance(ShowRecommendedExtensionsByScenarioAction, scenarioType);
|
||||
showAction.run();
|
||||
showAction.dispose();
|
||||
@@ -1199,7 +1213,12 @@ export class ExtensionTipsService extends Disposable implements IExtensionTipsSe
|
||||
label: choiceNever,
|
||||
isSecondary: true,
|
||||
run: () => {
|
||||
this.telemetryService.publicLog(scenarioType + 'Recommendations:popup', { userReaction: 'neverShowAgain' });
|
||||
this.adsTelemetryService.sendActionEvent(
|
||||
TelemetryKeys.TelemetryView.ExtensionRecommendationDialog,
|
||||
TelemetryKeys.TelemetryAction.Click,
|
||||
'NeverShowAgainButton',
|
||||
visualizerExtensionNotificationService
|
||||
);
|
||||
this.storageService.store(storageKey, true, StorageScope.GLOBAL);
|
||||
c(undefined);
|
||||
}
|
||||
@@ -1207,7 +1226,12 @@ export class ExtensionTipsService extends Disposable implements IExtensionTipsSe
|
||||
{
|
||||
sticky: true,
|
||||
onCancel: () => {
|
||||
this.telemetryService.publicLog(scenarioType + 'Recommendations:popup', { userReaction: 'cancelled' });
|
||||
this.adsTelemetryService.sendActionEvent(
|
||||
TelemetryKeys.TelemetryView.ExtensionRecommendationDialog,
|
||||
TelemetryKeys.TelemetryAction.Click,
|
||||
'CancelButton',
|
||||
visualizerExtensionNotificationService
|
||||
);
|
||||
c(undefined);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user