Remove TelemetryUtils and use IAdsTelemetryService directly (#8289)

* Remove TelemetryUtils and use IAdsTelemetryService directly

* Fix event names and cleanup

* Fix tests

* Fix strict null check
This commit is contained in:
Charles Gagnon
2019-11-13 13:54:55 -08:00
committed by GitHub
parent 86d6295bf0
commit 18ab2ae799
39 changed files with 179 additions and 313 deletions

View File

@@ -8,7 +8,6 @@ import { Color } from 'vs/base/common/color';
import { KeyCode, KeyMod } from 'vs/base/common/keyCodes';
import { mixin } from 'vs/base/common/objects';
import { Disposable, IDisposable } from 'vs/base/common/lifecycle';
import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry';
import * as DOM from 'vs/base/browser/dom';
import { StandardKeyboardEvent } from 'vs/base/browser/keyboardEvent';
import { generateUuid } from 'vs/base/common/uuid';
@@ -16,7 +15,6 @@ import { IContextKeyService, RawContextKey, IContextKey } from 'vs/platform/cont
import { IClipboardService } from 'vs/platform/clipboard/common/clipboardService';
import { Button } from 'sql/base/browser/ui/button/button';
import * as TelemetryUtils from 'sql/platform/telemetry/common/telemetryUtilities';
import * as TelemetryKeys from 'sql/platform/telemetry/common/telemetryKeys';
import { localize } from 'vs/nls';
import { MessageLevel } from 'sql/workbench/api/common/sqlExtHostTypes';
@@ -28,6 +26,7 @@ import { ITextResourcePropertiesService } from 'vs/editor/common/services/resour
import { URI } from 'vs/base/common/uri';
import { Schemas } from 'vs/base/common/network';
import { find, firstIndex } from 'vs/base/common/arrays';
import { IAdsTelemetryService } from 'sql/platform/telemetry/common/telemetry';
export const MODAL_SHOWING_KEY = 'modalShowing';
export const MODAL_SHOWING_CONTEXT = new RawContextKey<Array<string>>(MODAL_SHOWING_KEY, []);
@@ -140,7 +139,7 @@ export abstract class Modal extends Disposable implements IThemable {
constructor(
private _title: string,
private _name: string,
private readonly _telemetryService: ITelemetryService,
private readonly _telemetryService: IAdsTelemetryService,
protected readonly layoutService: IWorkbenchLayoutService,
protected readonly _clipboardService: IClipboardService,
protected readonly _themeService: IThemeService,
@@ -373,7 +372,9 @@ export abstract class Modal extends Disposable implements IThemable {
});
this.layout(DOM.getTotalHeight(this._modalBodySection));
TelemetryUtils.addTelemetry(this._telemetryService, this.logService, TelemetryKeys.ModalDialogOpened, { name: this._name });
this._telemetryService.createActionEvent(TelemetryKeys.TelemetryView.Shell, TelemetryKeys.ModalDialogOpened)
.withAdditionalProperties({ name: this._name })
.send();
}
/**
@@ -392,7 +393,9 @@ export abstract class Modal extends Disposable implements IThemable {
}
this._keydownListener.dispose();
this._resizeListener.dispose();
TelemetryUtils.addTelemetry(this._telemetryService, this.logService, TelemetryKeys.ModalDialogClosed, { name: this._name });
this._telemetryService.createActionEvent(TelemetryKeys.TelemetryView.Shell, TelemetryKeys.ModalDialogClosed)
.withAdditionalProperties({ name: this._name })
.send();
}
/**

View File

@@ -17,7 +17,6 @@ import * as azdata from 'azdata';
import { Event, Emitter } from 'vs/base/common/event';
import { SIDE_BAR_BACKGROUND } from 'vs/workbench/common/theme';
import { IContextViewService, IContextMenuService } from 'vs/platform/contextview/browser/contextView';
import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry';
import { localize } from 'vs/nls';
import { IContextKeyService } from 'vs/platform/contextkey/common/contextkey';
import { contrastBorder } from 'vs/platform/theme/common/colorRegistry';
@@ -34,6 +33,7 @@ import { IThemeService, ITheme } from 'vs/platform/theme/common/themeService';
import { ILogService } from 'vs/platform/log/common/log';
import { IWorkbenchLayoutService } from 'vs/workbench/services/layout/browser/layoutService';
import { ITextResourcePropertiesService } from 'vs/editor/common/services/resourceConfiguration';
import { IAdsTelemetryService } from 'sql/platform/telemetry/common/telemetry';
export class CategoryView extends ViewletPanel {
@@ -93,7 +93,7 @@ export class OptionsDialog extends Modal {
@IThemeService themeService: IThemeService,
@IContextViewService private _contextViewService: IContextViewService,
@IInstantiationService private _instantiationService: IInstantiationService,
@ITelemetryService telemetryService: ITelemetryService,
@IAdsTelemetryService telemetryService: IAdsTelemetryService,
@IContextKeyService contextKeyService: IContextKeyService,
@IClipboardService clipboardService: IClipboardService,
@ILogService logService: ILogService,