Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
microsoft
GitHub Repository: microsoft/vscode
Path: blob/main/src/vs/workbench/contrib/debug/common/debugTelemetry.ts
3296 views
1
/*---------------------------------------------------------------------------------------------
2
* Copyright (c) Microsoft Corporation. All rights reserved.
3
* Licensed under the MIT License. See License.txt in the project root for license information.
4
*--------------------------------------------------------------------------------------------*/
5
6
import { IDebugModel, IDebugSession, AdapterEndEvent } from './debug.js';
7
import { ITelemetryService } from '../../../../platform/telemetry/common/telemetry.js';
8
import { Debugger } from './debugger.js';
9
10
export class DebugTelemetry {
11
12
constructor(
13
private readonly model: IDebugModel,
14
@ITelemetryService private readonly telemetryService: ITelemetryService,
15
) { }
16
17
logDebugSessionStart(dbgr: Debugger, launchJsonExists: boolean) {
18
const extension = dbgr.getMainExtensionDescriptor();
19
/* __GDPR__
20
"debugSessionStart" : {
21
"owner": "connor4312",
22
"type": { "classification": "SystemMetaData", "purpose": "FeatureInsight" },
23
"breakpointCount": { "classification": "SystemMetaData", "purpose": "FeatureInsight", "isMeasurement": true },
24
"exceptionBreakpoints": { "classification": "SystemMetaData", "purpose": "FeatureInsight" },
25
"watchExpressionsCount": { "classification": "SystemMetaData", "purpose": "FeatureInsight", "isMeasurement": true },
26
"extensionName": { "classification": "PublicNonPersonalData", "purpose": "FeatureInsight" },
27
"isBuiltin": { "classification": "SystemMetaData", "purpose": "FeatureInsight", "isMeasurement": true},
28
"launchJsonExists": { "classification": "SystemMetaData", "purpose": "FeatureInsight", "isMeasurement": true }
29
}
30
*/
31
this.telemetryService.publicLog('debugSessionStart', {
32
type: dbgr.type,
33
breakpointCount: this.model.getBreakpoints().length,
34
exceptionBreakpoints: this.model.getExceptionBreakpoints(),
35
watchExpressionsCount: this.model.getWatchExpressions().length,
36
extensionName: extension.identifier.value,
37
isBuiltin: extension.isBuiltin,
38
launchJsonExists
39
});
40
}
41
42
logDebugSessionStop(session: IDebugSession, adapterExitEvent: AdapterEndEvent) {
43
44
const breakpoints = this.model.getBreakpoints();
45
46
/* __GDPR__
47
"debugSessionStop" : {
48
"owner": "connor4312",
49
"type" : { "classification": "SystemMetaData", "purpose": "FeatureInsight" },
50
"success": { "classification": "SystemMetaData", "purpose": "FeatureInsight", "isMeasurement": true },
51
"sessionLengthInSeconds": { "classification": "SystemMetaData", "purpose": "FeatureInsight", "isMeasurement": true },
52
"breakpointCount": { "classification": "SystemMetaData", "purpose": "FeatureInsight", "isMeasurement": true },
53
"watchExpressionsCount": { "classification": "SystemMetaData", "purpose": "FeatureInsight", "isMeasurement": true }
54
}
55
*/
56
this.telemetryService.publicLog('debugSessionStop', {
57
type: session && session.configuration.type,
58
success: adapterExitEvent.emittedStopped || breakpoints.length === 0,
59
sessionLengthInSeconds: adapterExitEvent.sessionLengthInSeconds,
60
breakpointCount: breakpoints.length,
61
watchExpressionsCount: this.model.getWatchExpressions().length
62
});
63
}
64
}
65
66