Path: blob/main/src/vs/workbench/contrib/debug/common/debugTelemetry.ts
3296 views
/*---------------------------------------------------------------------------------------------1* Copyright (c) Microsoft Corporation. All rights reserved.2* Licensed under the MIT License. See License.txt in the project root for license information.3*--------------------------------------------------------------------------------------------*/45import { IDebugModel, IDebugSession, AdapterEndEvent } from './debug.js';6import { ITelemetryService } from '../../../../platform/telemetry/common/telemetry.js';7import { Debugger } from './debugger.js';89export class DebugTelemetry {1011constructor(12private readonly model: IDebugModel,13@ITelemetryService private readonly telemetryService: ITelemetryService,14) { }1516logDebugSessionStart(dbgr: Debugger, launchJsonExists: boolean) {17const extension = dbgr.getMainExtensionDescriptor();18/* __GDPR__19"debugSessionStart" : {20"owner": "connor4312",21"type": { "classification": "SystemMetaData", "purpose": "FeatureInsight" },22"breakpointCount": { "classification": "SystemMetaData", "purpose": "FeatureInsight", "isMeasurement": true },23"exceptionBreakpoints": { "classification": "SystemMetaData", "purpose": "FeatureInsight" },24"watchExpressionsCount": { "classification": "SystemMetaData", "purpose": "FeatureInsight", "isMeasurement": true },25"extensionName": { "classification": "PublicNonPersonalData", "purpose": "FeatureInsight" },26"isBuiltin": { "classification": "SystemMetaData", "purpose": "FeatureInsight", "isMeasurement": true},27"launchJsonExists": { "classification": "SystemMetaData", "purpose": "FeatureInsight", "isMeasurement": true }28}29*/30this.telemetryService.publicLog('debugSessionStart', {31type: dbgr.type,32breakpointCount: this.model.getBreakpoints().length,33exceptionBreakpoints: this.model.getExceptionBreakpoints(),34watchExpressionsCount: this.model.getWatchExpressions().length,35extensionName: extension.identifier.value,36isBuiltin: extension.isBuiltin,37launchJsonExists38});39}4041logDebugSessionStop(session: IDebugSession, adapterExitEvent: AdapterEndEvent) {4243const breakpoints = this.model.getBreakpoints();4445/* __GDPR__46"debugSessionStop" : {47"owner": "connor4312",48"type" : { "classification": "SystemMetaData", "purpose": "FeatureInsight" },49"success": { "classification": "SystemMetaData", "purpose": "FeatureInsight", "isMeasurement": true },50"sessionLengthInSeconds": { "classification": "SystemMetaData", "purpose": "FeatureInsight", "isMeasurement": true },51"breakpointCount": { "classification": "SystemMetaData", "purpose": "FeatureInsight", "isMeasurement": true },52"watchExpressionsCount": { "classification": "SystemMetaData", "purpose": "FeatureInsight", "isMeasurement": true }53}54*/55this.telemetryService.publicLog('debugSessionStop', {56type: session && session.configuration.type,57success: adapterExitEvent.emittedStopped || breakpoints.length === 0,58sessionLengthInSeconds: adapterExitEvent.sessionLengthInSeconds,59breakpointCount: breakpoints.length,60watchExpressionsCount: this.model.getWatchExpressions().length61});62}63}646566