mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-17 02:51:36 -05:00
Execution Plan Telemetry for Plan Comparisons (#19610)
* Adds telemetry when plan comparison is invoked * Small formatting change. * Adds telemetry to add execution plan button * Removes unused ExecutionPlanComparisonEditorView constructor parameters * Small formatting adjustment * Adds telemetry to ExecutionPlanComparisonEditorView properties * Code review changes
This commit is contained in:
@@ -55,6 +55,7 @@ export const enum TelemetryError {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export const enum TelemetryAction {
|
export const enum TelemetryAction {
|
||||||
|
AddExecutionPlan = 'AddExecutionPlan',
|
||||||
AddServerGroup = 'AddServerGroup',
|
AddServerGroup = 'AddServerGroup',
|
||||||
adsCommandExecuted = 'adsCommandExecuted',
|
adsCommandExecuted = 'adsCommandExecuted',
|
||||||
ConnectToServer = 'ConnectToServer',
|
ConnectToServer = 'ConnectToServer',
|
||||||
@@ -73,6 +74,7 @@ export const enum TelemetryAction {
|
|||||||
CancelQuery = 'CancelQuery',
|
CancelQuery = 'CancelQuery',
|
||||||
ChartCreated = 'ChartCreated',
|
ChartCreated = 'ChartCreated',
|
||||||
Click = 'Click',
|
Click = 'Click',
|
||||||
|
CompareExecutionPlan = 'CompareExecutionPlan',
|
||||||
FindNode = 'FindNode',
|
FindNode = 'FindNode',
|
||||||
FirewallRuleRequested = 'FirewallRuleCreated',
|
FirewallRuleRequested = 'FirewallRuleCreated',
|
||||||
GenerateScript = 'GenerateScript',
|
GenerateScript = 'GenerateScript',
|
||||||
@@ -97,6 +99,7 @@ export const enum TelemetryAction {
|
|||||||
RunQueryString = 'RunQueryString',
|
RunQueryString = 'RunQueryString',
|
||||||
ShowChart = 'ShowChart',
|
ShowChart = 'ShowChart',
|
||||||
StopAgentJob = 'StopAgentJob',
|
StopAgentJob = 'StopAgentJob',
|
||||||
|
ViewExecutionPlanComparisonProperties = 'ViewExecutionPlanComparisonProperties',
|
||||||
ViewTopOperations = 'ViewTopOperations',
|
ViewTopOperations = 'ViewTopOperations',
|
||||||
WizardPagesNavigation = 'WizardPagesNavigation',
|
WizardPagesNavigation = 'WizardPagesNavigation',
|
||||||
SearchStarted = 'SearchStarted',
|
SearchStarted = 'SearchStarted',
|
||||||
|
|||||||
@@ -4,6 +4,7 @@
|
|||||||
*--------------------------------------------------------------------------------------------*/
|
*--------------------------------------------------------------------------------------------*/
|
||||||
|
|
||||||
import * as azdata from 'azdata';
|
import * as azdata from 'azdata';
|
||||||
|
import * as TelemetryKeys from 'sql/platform/telemetry/common/telemetryKeys';
|
||||||
import { SelectBox } from 'sql/base/browser/ui/selectBox/selectBox';
|
import { SelectBox } from 'sql/base/browser/ui/selectBox/selectBox';
|
||||||
import { ITaskbarContent, Taskbar } from 'sql/base/browser/ui/taskbar/taskbar';
|
import { ITaskbarContent, Taskbar } from 'sql/base/browser/ui/taskbar/taskbar';
|
||||||
import { AzdataGraphView } from 'sql/workbench/contrib/executionPlan/browser/azdataGraphView';
|
import { AzdataGraphView } from 'sql/workbench/contrib/executionPlan/browser/azdataGraphView';
|
||||||
@@ -14,8 +15,6 @@ import { Action } from 'vs/base/common/actions';
|
|||||||
import { IContextViewService } from 'vs/platform/contextview/browser/contextView';
|
import { IContextViewService } from 'vs/platform/contextview/browser/contextView';
|
||||||
import { IFileDialogService } from 'vs/platform/dialogs/common/dialogs';
|
import { IFileDialogService } from 'vs/platform/dialogs/common/dialogs';
|
||||||
import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation';
|
import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation';
|
||||||
import { IStorageService } from 'vs/platform/storage/common/storage';
|
|
||||||
import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry';
|
|
||||||
import { IColorTheme, ICssStyleCollector, IThemeService, registerThemingParticipant } from 'vs/platform/theme/common/themeService';
|
import { IColorTheme, ICssStyleCollector, IThemeService, registerThemingParticipant } from 'vs/platform/theme/common/themeService';
|
||||||
import * as DOM from 'vs/base/browser/dom';
|
import * as DOM from 'vs/base/browser/dom';
|
||||||
import { ActionsOrientation } from 'vs/base/browser/ui/actionbar/actionbar';
|
import { ActionsOrientation } from 'vs/base/browser/ui/actionbar/actionbar';
|
||||||
@@ -30,7 +29,7 @@ import { errorForeground, listHoverBackground, textLinkForeground } from 'vs/pla
|
|||||||
import { ExecutionPlanViewHeader } from 'sql/workbench/contrib/executionPlan/browser/executionPlanViewHeader';
|
import { ExecutionPlanViewHeader } from 'sql/workbench/contrib/executionPlan/browser/executionPlanViewHeader';
|
||||||
import { attachSelectBoxStyler } from 'sql/platform/theme/common/styler';
|
import { attachSelectBoxStyler } from 'sql/platform/theme/common/styler';
|
||||||
import { IProgressService, ProgressLocation } from 'vs/platform/progress/common/progress';
|
import { IProgressService, ProgressLocation } from 'vs/platform/progress/common/progress';
|
||||||
|
import { IAdsTelemetryService } from 'sql/platform/telemetry/common/telemetry';
|
||||||
|
|
||||||
export class ExecutionPlanComparisonEditorView {
|
export class ExecutionPlanComparisonEditorView {
|
||||||
|
|
||||||
@@ -105,9 +104,7 @@ export class ExecutionPlanComparisonEditorView {
|
|||||||
constructor(
|
constructor(
|
||||||
parentContainer: HTMLElement,
|
parentContainer: HTMLElement,
|
||||||
@IInstantiationService private _instantiationService: IInstantiationService,
|
@IInstantiationService private _instantiationService: IInstantiationService,
|
||||||
@ITelemetryService telemetryService: ITelemetryService,
|
|
||||||
@IThemeService private themeService: IThemeService,
|
@IThemeService private themeService: IThemeService,
|
||||||
@IStorageService storageService: IStorageService,
|
|
||||||
@IExecutionPlanService private _executionPlanService: IExecutionPlanService,
|
@IExecutionPlanService private _executionPlanService: IExecutionPlanService,
|
||||||
@IFileDialogService private _fileDialogService: IFileDialogService,
|
@IFileDialogService private _fileDialogService: IFileDialogService,
|
||||||
@IContextViewService readonly contextViewService: IContextViewService,
|
@IContextViewService readonly contextViewService: IContextViewService,
|
||||||
@@ -131,11 +128,11 @@ export class ExecutionPlanComparisonEditorView {
|
|||||||
|
|
||||||
});
|
});
|
||||||
this._taskbar.context = this;
|
this._taskbar.context = this;
|
||||||
this._addExecutionPlanAction = new AddExecutionPlanAction();
|
this._addExecutionPlanAction = this._instantiationService.createInstance(AddExecutionPlanAction);
|
||||||
this._zoomOutAction = new ZoomOutAction();
|
this._zoomOutAction = new ZoomOutAction();
|
||||||
this._zoomInAction = new ZoomInAction();
|
this._zoomInAction = new ZoomInAction();
|
||||||
this._zoomToFitAction = new ZoomToFitAction();
|
this._zoomToFitAction = new ZoomToFitAction();
|
||||||
this._propertiesAction = new PropertiesAction();
|
this._propertiesAction = this._instantiationService.createInstance(PropertiesAction);
|
||||||
this._toggleOrientationAction = new ToggleOrientation();
|
this._toggleOrientationAction = new ToggleOrientation();
|
||||||
this._resetZoomAction = new ZoomReset();
|
this._resetZoomAction = new ZoomReset();
|
||||||
const content: ITaskbarContent[] = [
|
const content: ITaskbarContent[] = [
|
||||||
@@ -529,11 +526,16 @@ export class ExecutionPlanComparisonEditorView {
|
|||||||
class AddExecutionPlanAction extends Action {
|
class AddExecutionPlanAction extends Action {
|
||||||
public static ID = 'ep.AddExecutionPlan';
|
public static ID = 'ep.AddExecutionPlan';
|
||||||
public static LABEL = localize('addExecutionPlanLabel', "Add execution plan");
|
public static LABEL = localize('addExecutionPlanLabel', "Add execution plan");
|
||||||
constructor() {
|
|
||||||
|
constructor(
|
||||||
|
@IAdsTelemetryService private readonly telemetryService: IAdsTelemetryService
|
||||||
|
) {
|
||||||
super(AddExecutionPlanAction.ID, AddExecutionPlanAction.LABEL, addIconClassName);
|
super(AddExecutionPlanAction.ID, AddExecutionPlanAction.LABEL, addIconClassName);
|
||||||
}
|
}
|
||||||
|
|
||||||
public override async run(context: ExecutionPlanComparisonEditorView): Promise<void> {
|
public override async run(context: ExecutionPlanComparisonEditorView): Promise<void> {
|
||||||
|
this.telemetryService.sendActionEvent(TelemetryKeys.TelemetryView.ExecutionPlan, TelemetryKeys.TelemetryAction.AddExecutionPlan);
|
||||||
|
|
||||||
await context.openAndAddExecutionPlanFile();
|
await context.openAndAddExecutionPlanFile();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -608,11 +610,19 @@ class ToggleOrientation extends Action {
|
|||||||
class PropertiesAction extends Action {
|
class PropertiesAction extends Action {
|
||||||
public static ID = 'epCompare.comparePropertiesAction';
|
public static ID = 'epCompare.comparePropertiesAction';
|
||||||
public static LABEL = localize('epCompare.comparePropertiesAction', "Properties");
|
public static LABEL = localize('epCompare.comparePropertiesAction', "Properties");
|
||||||
constructor() {
|
|
||||||
|
constructor(
|
||||||
|
@IAdsTelemetryService private readonly telemetryService: IAdsTelemetryService
|
||||||
|
) {
|
||||||
super(PropertiesAction.ID, PropertiesAction.LABEL, openPropertiesIconClassNames);
|
super(PropertiesAction.ID, PropertiesAction.LABEL, openPropertiesIconClassNames);
|
||||||
this.enabled = false;
|
this.enabled = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
public override async run(context: ExecutionPlanComparisonEditorView): Promise<void> {
|
public override async run(context: ExecutionPlanComparisonEditorView): Promise<void> {
|
||||||
|
this.telemetryService
|
||||||
|
.createActionEvent(TelemetryKeys.TelemetryView.ExecutionPlan, TelemetryKeys.TelemetryAction.ViewExecutionPlanComparisonProperties)
|
||||||
|
.send();
|
||||||
|
|
||||||
context.togglePropertiesView();
|
context.togglePropertiesView();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -164,7 +164,7 @@ export class ExecutionPlanView implements ISashLayoutProvider {
|
|||||||
this._instantiationService.createInstance(ZoomToFitAction, 'ActionBar'),
|
this._instantiationService.createInstance(ZoomToFitAction, 'ActionBar'),
|
||||||
this._instantiationService.createInstance(CustomZoomAction, 'ActionBar'),
|
this._instantiationService.createInstance(CustomZoomAction, 'ActionBar'),
|
||||||
this._instantiationService.createInstance(PropertiesAction, 'ActionBar'),
|
this._instantiationService.createInstance(PropertiesAction, 'ActionBar'),
|
||||||
new CompareExecutionPlanAction(),
|
this._instantiationService.createInstance(CompareExecutionPlanAction, 'ActionBar'),
|
||||||
this.actionBarToggleTopTip
|
this.actionBarToggleTopTip
|
||||||
];
|
];
|
||||||
this._actionBar.pushAction(actionBarActions, { icon: true, label: false });
|
this._actionBar.pushAction(actionBarActions, { icon: true, label: false });
|
||||||
@@ -181,7 +181,7 @@ export class ExecutionPlanView implements ISashLayoutProvider {
|
|||||||
this._instantiationService.createInstance(ZoomToFitAction, 'ContextMenu'),
|
this._instantiationService.createInstance(ZoomToFitAction, 'ContextMenu'),
|
||||||
this._instantiationService.createInstance(CustomZoomAction, 'ContextMenu'),
|
this._instantiationService.createInstance(CustomZoomAction, 'ContextMenu'),
|
||||||
this._instantiationService.createInstance(PropertiesAction, 'ContextMenu'),
|
this._instantiationService.createInstance(PropertiesAction, 'ContextMenu'),
|
||||||
new CompareExecutionPlanAction(),
|
this._instantiationService.createInstance(CompareExecutionPlanAction, 'ContextMenu'),
|
||||||
this.contextMenuToggleTooltipAction
|
this.contextMenuToggleTooltipAction
|
||||||
];
|
];
|
||||||
const self = this;
|
const self = this;
|
||||||
@@ -530,11 +530,18 @@ export class CompareExecutionPlanAction extends Action {
|
|||||||
public static ID = 'ep.tooltipToggleContextMenu';
|
public static ID = 'ep.tooltipToggleContextMenu';
|
||||||
public static COMPARE_PLAN = localize('executionPlanCompareExecutionPlanAction', "Compare execution plan");
|
public static COMPARE_PLAN = localize('executionPlanCompareExecutionPlanAction', "Compare execution plan");
|
||||||
|
|
||||||
constructor() {
|
constructor(private source: ExecutionPlanActionSource,
|
||||||
|
@IAdsTelemetryService private readonly telemetryService: IAdsTelemetryService
|
||||||
|
) {
|
||||||
super(CompareExecutionPlanAction.COMPARE_PLAN, CompareExecutionPlanAction.COMPARE_PLAN, executionPlanCompareIconClassName);
|
super(CompareExecutionPlanAction.COMPARE_PLAN, CompareExecutionPlanAction.COMPARE_PLAN, executionPlanCompareIconClassName);
|
||||||
}
|
}
|
||||||
|
|
||||||
public override async run(context: ExecutionPlanView): Promise<void> {
|
public override async run(context: ExecutionPlanView): Promise<void> {
|
||||||
|
this.telemetryService
|
||||||
|
.createActionEvent(TelemetryKeys.TelemetryView.ExecutionPlan, TelemetryKeys.TelemetryAction.CompareExecutionPlan)
|
||||||
|
.withAdditionalProperties({ source: this.source })
|
||||||
|
.send();
|
||||||
|
|
||||||
context.compareCurrentExecutionPlan();
|
context.compareCurrentExecutionPlan();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user