Skip to content

Commit 6650a5d

Browse files
authored
feat(amazonq): Add accepted lines of code of Q chat telemetry (#4337)
1 parent 28b1aa5 commit 6650a5d

File tree

3 files changed

+12
-0
lines changed

3 files changed

+12
-0
lines changed

plugins/amazonq/chat/jetbrains-community/src/software/aws/toolkits/jetbrains/services/cwc/controller/chat/telemetry/TelemetryHelper.kt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -207,6 +207,7 @@ class TelemetryHelper(private val context: AmazonQAppInitContext, private val se
207207
cwsprChatMessageId = message.messageId,
208208
cwsprChatInteractionType = CwsprChatInteractionType.InsertAtCursor,
209209
cwsprChatAcceptedCharactersLength = message.code.length,
210+
cwsprChatAcceptedNumberOfLines = message.code.lines().size,
210211
cwsprChatInteractionTarget = message.insertionTargetType,
211212
cwsprChatHasReference = null,
212213
credentialStartUrl = getStartUrl(context.project)
@@ -217,6 +218,7 @@ class TelemetryHelper(private val context: AmazonQAppInitContext, private val se
217218
interactionType(ChatMessageInteractionType.INSERT_AT_CURSOR)
218219
interactionTarget(message.insertionTargetType)
219220
acceptedCharacterCount(message.code.length)
221+
acceptedLineCount(message.code.lines().size)
220222
}.build()
221223
}
222224

plugins/core/jetbrains-community/resources/telemetryOverride.json

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,11 @@
170170
"type": "int",
171171
"description": "Count of code characters copied to the editor"
172172
},
173+
{
174+
"name": "cwsprChatAcceptedNumberOfLines",
175+
"type": "int",
176+
"description": "Count of lines of code copied to the editor"
177+
},
173178
{
174179
"name": "cwsprChatHasReference",
175180
"type": "boolean",
@@ -468,6 +473,10 @@
468473
"type": "cwsprChatAcceptedCharactersLength",
469474
"required": false
470475
},
476+
{
477+
"type": "cwsprChatAcceptedNumberOfLines",
478+
"required": false
479+
},
471480
{
472481
"type": "cwsprChatHasReference",
473482
"required": false

plugins/core/sdk-codegen/codegen-resources/codewhispererruntime/service-2.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -388,6 +388,7 @@
388388
"interactionType": { "shape": "ChatMessageInteractionType" },
389389
"interactionTarget": { "shape": "String" },
390390
"acceptedCharacterCount": { "shape": "Integer" },
391+
"acceptedLineCount": { "shape": "Integer" },
391392
"acceptedSnippetHasReference": { "shape": "Boolean" }
392393
}
393394
},

0 commit comments

Comments
 (0)