Skip to content

Commit 26e040f

Browse files
authored
add accepted lines of code of Q chat (#4775)
1 parent c9f9435 commit 26e040f

File tree

3 files changed

+12
-1
lines changed

3 files changed

+12
-1
lines changed

packages/core/src/codewhisperer/client/user-service-2.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -363,6 +363,7 @@
363363
"interactionType": { "shape": "ChatMessageInteractionType" },
364364
"interactionTarget": { "shape": "String" },
365365
"acceptedCharacterCount": { "shape": "Integer" },
366+
"acceptedLineCount": { "shape": "Integer" },
366367
"acceptedSnippetHasReference": { "shape": "Boolean" }
367368
}
368369
},

packages/core/src/codewhispererChat/controllers/chat/telemetryHelper.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
33
* SPDX-License-Identifier: Apache-2.0
44
*/
5-
65
import { UserIntent } from '@amzn/codewhisperer-streaming'
76
import {
87
AmazonqAddMessage,
@@ -158,6 +157,7 @@ export class CWCTelemetryHelper {
158157
cwsprChatMessageId: message.messageId,
159158
cwsprChatInteractionType: 'insertAtCursor',
160159
cwsprChatAcceptedCharactersLength: message.code.length,
160+
cwsprChatAcceptedNumberOfLines: message.code.split('\n').length,
161161
cwsprChatInteractionTarget: message.insertionTargetType,
162162
cwsprChatHasReference: message.codeReference && message.codeReference.length > 0,
163163
cwsprChatCodeBlockIndex: message.codeBlockIndex,
@@ -249,6 +249,7 @@ export class CWCTelemetryHelper {
249249
interactionType: this.getCWClientTelemetryInteractionType(event.cwsprChatInteractionType),
250250
interactionTarget: event.cwsprChatInteractionTarget,
251251
acceptedCharacterCount: event.cwsprChatAcceptedCharactersLength,
252+
acceptedLineCount: event.cwsprChatAcceptedNumberOfLines,
252253
acceptedSnippetHasReference: false,
253254
},
254255
},

packages/core/src/shared/telemetry/vscodeTelemetry.json

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -271,6 +271,11 @@
271271
"type": "int",
272272
"description": "Count of code characters copied to the editor"
273273
},
274+
{
275+
"name": "cwsprChatAcceptedNumberOfLines",
276+
"type": "int",
277+
"description": "Count of lines of code copied to the editor"
278+
},
274279
{
275280
"name": "cwsprChatHasReference",
276281
"type": "boolean",
@@ -830,6 +835,10 @@
830835
"type": "cwsprChatAcceptedCharactersLength",
831836
"required": false
832837
},
838+
{
839+
"type": "cwsprChatAcceptedNumberOfLines",
840+
"required": false
841+
},
833842
{
834843
"type": "cwsprChatHasReference",
835844
"required": false

0 commit comments

Comments
 (0)