Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions news/3 Code Health/6451.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Consolidate telemetry.
100 changes: 68 additions & 32 deletions package-lock.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/client/activation/activationService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ export class LanguageServerExtensionActivationService implements IExtensionActiv
const diagnostic = await this.lsNotSupportedDiagnosticService.diagnose(undefined);
this.lsNotSupportedDiagnosticService.handle(diagnostic).ignoreErrors();
if (diagnostic.length) {
sendTelemetryEvent(EventName.PYTHON_LANGUAGE_SERVER_PLATFORM_NOT_SUPPORTED);
sendTelemetryEvent(EventName.PYTHON_LANGUAGE_SERVER_PLATFORM_SUPPORTED, undefined, { supported: false });
jedi = true;
}
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export class LanguageServerCompatibilityService implements ILanguageServerCompat
public async isSupported(): Promise<boolean> {
try {
const supported = await this.dotnetCompatibility.isSupported();
sendTelemetryEvent(EventName.PYTHON_LANGUAGE_SERVER_PLATFORM_SUPPORTED, undefined, { supported });
sendTelemetryEvent(EventName.PYTHON_LANGUAGE_SERVER_PLATFORM_SUPPORTED, undefined, { supported: supported });
return supported;
} catch (ex) {
traceError('Unable to determine whether LS is supported', ex);
Expand Down
6 changes: 1 addition & 5 deletions src/client/telemetry/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,19 +48,15 @@ export enum EventName {
UNITTEST_CONFIGURE = 'UNITTEST.CONFIGURE',
UNITTEST_CONFIGURING = 'UNITTEST.CONFIGURING',
UNITTEST_VIEW_OUTPUT = 'UNITTEST.VIEW_OUTPUT',
UNITTEST_NAVIGATE_TEST_FILE = 'UNITTEST.NAVIGATE.TEST_FILE',
UNITTEST_NAVIGATE_TEST_FUNCTION = 'UNITTEST.NAVIGATE.TEST_FUNCTION',
UNITTEST_NAVIGATE_TEST_SUITE = 'UNITTEST.NAVIGATE.TEST_SUITE',
UNITTEST_NAVIGATE = 'UNITTEST.NAVIGATE',
UNITTEST_EXPLORER_WORK_SPACE_COUNT = 'UNITTEST.TEST_EXPLORER.WORK_SPACE_COUNT',
PYTHON_LANGUAGE_SERVER_SWITCHED = 'PYTHON_LANGUAGE_SERVER.SWITCHED',
PYTHON_LANGUAGE_SERVER_ANALYSISTIME = 'PYTHON_LANGUAGE_SERVER.ANALYSIS_TIME',
PYTHON_LANGUAGE_SERVER_ENABLED = 'PYTHON_LANGUAGE_SERVER.ENABLED',
PYTHON_LANGUAGE_SERVER_EXTRACTED = 'PYTHON_LANGUAGE_SERVER.EXTRACTED',
PYTHON_LANGUAGE_SERVER_DOWNLOADED = 'PYTHON_LANGUAGE_SERVER.DOWNLOADED',
PYTHON_LANGUAGE_SERVER_ERROR = 'PYTHON_LANGUAGE_SERVER.ERROR',
PYTHON_LANGUAGE_SERVER_STARTUP = 'PYTHON_LANGUAGE_SERVER.STARTUP',
PYTHON_LANGUAGE_SERVER_READY = 'PYTHON_LANGUAGE_SERVER.READY',
PYTHON_LANGUAGE_SERVER_PLATFORM_NOT_SUPPORTED = 'PYTHON_LANGUAGE_SERVER.PLATFORM_NOT_SUPPORTED',
PYTHON_LANGUAGE_SERVER_PLATFORM_SUPPORTED = 'PYTHON_LANGUAGE_SERVER.PLATFORM_SUPPORTED',
PYTHON_LANGUAGE_SERVER_TELEMETRY = 'PYTHON_LANGUAGE_SERVER.EVENT',
PYTHON_EXPERIMENTS = 'PYTHON_EXPERIMENTS',
Expand Down
8 changes: 2 additions & 6 deletions src/client/telemetry/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -299,13 +299,11 @@ export interface IEventNamePropertyMapping {
[EventName.PYTHON_INTERPRETER_DISCOVERY]: InterpreterDiscovery;
[EventName.PYTHON_INTERPRETER_ACTIVATE_ENVIRONMENT_PROMPT]: { selection: 'Yes' | 'No' | 'Ignore' | undefined };
[EventName.PYTHON_LANGUAGE_SERVER_SWITCHED]: { change: 'Switch to Jedi from LS' | 'Switch to LS from Jedi' };
[EventName.PYTHON_LANGUAGE_SERVER_ANALYSISTIME]: { success: boolean };
[EventName.PYTHON_LANGUAGE_SERVER_DOWNLOADED]: LanguageServerVersionTelemetry;
[EventName.PYTHON_LANGUAGE_SERVER_ENABLED]: never | undefined;
[EventName.PYTHON_LANGUAGE_SERVER_ERROR]: LanguageServerErrorTelemetry;
[EventName.PYTHON_LANGUAGE_SERVER_EXTRACTED]: LanguageServerVersionTelemetry;
[EventName.PYTHON_LANGUAGE_SERVER_LIST_BLOB_STORE_PACKAGES]: never | undefined;
[EventName.PYTHON_LANGUAGE_SERVER_PLATFORM_NOT_SUPPORTED]: never | undefined;
[EventName.PYTHON_LANGUAGE_SERVER_PLATFORM_SUPPORTED]: LanguageServePlatformSupported;
[EventName.PYTHON_LANGUAGE_SERVER_READY]: never | undefined;
[EventName.PYTHON_LANGUAGE_SERVER_STARTUP]: never | undefined;
Expand All @@ -325,6 +323,8 @@ export interface IEventNamePropertyMapping {
[EventName.TERMINAL_CREATE]: TerminalTelemetry;
[EventName.UNITTEST_DISCOVER]: TestDiscoverytTelemetry;
[EventName.UNITTEST_DISCOVER_WITH_PYCODE]: never | undefined;
[EventName.UNITTEST_NAVIGATE]: { byFile?: boolean; byFunction?: boolean; bySuite?: boolean; focus_code?: boolean };
[EventName.UNITTEST_EXPLORER_WORK_SPACE_COUNT]: { count: number };
[EventName.UNITTEST_RUN]: TestRunTelemetry;
[EventName.UNITTEST_STOP]: never | undefined;
[EventName.UNITTEST_DISABLE]: never | undefined;
Expand Down Expand Up @@ -403,10 +403,6 @@ export interface IEventNamePropertyMapping {
[Telemetry.WebviewMonacoStyleUpdate]: never | undefined;
[Telemetry.WebviewStartup]: { type: string };
[Telemetry.WebviewStyleUpdate]: never | undefined;
[EventName.UNITTEST_NAVIGATE_TEST_FILE]: never | undefined;
[EventName.UNITTEST_NAVIGATE_TEST_FUNCTION]: { focus_code: boolean };
[EventName.UNITTEST_NAVIGATE_TEST_SUITE]: { focus_code: boolean };
[EventName.UNITTEST_EXPLORER_WORK_SPACE_COUNT]: { count: number };
/*
Telemetry event sent with details of Jedi Memory usage.
memory - Memory usage of Process in kb.
Expand Down
2 changes: 1 addition & 1 deletion src/client/testing/navigation/fileNavigator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import { ITestCodeNavigator, ITestNavigatorHelper } from './types';
export class TestFileCodeNavigator implements ITestCodeNavigator {
constructor(@inject(ITestNavigatorHelper) private readonly helper: ITestNavigatorHelper) { }
@swallowExceptions('Navigate to test file')
@captureTelemetry(EventName.UNITTEST_NAVIGATE_TEST_FILE, undefined, true)
@captureTelemetry(EventName.UNITTEST_NAVIGATE, { byFile: true })
public async navigateTo(_: Uri, item: TestFile, __: boolean): Promise<void> {
await this.helper.openFile(Uri.file(item.fullPath));
}
Expand Down
4 changes: 2 additions & 2 deletions src/client/testing/navigation/functionNavigator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ export class TestFunctionCodeNavigator implements ITestCodeNavigator {
@inject(ITestCollectionStorageService) private readonly storage: ITestCollectionStorageService
) { }
@swallowExceptions('Navigate to test function')
@captureTelemetry(EventName.UNITTEST_NAVIGATE_TEST_FUNCTION, undefined, true)
@captureTelemetry(EventName.UNITTEST_NAVIGATE, { byFunction: true }, true) // To measure execution time.
public async navigateTo(resource: Uri, fn: TestFunction, focus: boolean = true): Promise<void> {
sendTelemetryEvent(EventName.UNITTEST_NAVIGATE_TEST_FUNCTION, undefined, { focus_code: focus });
sendTelemetryEvent(EventName.UNITTEST_NAVIGATE, undefined, { focus_code: focus, byFunction: true });
if (this.cancellationToken) {
this.cancellationToken.cancel();
}
Expand Down
4 changes: 2 additions & 2 deletions src/client/testing/navigation/suiteNavigator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ export class TestSuiteCodeNavigator implements ITestCodeNavigator {
@inject(ITestCollectionStorageService) private readonly storage: ITestCollectionStorageService
) { }
@swallowExceptions('Navigate to test suite')
@captureTelemetry(EventName.UNITTEST_NAVIGATE_TEST_SUITE, undefined, true)
@captureTelemetry(EventName.UNITTEST_NAVIGATE, { bySuite: true }, true) // For measuring execution time.
public async navigateTo(resource: Uri, suite: TestSuite, focus: boolean = true): Promise<void> {
sendTelemetryEvent(EventName.UNITTEST_NAVIGATE_TEST_SUITE, undefined, { focus_code: focus });
sendTelemetryEvent(EventName.UNITTEST_NAVIGATE, undefined, { focus_code: focus, bySuite: true });
if (this.cancellationToken) {
this.cancellationToken.cancel();
}
Expand Down