mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-16 10:58:30 -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user