mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-01-23 01:25:38 -05:00
Log extension host commands (#15721)
* Log extension host commands * Add more comments
This commit is contained in:
@@ -8,6 +8,7 @@ import { IAdsTelemetryService, ITelemetryInfo, ITelemetryEvent, ITelemetryEventM
|
||||
import { ILogService } from 'vs/platform/log/common/log';
|
||||
import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry';
|
||||
import { assign } from 'vs/base/common/objects';
|
||||
import { EventName } from 'sql/platform/telemetry/common/telemetryKeys';
|
||||
|
||||
|
||||
class TelemetryEventImpl implements ITelemetryEvent {
|
||||
@@ -106,7 +107,7 @@ export class AdsTelemetryService implements IAdsTelemetryService {
|
||||
* @param view The name of the page or item that was viewed
|
||||
*/
|
||||
public createViewEvent(view: string): ITelemetryEvent {
|
||||
return new TelemetryEventImpl(this.telemetryService, this.logService, 'view', {
|
||||
return new TelemetryEventImpl(this.telemetryService, this.logService, EventName.View, {
|
||||
view: view
|
||||
});
|
||||
}
|
||||
@@ -128,7 +129,7 @@ export class AdsTelemetryService implements IAdsTelemetryService {
|
||||
*/
|
||||
public createActionEvent(view: string, action: string, target: string = '', source: string = '', durationInMs?: number): ITelemetryEvent {
|
||||
const measures: ITelemetryEventMeasures = durationInMs ? { durationInMs: durationInMs } : {};
|
||||
return new TelemetryEventImpl(this.telemetryService, this.logService, 'action', {
|
||||
return new TelemetryEventImpl(this.telemetryService, this.logService, EventName.Action, {
|
||||
view: view,
|
||||
action: action,
|
||||
target: target,
|
||||
@@ -152,7 +153,7 @@ export class AdsTelemetryService implements IAdsTelemetryService {
|
||||
* @param metrics The metrics to send
|
||||
*/
|
||||
public createMetricsEvent(metrics: ITelemetryEventMeasures, groupName: string = ''): ITelemetryEvent {
|
||||
return new TelemetryEventImpl(this.telemetryService, this.logService, 'metrics', { groupName: groupName }, metrics);
|
||||
return new TelemetryEventImpl(this.telemetryService, this.logService, EventName.Metrics, { groupName: groupName }, metrics);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -172,7 +173,7 @@ export class AdsTelemetryService implements IAdsTelemetryService {
|
||||
* @param properties Optional additional properties
|
||||
*/
|
||||
public createErrorEvent(view: string, name: string, errorCode: string = '', errorType: string = ''): ITelemetryEvent {
|
||||
return new TelemetryEventImpl(this.telemetryService, this.logService, 'error', {
|
||||
return new TelemetryEventImpl(this.telemetryService, this.logService, EventName.Error, {
|
||||
view: view,
|
||||
name: name,
|
||||
errorCode: errorCode,
|
||||
|
||||
@@ -3,7 +3,14 @@
|
||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
export enum ModalDialogName {
|
||||
export const enum EventName {
|
||||
Action = 'action',
|
||||
Error = 'error',
|
||||
Metrics = 'metrics',
|
||||
View = 'view'
|
||||
}
|
||||
|
||||
export const enum ModalDialogName {
|
||||
ErrorMessage = 'ErrorMessage',
|
||||
WebView = 'WebView',
|
||||
ConnectionAdvancedProperties = 'ConnectionAdvancedProperties',
|
||||
@@ -22,7 +29,7 @@ export enum ModalDialogName {
|
||||
CalloutDialog = 'CalloutDialog'
|
||||
}
|
||||
|
||||
export enum TelemetryView {
|
||||
export const enum TelemetryView {
|
||||
Agent = 'Agent',
|
||||
AgentJobs = 'AgentJobs',
|
||||
AgentJobHistory = 'AgentJobHistory',
|
||||
@@ -30,18 +37,19 @@ export enum TelemetryView {
|
||||
AgentNotebookHistory = 'AgentNotebookHistory',
|
||||
AgentNotebooks = 'AgentNotebooks',
|
||||
ConnectionDialog = 'ConnectionDialog',
|
||||
Shell = 'Shell',
|
||||
ExtensionHost = 'ExtensionHost',
|
||||
ExtensionRecommendationDialog = 'ExtensionRecommendationDialog',
|
||||
ResultsPanel = 'ResultsPanel',
|
||||
Notebook = 'Notebook',
|
||||
ResultsPanel = 'ResultsPanel',
|
||||
Shell = 'Shell',
|
||||
SqlAssessment = 'SqlAssessment'
|
||||
}
|
||||
|
||||
export enum TelemetryError {
|
||||
export const enum TelemetryError {
|
||||
DatabaseConnectionError = 'DatabaseConnectionError'
|
||||
}
|
||||
|
||||
export enum TelemetryAction {
|
||||
export const enum TelemetryAction {
|
||||
AddServerGroup = 'AddServerGroup',
|
||||
adsCommandExecuted = 'adsCommandExecuted',
|
||||
ConnectToServer = 'ConnectToServer',
|
||||
@@ -82,7 +90,7 @@ export enum TelemetryAction {
|
||||
SearchCompleted = 'SearchCompleted'
|
||||
}
|
||||
|
||||
export enum NbTelemetryAction {
|
||||
export const enum NbTelemetryAction {
|
||||
RunCell = 'RunCell',
|
||||
RunAll = 'RunNotebook',
|
||||
AddCell = 'AddCell',
|
||||
@@ -90,7 +98,7 @@ export enum NbTelemetryAction {
|
||||
NewNotebookFromConnections = 'NewNotebookWithConnectionProfile'
|
||||
}
|
||||
|
||||
export enum TelemetryPropertyName {
|
||||
export const enum TelemetryPropertyName {
|
||||
ChartMaxRowCountExceeded = 'chartMaxRowCountExceeded',
|
||||
ConnectionSource = 'connectionSource'
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user