Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
microsoft
GitHub Repository: microsoft/vscode
Path: blob/main/src/vs/workbench/contrib/mergeEditor/browser/telemetry.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 { ITelemetryService } from '../../../../platform/telemetry/common/telemetry.js';
7
import { InputNumber } from './model/modifiedBaseRange.js';
8
export class MergeEditorTelemetry {
9
constructor(
10
@ITelemetryService private readonly telemetryService: ITelemetryService
11
) { }
12
13
reportMergeEditorOpened(args: {
14
conflictCount: number;
15
combinableConflictCount: number;
16
17
baseVisible: boolean;
18
isColumnView: boolean;
19
baseTop: boolean;
20
}): void {
21
this.telemetryService.publicLog2<{
22
conflictCount: number;
23
combinableConflictCount: number;
24
25
baseVisible: boolean;
26
isColumnView: boolean;
27
baseTop: boolean;
28
}, {
29
owner: 'hediet';
30
31
conflictCount: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'To understand how many conflicts typically occur' };
32
combinableConflictCount: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'To evaluate how useful the smart-merge feature is' };
33
34
baseVisible: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'To understand how many users use the base view to solve a conflict' };
35
isColumnView: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'To gain insight which layout should be default' };
36
baseTop: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'To gain insight which layout should be default for the base view' };
37
38
comment: 'This event tracks when a user opens a 3 way merge editor. The associated data helps to fine-tune the merge editor.';
39
}>('mergeEditor.opened', {
40
conflictCount: args.conflictCount,
41
combinableConflictCount: args.combinableConflictCount,
42
43
baseVisible: args.baseVisible,
44
isColumnView: args.isColumnView,
45
baseTop: args.baseTop,
46
});
47
}
48
49
reportLayoutChange(args: {
50
baseVisible: boolean;
51
isColumnView: boolean;
52
baseTop: boolean;
53
}): void {
54
this.telemetryService.publicLog2<{
55
baseVisible: boolean;
56
isColumnView: boolean;
57
baseTop: boolean;
58
}, {
59
owner: 'hediet';
60
61
baseVisible: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'To understand how many users use the base view to solve a conflict' };
62
isColumnView: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'To gain insight which layout should be default' };
63
baseTop: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'To gain insight which layout should be default for the base view' };
64
65
comment: 'This event tracks when a user changes the layout of the 3 way merge editor. This is useful to understand what layout should be default.';
66
}>('mergeEditor.layoutChanged', {
67
baseVisible: args.baseVisible,
68
isColumnView: args.isColumnView,
69
baseTop: args.baseTop,
70
});
71
}
72
73
reportMergeEditorClosed(args: {
74
conflictCount: number;
75
combinableConflictCount: number;
76
77
durationOpenedSecs: number;
78
remainingConflictCount: number;
79
accepted: boolean;
80
81
conflictsResolvedWithBase: number;
82
conflictsResolvedWithInput1: number;
83
conflictsResolvedWithInput2: number;
84
conflictsResolvedWithSmartCombination: number;
85
86
manuallySolvedConflictCountThatEqualNone: number;
87
manuallySolvedConflictCountThatEqualSmartCombine: number;
88
manuallySolvedConflictCountThatEqualInput1: number;
89
manuallySolvedConflictCountThatEqualInput2: number;
90
91
manuallySolvedConflictCountThatEqualNoneAndStartedWithBase: number;
92
manuallySolvedConflictCountThatEqualNoneAndStartedWithInput1: number;
93
manuallySolvedConflictCountThatEqualNoneAndStartedWithInput2: number;
94
manuallySolvedConflictCountThatEqualNoneAndStartedWithBothNonSmart: number;
95
manuallySolvedConflictCountThatEqualNoneAndStartedWithBothSmart: number;
96
}): void {
97
this.telemetryService.publicLog2<{
98
conflictCount: number;
99
combinableConflictCount: number;
100
101
durationOpenedSecs: number;
102
remainingConflictCount: number;
103
accepted: boolean;
104
105
conflictsResolvedWithBase: number;
106
conflictsResolvedWithInput1: number;
107
conflictsResolvedWithInput2: number;
108
conflictsResolvedWithSmartCombination: number;
109
110
manuallySolvedConflictCountThatEqualNone: number;
111
manuallySolvedConflictCountThatEqualSmartCombine: number;
112
manuallySolvedConflictCountThatEqualInput1: number;
113
manuallySolvedConflictCountThatEqualInput2: number;
114
115
manuallySolvedConflictCountThatEqualNoneAndStartedWithBase: number;
116
manuallySolvedConflictCountThatEqualNoneAndStartedWithInput1: number;
117
manuallySolvedConflictCountThatEqualNoneAndStartedWithInput2: number;
118
manuallySolvedConflictCountThatEqualNoneAndStartedWithBothNonSmart: number;
119
manuallySolvedConflictCountThatEqualNoneAndStartedWithBothSmart: number;
120
}, {
121
owner: 'hediet';
122
123
conflictCount: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'To understand how many conflicts typically occur' };
124
combinableConflictCount: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'To evaluate how useful the smart-merge feature is' };
125
126
durationOpenedSecs: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'Indicates how long the merge editor was open before it was closed. This can be compared with the inline experience to investigate time savings.' };
127
remainingConflictCount: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'Indicates how many conflicts were skipped. Should be zero for a successful merge.' };
128
accepted: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'Indicates if the user completed the merge successfully or just closed the editor' };
129
130
conflictsResolvedWithBase: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'To understand how many conflicts are resolved with base' };
131
conflictsResolvedWithInput1: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'To understand how many conflicts are resolved with input1' };
132
conflictsResolvedWithInput2: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'To understand how many conflicts are resolved with input2' };
133
conflictsResolvedWithSmartCombination: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'To understand how many conflicts are resolved with smart combination' };
134
135
manuallySolvedConflictCountThatEqualNone: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'Indicates how many conflicts were solved manually that are not recognized by the merge editor.' };
136
manuallySolvedConflictCountThatEqualSmartCombine: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'Indicates how many conflicts were solved manually that equal the smart combination of the inputs.' };
137
manuallySolvedConflictCountThatEqualInput1: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'Indicates how many conflicts were solved manually that equal just input 1' };
138
manuallySolvedConflictCountThatEqualInput2: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'Indicates how many conflicts were solved manually that equal just input 2' };
139
140
manuallySolvedConflictCountThatEqualNoneAndStartedWithBase: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'Indicates how many manually solved conflicts that are not recognized started with base' };
141
manuallySolvedConflictCountThatEqualNoneAndStartedWithInput1: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'Indicates how many manually solved conflicts that are not recognized started with input1' };
142
manuallySolvedConflictCountThatEqualNoneAndStartedWithInput2: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'Indicates how many manually solved conflicts that are not recognized started with input2' };
143
manuallySolvedConflictCountThatEqualNoneAndStartedWithBothNonSmart: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'Indicates how many manually solved conflicts that are not recognized started with both (non-smart combination)' };
144
manuallySolvedConflictCountThatEqualNoneAndStartedWithBothSmart: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'Indicates how many manually solved conflicts that are not recognized started with both (smart-combination)' };
145
146
comment: 'This event tracks when a user closes a merge editor. It also tracks how the user solved the merge conflicts. This data can be used to improve the UX of the merge editor. This event will be fired rarely (less than 200k per week)';
147
}>('mergeEditor.closed', {
148
conflictCount: args.conflictCount,
149
combinableConflictCount: args.combinableConflictCount,
150
151
durationOpenedSecs: args.durationOpenedSecs,
152
remainingConflictCount: args.remainingConflictCount,
153
accepted: args.accepted,
154
155
conflictsResolvedWithBase: args.conflictsResolvedWithBase,
156
conflictsResolvedWithInput1: args.conflictsResolvedWithInput1,
157
conflictsResolvedWithInput2: args.conflictsResolvedWithInput2,
158
conflictsResolvedWithSmartCombination: args.conflictsResolvedWithSmartCombination,
159
160
manuallySolvedConflictCountThatEqualNone: args.manuallySolvedConflictCountThatEqualNone,
161
manuallySolvedConflictCountThatEqualSmartCombine: args.manuallySolvedConflictCountThatEqualSmartCombine,
162
manuallySolvedConflictCountThatEqualInput1: args.manuallySolvedConflictCountThatEqualInput1,
163
manuallySolvedConflictCountThatEqualInput2: args.manuallySolvedConflictCountThatEqualInput2,
164
165
manuallySolvedConflictCountThatEqualNoneAndStartedWithBase: args.manuallySolvedConflictCountThatEqualNoneAndStartedWithBase,
166
manuallySolvedConflictCountThatEqualNoneAndStartedWithInput1: args.manuallySolvedConflictCountThatEqualNoneAndStartedWithInput1,
167
manuallySolvedConflictCountThatEqualNoneAndStartedWithInput2: args.manuallySolvedConflictCountThatEqualNoneAndStartedWithInput2,
168
manuallySolvedConflictCountThatEqualNoneAndStartedWithBothNonSmart: args.manuallySolvedConflictCountThatEqualNoneAndStartedWithBothNonSmart,
169
manuallySolvedConflictCountThatEqualNoneAndStartedWithBothSmart: args.manuallySolvedConflictCountThatEqualNoneAndStartedWithBothSmart,
170
});
171
}
172
173
reportAcceptInvoked(inputNumber: InputNumber, otherAccepted: boolean): void {
174
this.telemetryService.publicLog2<{
175
otherAccepted: boolean;
176
isInput1: boolean;
177
}, {
178
owner: 'hediet';
179
otherAccepted: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'Indicates if the user already accepted the other side' };
180
isInput1: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'Indicates if the user accepted input 1 or input 2' };
181
comment: 'This event tracks when a user accepts one side of a conflict.';
182
}>('mergeEditor.action.accept', {
183
otherAccepted: otherAccepted,
184
isInput1: inputNumber === 1,
185
});
186
}
187
188
reportSmartCombinationInvoked(otherAccepted: boolean): void {
189
this.telemetryService.publicLog2<{
190
otherAccepted: boolean;
191
}, {
192
owner: 'hediet';
193
otherAccepted: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'Indicates if the user immediately clicks on accept both or only after the other side has been accepted' };
194
comment: 'This event tracks when the user clicks on "Accept Both".';
195
}>('mergeEditor.action.smartCombination', {
196
otherAccepted: otherAccepted,
197
});
198
}
199
200
reportRemoveInvoked(inputNumber: InputNumber, otherAccepted: boolean): void {
201
this.telemetryService.publicLog2<{
202
otherAccepted: boolean;
203
isInput1: boolean;
204
}, {
205
owner: 'hediet';
206
otherAccepted: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'Indicates if the user accepted the other side' };
207
isInput1: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'Indicates if the user accepted input 1 or input 2' };
208
comment: 'This event tracks when a user un-accepts one side of a conflict.';
209
}>('mergeEditor.action.remove', {
210
otherAccepted: otherAccepted,
211
isInput1: inputNumber === 1,
212
});
213
}
214
215
reportResetToBaseInvoked(): void {
216
this.telemetryService.publicLog2<{
217
}, {
218
owner: 'hediet';
219
comment: 'This event tracks when the user invokes "Reset To Base".';
220
}>('mergeEditor.action.resetToBase', {});
221
}
222
223
reportNavigationToNextConflict(): void {
224
this.telemetryService.publicLog2<{
225
}, {
226
owner: 'hediet';
227
comment: 'This event tracks when the user navigates to the next conflict".';
228
}>('mergeEditor.action.goToNextConflict', {
229
230
});
231
}
232
233
reportNavigationToPreviousConflict(): void {
234
this.telemetryService.publicLog2<{
235
236
}, {
237
owner: 'hediet';
238
comment: 'This event tracks when the user navigates to the previous conflict".';
239
}>('mergeEditor.action.goToPreviousConflict', {
240
241
});
242
}
243
244
reportConflictCounterClicked(): void {
245
this.telemetryService.publicLog2<{
246
}, {
247
owner: 'hediet';
248
comment: 'This event tracks when the user clicks on the conflict counter to navigate to the next conflict.';
249
}>('mergeEditor.action.conflictCounterClicked', {});
250
}
251
}
252
253