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:
Candice Ye
2019-07-31 14:50:26 -07:00
committed by GitHub
parent 22bd1fdc55
commit 161c182a56
3 changed files with 45 additions and 8 deletions

View File

@@ -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'
}

View File

@@ -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);
}