Path: blob/main/src/vs/workbench/contrib/mergeEditor/browser/telemetry.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 { ITelemetryService } from '../../../../platform/telemetry/common/telemetry.js';6import { InputNumber } from './model/modifiedBaseRange.js';7export class MergeEditorTelemetry {8constructor(9@ITelemetryService private readonly telemetryService: ITelemetryService10) { }1112reportMergeEditorOpened(args: {13conflictCount: number;14combinableConflictCount: number;1516baseVisible: boolean;17isColumnView: boolean;18baseTop: boolean;19}): void {20this.telemetryService.publicLog2<{21conflictCount: number;22combinableConflictCount: number;2324baseVisible: boolean;25isColumnView: boolean;26baseTop: boolean;27}, {28owner: 'hediet';2930conflictCount: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'To understand how many conflicts typically occur' };31combinableConflictCount: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'To evaluate how useful the smart-merge feature is' };3233baseVisible: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'To understand how many users use the base view to solve a conflict' };34isColumnView: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'To gain insight which layout should be default' };35baseTop: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'To gain insight which layout should be default for the base view' };3637comment: 'This event tracks when a user opens a 3 way merge editor. The associated data helps to fine-tune the merge editor.';38}>('mergeEditor.opened', {39conflictCount: args.conflictCount,40combinableConflictCount: args.combinableConflictCount,4142baseVisible: args.baseVisible,43isColumnView: args.isColumnView,44baseTop: args.baseTop,45});46}4748reportLayoutChange(args: {49baseVisible: boolean;50isColumnView: boolean;51baseTop: boolean;52}): void {53this.telemetryService.publicLog2<{54baseVisible: boolean;55isColumnView: boolean;56baseTop: boolean;57}, {58owner: 'hediet';5960baseVisible: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'To understand how many users use the base view to solve a conflict' };61isColumnView: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'To gain insight which layout should be default' };62baseTop: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'To gain insight which layout should be default for the base view' };6364comment: '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.';65}>('mergeEditor.layoutChanged', {66baseVisible: args.baseVisible,67isColumnView: args.isColumnView,68baseTop: args.baseTop,69});70}7172reportMergeEditorClosed(args: {73conflictCount: number;74combinableConflictCount: number;7576durationOpenedSecs: number;77remainingConflictCount: number;78accepted: boolean;7980conflictsResolvedWithBase: number;81conflictsResolvedWithInput1: number;82conflictsResolvedWithInput2: number;83conflictsResolvedWithSmartCombination: number;8485manuallySolvedConflictCountThatEqualNone: number;86manuallySolvedConflictCountThatEqualSmartCombine: number;87manuallySolvedConflictCountThatEqualInput1: number;88manuallySolvedConflictCountThatEqualInput2: number;8990manuallySolvedConflictCountThatEqualNoneAndStartedWithBase: number;91manuallySolvedConflictCountThatEqualNoneAndStartedWithInput1: number;92manuallySolvedConflictCountThatEqualNoneAndStartedWithInput2: number;93manuallySolvedConflictCountThatEqualNoneAndStartedWithBothNonSmart: number;94manuallySolvedConflictCountThatEqualNoneAndStartedWithBothSmart: number;95}): void {96this.telemetryService.publicLog2<{97conflictCount: number;98combinableConflictCount: number;99100durationOpenedSecs: number;101remainingConflictCount: number;102accepted: boolean;103104conflictsResolvedWithBase: number;105conflictsResolvedWithInput1: number;106conflictsResolvedWithInput2: number;107conflictsResolvedWithSmartCombination: number;108109manuallySolvedConflictCountThatEqualNone: number;110manuallySolvedConflictCountThatEqualSmartCombine: number;111manuallySolvedConflictCountThatEqualInput1: number;112manuallySolvedConflictCountThatEqualInput2: number;113114manuallySolvedConflictCountThatEqualNoneAndStartedWithBase: number;115manuallySolvedConflictCountThatEqualNoneAndStartedWithInput1: number;116manuallySolvedConflictCountThatEqualNoneAndStartedWithInput2: number;117manuallySolvedConflictCountThatEqualNoneAndStartedWithBothNonSmart: number;118manuallySolvedConflictCountThatEqualNoneAndStartedWithBothSmart: number;119}, {120owner: 'hediet';121122conflictCount: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'To understand how many conflicts typically occur' };123combinableConflictCount: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'To evaluate how useful the smart-merge feature is' };124125durationOpenedSecs: { 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.' };126remainingConflictCount: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'Indicates how many conflicts were skipped. Should be zero for a successful merge.' };127accepted: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'Indicates if the user completed the merge successfully or just closed the editor' };128129conflictsResolvedWithBase: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'To understand how many conflicts are resolved with base' };130conflictsResolvedWithInput1: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'To understand how many conflicts are resolved with input1' };131conflictsResolvedWithInput2: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'To understand how many conflicts are resolved with input2' };132conflictsResolvedWithSmartCombination: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'To understand how many conflicts are resolved with smart combination' };133134manuallySolvedConflictCountThatEqualNone: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'Indicates how many conflicts were solved manually that are not recognized by the merge editor.' };135manuallySolvedConflictCountThatEqualSmartCombine: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'Indicates how many conflicts were solved manually that equal the smart combination of the inputs.' };136manuallySolvedConflictCountThatEqualInput1: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'Indicates how many conflicts were solved manually that equal just input 1' };137manuallySolvedConflictCountThatEqualInput2: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'Indicates how many conflicts were solved manually that equal just input 2' };138139manuallySolvedConflictCountThatEqualNoneAndStartedWithBase: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'Indicates how many manually solved conflicts that are not recognized started with base' };140manuallySolvedConflictCountThatEqualNoneAndStartedWithInput1: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'Indicates how many manually solved conflicts that are not recognized started with input1' };141manuallySolvedConflictCountThatEqualNoneAndStartedWithInput2: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'Indicates how many manually solved conflicts that are not recognized started with input2' };142manuallySolvedConflictCountThatEqualNoneAndStartedWithBothNonSmart: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'Indicates how many manually solved conflicts that are not recognized started with both (non-smart combination)' };143manuallySolvedConflictCountThatEqualNoneAndStartedWithBothSmart: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'Indicates how many manually solved conflicts that are not recognized started with both (smart-combination)' };144145comment: '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)';146}>('mergeEditor.closed', {147conflictCount: args.conflictCount,148combinableConflictCount: args.combinableConflictCount,149150durationOpenedSecs: args.durationOpenedSecs,151remainingConflictCount: args.remainingConflictCount,152accepted: args.accepted,153154conflictsResolvedWithBase: args.conflictsResolvedWithBase,155conflictsResolvedWithInput1: args.conflictsResolvedWithInput1,156conflictsResolvedWithInput2: args.conflictsResolvedWithInput2,157conflictsResolvedWithSmartCombination: args.conflictsResolvedWithSmartCombination,158159manuallySolvedConflictCountThatEqualNone: args.manuallySolvedConflictCountThatEqualNone,160manuallySolvedConflictCountThatEqualSmartCombine: args.manuallySolvedConflictCountThatEqualSmartCombine,161manuallySolvedConflictCountThatEqualInput1: args.manuallySolvedConflictCountThatEqualInput1,162manuallySolvedConflictCountThatEqualInput2: args.manuallySolvedConflictCountThatEqualInput2,163164manuallySolvedConflictCountThatEqualNoneAndStartedWithBase: args.manuallySolvedConflictCountThatEqualNoneAndStartedWithBase,165manuallySolvedConflictCountThatEqualNoneAndStartedWithInput1: args.manuallySolvedConflictCountThatEqualNoneAndStartedWithInput1,166manuallySolvedConflictCountThatEqualNoneAndStartedWithInput2: args.manuallySolvedConflictCountThatEqualNoneAndStartedWithInput2,167manuallySolvedConflictCountThatEqualNoneAndStartedWithBothNonSmart: args.manuallySolvedConflictCountThatEqualNoneAndStartedWithBothNonSmart,168manuallySolvedConflictCountThatEqualNoneAndStartedWithBothSmart: args.manuallySolvedConflictCountThatEqualNoneAndStartedWithBothSmart,169});170}171172reportAcceptInvoked(inputNumber: InputNumber, otherAccepted: boolean): void {173this.telemetryService.publicLog2<{174otherAccepted: boolean;175isInput1: boolean;176}, {177owner: 'hediet';178otherAccepted: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'Indicates if the user already accepted the other side' };179isInput1: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'Indicates if the user accepted input 1 or input 2' };180comment: 'This event tracks when a user accepts one side of a conflict.';181}>('mergeEditor.action.accept', {182otherAccepted: otherAccepted,183isInput1: inputNumber === 1,184});185}186187reportSmartCombinationInvoked(otherAccepted: boolean): void {188this.telemetryService.publicLog2<{189otherAccepted: boolean;190}, {191owner: 'hediet';192otherAccepted: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'Indicates if the user immediately clicks on accept both or only after the other side has been accepted' };193comment: 'This event tracks when the user clicks on "Accept Both".';194}>('mergeEditor.action.smartCombination', {195otherAccepted: otherAccepted,196});197}198199reportRemoveInvoked(inputNumber: InputNumber, otherAccepted: boolean): void {200this.telemetryService.publicLog2<{201otherAccepted: boolean;202isInput1: boolean;203}, {204owner: 'hediet';205otherAccepted: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'Indicates if the user accepted the other side' };206isInput1: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'Indicates if the user accepted input 1 or input 2' };207comment: 'This event tracks when a user un-accepts one side of a conflict.';208}>('mergeEditor.action.remove', {209otherAccepted: otherAccepted,210isInput1: inputNumber === 1,211});212}213214reportResetToBaseInvoked(): void {215this.telemetryService.publicLog2<{216}, {217owner: 'hediet';218comment: 'This event tracks when the user invokes "Reset To Base".';219}>('mergeEditor.action.resetToBase', {});220}221222reportNavigationToNextConflict(): void {223this.telemetryService.publicLog2<{224}, {225owner: 'hediet';226comment: 'This event tracks when the user navigates to the next conflict".';227}>('mergeEditor.action.goToNextConflict', {228229});230}231232reportNavigationToPreviousConflict(): void {233this.telemetryService.publicLog2<{234235}, {236owner: 'hediet';237comment: 'This event tracks when the user navigates to the previous conflict".';238}>('mergeEditor.action.goToPreviousConflict', {239240});241}242243reportConflictCounterClicked(): void {244this.telemetryService.publicLog2<{245}, {246owner: 'hediet';247comment: 'This event tracks when the user clicks on the conflict counter to navigate to the next conflict.';248}>('mergeEditor.action.conflictCounterClicked', {});249}250}251252253